Прошло 2 года.

This commit is contained in:
Кобелев Андрей Андреевич
2026-03-10 22:54:23 +03:00
parent c7636ebd6f
commit a111352dc5
313 changed files with 274971 additions and 1409 deletions

View File

@@ -0,0 +1,17 @@
#include "commands.h"
bool validate_color(uint8_t* inout_color, struct arg_int* arg) {
int user_color = arg->count != 0 ? arg->ival[0] : *inout_color;
if (user_color < 0 || user_color > 0xFF) {
printf(
"Invalid color %d (0x%02x): Must be in range 0x00 to 0xFF.\r\n",
user_color,
(uint8_t)user_color
);
return false;
}
*inout_color = (uint8_t)user_color;
return true;
}