cmdline: new rc_proto commands
[protos/xbee-avr.git] / rc_proto.c
index cc6cce4..8c91665 100644 (file)
@@ -59,7 +59,7 @@
 /* time before switching into bypass mode when no servo command received */
 #define AUTO_BYPASS_TIME_MS 500
 
-/* rc_proto statistics */
+/* rc_proto statistics, accessed with sched_prio=XBEE_PRIO */
 struct rc_proto_stats_data {
        uint32_t hello_rx;
        uint32_t hello_tx;
@@ -776,6 +776,15 @@ void rc_proto_dump_stats(void)
        printf_P(PSTR("  stats_tx: %"PRIu32"\r\n"), peer_stats.stats_tx);
 }
 
+void rc_proto_reset_stats(void)
+{
+       uint8_t prio;
+
+       prio = callout_mgr_set_prio(&xbeeboard.intr_cm, XBEE_PRIO);
+       memset(&stats, 0, sizeof(stats));
+       callout_mgr_restore_prio(&xbeeboard.intr_cm, prio);
+}
+
 void rc_proto_dump_servos(void)
 {
        uint8_t i;