X-Git-Url: http://git.droids-corp.org/?p=protos%2Fxbee-avr.git;a=blobdiff_plain;f=commands_gen.c;h=8f962e33bbf09b31aee8a3d25c27805fb9f1d2ca;hp=2c1a11d33260fe4a8945d90ba9cab66d4c023240;hb=HEAD;hpb=57895b3bb2fe0582c589685b7df34f3968b346ec diff --git a/commands_gen.c b/commands_gen.c index 2c1a11d..8f962e3 100644 --- a/commands_gen.c +++ b/commands_gen.c @@ -29,10 +29,6 @@ #include #include -#include - -#include -#include #include #include @@ -113,36 +109,35 @@ const parse_inst_t PROGMEM cmd_bootloader = { }; /**********************************************************/ -/* Scheduler show */ +/* Callout show */ -/* this structure is filled when cmd_scheduler is parsed successfully */ -struct cmd_scheduler_result { +/* this structure is filled when cmd_callout is parsed successfully */ +struct cmd_callout_result { fixed_string_t arg0; fixed_string_t arg1; }; -/* function called when cmd_scheduler is parsed successfully */ -static void cmd_scheduler_parsed(void *parsed_result, void *data) +/* function called when cmd_callout is parsed successfully */ +static void cmd_callout_parsed(void *parsed_result, void *data) { (void)parsed_result; (void)data; - scheduler_dump_events(); - scheduler_stats_dump(); + callout_dump_stats(&xbeeboard.intr_cm); } -const char PROGMEM str_scheduler_arg0[] = "scheduler"; -const parse_token_string_t PROGMEM cmd_scheduler_arg0 = TOKEN_STRING_INITIALIZER(struct cmd_scheduler_result, arg0, str_scheduler_arg0); -const char PROGMEM str_scheduler_arg1[] = "show"; -const parse_token_string_t PROGMEM cmd_scheduler_arg1 = TOKEN_STRING_INITIALIZER(struct cmd_scheduler_result, arg1, str_scheduler_arg1); +const char PROGMEM str_callout_arg0[] = "callout"; +const parse_token_string_t PROGMEM cmd_callout_arg0 = TOKEN_STRING_INITIALIZER(struct cmd_callout_result, arg0, str_callout_arg0); +const char PROGMEM str_callout_arg1[] = "show"; +const parse_token_string_t PROGMEM cmd_callout_arg1 = TOKEN_STRING_INITIALIZER(struct cmd_callout_result, arg1, str_callout_arg1); -const char PROGMEM help_scheduler[] = "Show scheduler events"; -const parse_inst_t PROGMEM cmd_scheduler = { - .f = cmd_scheduler_parsed, /* function to call */ +const char PROGMEM help_callout[] = "Show callout events"; +const parse_inst_t PROGMEM cmd_callout = { + .f = cmd_callout_parsed, /* function to call */ .data = NULL, /* 2nd arg of func */ - .help_str = help_scheduler, + .help_str = help_callout, .tokens = { /* token list, NULL terminated */ - (PGM_P)&cmd_scheduler_arg0, - (PGM_P)&cmd_scheduler_arg1, + (PGM_P)&cmd_callout_arg0, + (PGM_P)&cmd_callout_arg1, NULL, }, }; @@ -162,6 +157,8 @@ struct cmd_log_result { static const char PROGMEM uart_log[] = "uart"; static const char PROGMEM i2c_log[] = "i2c"; static const char PROGMEM default_log[] = "default"; +static const char PROGMEM xbee_log[] = "xbee"; +static const char PROGMEM rc_proto_log[] = "rc_proto"; struct log_name_and_num { const char *name; @@ -172,6 +169,8 @@ static const struct log_name_and_num log_name_and_num[] = { { uart_log, E_UART }, { i2c_log, E_I2C }, { default_log, E_USER_DEFAULT }, + { xbee_log, E_USER_XBEE }, + { rc_proto_log, E_USER_RC_PROTO }, }; static uint8_t @@ -327,7 +326,8 @@ static void cmd_log_type_parsed(void * parsed_result, void *data) const char PROGMEM str_log_arg1_type[] = "type"; const parse_token_string_t PROGMEM cmd_log_arg1_type = TOKEN_STRING_INITIALIZER(struct cmd_log_type_result, arg1, str_log_arg1_type); /* keep it sync with log_name_and_num above */ -const char PROGMEM str_log_arg2_type[] = "uart#rs#servo#traj#i2c#oa#strat#i2cproto#ext#sensor#bd#cs"; +const char PROGMEM str_log_arg2_type[] = + "uart#i2c#i2cproto#default#xbee#rc_proto"; const parse_token_string_t PROGMEM cmd_log_arg2_type = TOKEN_STRING_INITIALIZER(struct cmd_log_type_result, arg2, str_log_arg2_type); const char PROGMEM str_log_arg3[] = "on#off"; const parse_token_string_t PROGMEM cmd_log_arg3 = TOKEN_STRING_INITIALIZER(struct cmd_log_type_result, arg3, str_log_arg3);