Handle float moves and check the number of arguments

DeltaStage sends moves commands as floats which led to occasional hard crashes,
this avoids it.

Incorrect number of arguments to move commands is now handled gracefully
and this will later be extended to more commands.
This commit is contained in:
JojoDevel 2023-10-06 03:17:14 +00:00 committed by Filip Ayazi
parent 767f86b683
commit 59b5ae50a4
4 changed files with 71 additions and 14 deletions

View file

@ -40,6 +40,11 @@ inline bool read_eeprom_bool(uint16_t address, bool default_value)
const Command end_command = END_COMMAND;
uint8_t parse_arguments(char ** arguments, String, uint8_t);
bool assert_exact_args(uint8_t parsed, uint8_t num_args);
void print_arg_difference(uint8_t parsed, uint8_t expected);
void free_parsed_arguments(char** arguments, uint8_t parsed);
extern void register_module(const Command commands[], void (*loop_fn)(void));
void get_version(String);