+ (prog_void *)&cmd_color_arg0,
+ (prog_void *)&cmd_color_color,
+ NULL,
+ },
+};
+
+
+/**********************************************************/
+/* State1 */
+
+/* this structure is filled when cmd_state1 is parsed successfully */
+struct cmd_state1_result {
+ fixed_string_t arg0;
+ fixed_string_t arg1;
+};
+
+/* function called when cmd_state1 is parsed successfully */
+static void cmd_state1_parsed(void *parsed_result,
+ __attribute__((unused)) void *data)
+{
+ struct cmd_state1_result *res = parsed_result;
+
+ if (!strcmp_P(res->arg1, PSTR("init")))
+ state_init();
+ else if (!strcmp_P(res->arg1, PSTR("off")))
+ state_set_mode(I2C_BALLBOARD_MODE_OFF);
+ else if (!strcmp_P(res->arg1, PSTR("eject")))
+ state_set_mode(I2C_BALLBOARD_MODE_EJECT);
+ else if (!strcmp_P(res->arg1, PSTR("harvest")))
+ state_set_mode(I2C_BALLBOARD_MODE_HARVEST);
+ else if (!strcmp_P(res->arg1, PSTR("prepare")))
+ state_set_mode(I2C_BALLBOARD_MODE_PREP_FORK);
+ else if (!strcmp_P(res->arg1, PSTR("take")))
+ state_set_mode(I2C_BALLBOARD_MODE_TAKE_FORK);
+
+ /* other commands */
+}
+
+prog_char str_state1_arg0[] = "ballboard";
+parse_pgm_token_string_t cmd_state1_arg0 = TOKEN_STRING_INITIALIZER(struct cmd_state1_result, arg0, str_state1_arg0);
+prog_char str_state1_arg1[] = "init#eject#harvest#off#prepare#take";
+parse_pgm_token_string_t cmd_state1_arg1 = TOKEN_STRING_INITIALIZER(struct cmd_state1_result, arg1, str_state1_arg1);
+
+prog_char help_state1[] = "set ballboard mode";
+parse_pgm_inst_t cmd_state1 = {
+ .f = cmd_state1_parsed, /* function to call */
+ .data = NULL, /* 2nd arg of func */
+ .help_str = help_state1,
+ .tokens = { /* token list, NULL terminated */
+ (prog_void *)&cmd_state1_arg0,
+ (prog_void *)&cmd_state1_arg1,
+ NULL,
+ },
+};
+
+/**********************************************************/
+/* State2 */
+
+/* this structure is filled when cmd_state2 is parsed successfully */
+struct cmd_state2_result {
+ fixed_string_t arg0;
+ fixed_string_t arg1;
+ fixed_string_t arg2;
+};
+
+/* function called when cmd_state2 is parsed successfully */
+static void cmd_state2_parsed(void *parsed_result,
+ __attribute__((unused)) void *data)
+{
+}
+
+prog_char str_state2_arg0[] = "ballboard";
+parse_pgm_token_string_t cmd_state2_arg0 = TOKEN_STRING_INITIALIZER(struct cmd_state2_result, arg0, str_state2_arg0);
+prog_char str_state2_arg1[] = "xxx";
+parse_pgm_token_string_t cmd_state2_arg1 = TOKEN_STRING_INITIALIZER(struct cmd_state2_result, arg1, str_state2_arg1);
+prog_char str_state2_arg2[] = "left#right";
+parse_pgm_token_string_t cmd_state2_arg2 = TOKEN_STRING_INITIALIZER(struct cmd_state2_result, arg2, str_state2_arg2);
+
+prog_char help_state2[] = "set ballboard mode";
+parse_pgm_inst_t cmd_state2 = {
+ .f = cmd_state2_parsed, /* function to call */
+ .data = NULL, /* 2nd arg of func */
+ .help_str = help_state2,
+ .tokens = { /* token list, NULL terminated */
+ (prog_void *)&cmd_state2_arg0,
+ (prog_void *)&cmd_state2_arg1,
+ (prog_void *)&cmd_state2_arg2,
+ NULL,
+ },
+};
+
+/**********************************************************/
+/* State3 */
+
+/* this structure is filled when cmd_state3 is parsed successfully */
+struct cmd_state3_result {
+ fixed_string_t arg0;
+ fixed_string_t arg1;
+ uint8_t arg2;
+};
+
+/* function called when cmd_state3 is parsed successfully */
+static void cmd_state3_parsed(void *parsed_result,
+ __attribute__((unused)) void *data)
+{
+ struct cmd_state3_result *res = parsed_result;
+
+ if (!strcmp_P(res->arg1, PSTR("xxx"))) {
+ /* xxx = res->arg2 */
+ }
+ else if (!strcmp_P(res->arg1, PSTR("yyy"))) {
+ }
+ state_set_mode(0);
+}
+
+prog_char str_state3_arg0[] = "ballboard";
+parse_pgm_token_string_t cmd_state3_arg0 = TOKEN_STRING_INITIALIZER(struct cmd_state3_result, arg0, str_state3_arg0);
+prog_char str_state3_arg1[] = "xxx";
+parse_pgm_token_string_t cmd_state3_arg1 = TOKEN_STRING_INITIALIZER(struct cmd_state3_result, arg1, str_state3_arg1);
+parse_pgm_token_num_t cmd_state3_arg2 = TOKEN_NUM_INITIALIZER(struct cmd_state3_result, arg2, UINT8);
+
+prog_char help_state3[] = "set ballboard mode";
+parse_pgm_inst_t cmd_state3 = {
+ .f = cmd_state3_parsed, /* function to call */
+ .data = NULL, /* 2nd arg of func */
+ .help_str = help_state3,
+ .tokens = { /* token list, NULL terminated */
+ (prog_void *)&cmd_state3_arg0,
+ (prog_void *)&cmd_state3_arg1,
+ (prog_void *)&cmd_state3_arg2,
+ NULL,
+ },
+};
+
+/**********************************************************/
+/* State_Machine */
+
+/* this structure is filled when cmd_state_machine is parsed successfully */
+struct cmd_state_machine_result {
+ fixed_string_t arg0;
+};
+
+/* function called when cmd_state_machine is parsed successfully */
+static void cmd_state_machine_parsed(__attribute__((unused)) void *parsed_result,
+ __attribute__((unused)) void *data)
+{
+ state_machine();
+}
+
+prog_char str_state_machine_arg0[] = "state_machine";
+parse_pgm_token_string_t cmd_state_machine_arg0 = TOKEN_STRING_INITIALIZER(struct cmd_state_machine_result, arg0, str_state_machine_arg0);
+
+prog_char help_state_machine[] = "launch state machine";
+parse_pgm_inst_t cmd_state_machine = {
+ .f = cmd_state_machine_parsed, /* function to call */
+ .data = NULL, /* 2nd arg of func */
+ .help_str = help_state_machine,
+ .tokens = { /* token list, NULL terminated */
+ (prog_void *)&cmd_state_machine_arg0,
+ NULL,
+ },
+};
+
+/**********************************************************/
+/* State_Debug */
+
+/* this structure is filled when cmd_state_debug is parsed successfully */
+struct cmd_state_debug_result {
+ fixed_string_t arg0;
+ uint8_t on;
+};
+
+/* function called when cmd_state_debug is parsed successfully */
+static void cmd_state_debug_parsed(void *parsed_result,
+ __attribute__((unused)) void *data)
+{
+ struct cmd_state_debug_result *res = parsed_result;
+ state_debug = res->on;
+}
+
+prog_char str_state_debug_arg0[] = "state_debug";
+parse_pgm_token_string_t cmd_state_debug_arg0 = TOKEN_STRING_INITIALIZER(struct cmd_state_debug_result, arg0, str_state_debug_arg0);
+parse_pgm_token_num_t cmd_state_debug_on = TOKEN_NUM_INITIALIZER(struct cmd_state_debug_result, on, UINT8);
+
+prog_char help_state_debug[] = "Set debug for state machine";
+parse_pgm_inst_t cmd_state_debug = {
+ .f = cmd_state_debug_parsed, /* function to call */
+ .data = NULL, /* 2nd arg of func */
+ .help_str = help_state_debug,
+ .tokens = { /* token list, NULL terminated */
+ (prog_void *)&cmd_state_debug_arg0,
+ (prog_void *)&cmd_state_debug_on,