altos: Add RSSI blinking to new-style telemetry code
authorKeith Packard <keithp@keithp.com>
Sun, 28 Aug 2011 22:38:12 +0000 (15:38 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 28 Aug 2011 22:38:12 +0000 (15:38 -0700)
Pull the RSSI data out locally and set the RSSI led blinking when
using the variable-length TELEM output mechanism.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/core/ao_monitor.c

index 6f2d9db..c167b86 100644 (file)
@@ -228,6 +228,10 @@ ao_monitor_put(void)
                                printf("%02x", byte);
                        }
                        printf("%02x\n", sum);
+                       if (recv_raw.packet[ao_monitoring + 1] & PKT_APPEND_STATUS_1_CRC_OK) {
+                               rssi = ((int16_t) recv_raw.packet[ao_monitoring] >> 1) - 74;
+                               ao_rssi_set(rssi);
+                       }
                        break;
                }
                ao_usb_flush();