#include "ao.h"
-__xdata struct ao_task ao_gps_task;
-
#define AO_GPS_LEADER 6
static const uint8_t ao_gps_header[] = "GPGGA,";
ao_gps_error = 1;
if (!ao_gps_error) {
ao_mutex_get(&ao_gps_mutex);
- memcpy(&ao_gps_data, &ao_gps_next, sizeof (ao_gps_data));
+ memcpy(&ao_gps_data, &ao_gps_next, sizeof (struct ao_gps_data));
ao_mutex_put(&ao_gps_mutex);
ao_wakeup(&ao_gps_data);
}
}
}
+__xdata struct ao_task ao_gps_task;
+
+static void
+gps_dump(void) __reentrant
+{
+ ao_mutex_get(&ao_gps_mutex);
+ ao_gps_print(&ao_gps_data);
+ ao_mutex_put(&ao_gps_mutex);
+}
+
+__code struct ao_cmds ao_gps_cmds[] = {
+ { 'g', gps_dump, "g Display current GPS values" },
+ { 0, gps_dump, NULL },
+};
+
void
ao_gps_init(void)
{
ao_add_task(&ao_gps_task, ao_gps, "gps");
+ ao_cmd_register(&ao_gps_cmds[0]);
}