#include "main.h"
#include "cmdline.h"
#include "eeprom_config.h"
+#include "gps_venus.h"
+#include "imu.h"
/* commands_gen.c */
extern const parse_inst_t PROGMEM cmd_reset;
},
};
+/* ************* */
+
+struct cmd_gps_show_result {
+ fixed_string_t cmd;
+ fixed_string_t action;
+};
+
+static void cmd_gps_show_parsed(void *parsed_result,
+ void *data)
+{
+ (void)parsed_result;
+ (void)data;
+
+ while (!cmdline_keypressed()) {
+ gps_log(1);
+ }
+}
+
+const char PROGMEM str_gps_show_gps[] = "gps";
+const parse_token_string_t PROGMEM cmd_gps_show_cmd =
+ TOKEN_STRING_INITIALIZER(struct cmd_gps_show_result, cmd,
+ str_gps_show_gps);
+const char PROGMEM str_gps_show_show[] = "show";
+const parse_token_string_t PROGMEM cmd_gps_show_action =
+ TOKEN_STRING_INITIALIZER(struct cmd_gps_show_result, action,
+ str_gps_show_show);
+
+const char PROGMEM help_gps_show[] = "show gps position";
+const parse_inst_t PROGMEM cmd_gps_show = {
+ .f = cmd_gps_show_parsed, /* function to call */
+ .data = NULL, /* 2nd arg of func */
+ .help_str = help_gps_show,
+ .tokens = { /* token show, NULL terminated */
+ (PGM_P)&cmd_gps_show_cmd,
+ (PGM_P)&cmd_gps_show_action,
+ NULL,
+ },
+};
+
+/* ************* */
+
+struct cmd_imu_show_result {
+ fixed_string_t cmd;
+ fixed_string_t action;
+};
+
+static void cmd_imu_show_parsed(void *parsed_result,
+ void *data)
+{
+ (void)parsed_result;
+ (void)data;
+
+ while (!cmdline_keypressed()) {
+ imu_log(1);
+ }
+}
+
+const char PROGMEM str_imu_show_imu[] = "imu";
+const parse_token_string_t PROGMEM cmd_imu_show_cmd =
+ TOKEN_STRING_INITIALIZER(struct cmd_imu_show_result, cmd,
+ str_imu_show_imu);
+const char PROGMEM str_imu_show_show[] = "show";
+const parse_token_string_t PROGMEM cmd_imu_show_action =
+ TOKEN_STRING_INITIALIZER(struct cmd_imu_show_result, action,
+ str_imu_show_show);
+
+const char PROGMEM help_imu_show[] = "show imu position";
+const parse_inst_t PROGMEM cmd_imu_show = {
+ .f = cmd_imu_show_parsed, /* function to call */
+ .data = NULL, /* 2nd arg of func */
+ .help_str = help_imu_show,
+ .tokens = { /* token show, NULL terminated */
+ (PGM_P)&cmd_imu_show_cmd,
+ (PGM_P)&cmd_imu_show_action,
+ NULL,
+ },
+};
+
/* ************* */
&cmd_eeprom_add,
&cmd_eeprom_add2,
&cmd_eeprom_list,
+ &cmd_gps_show,
+ &cmd_imu_show,
NULL,
};