void
ao_monitor_blink(void)
{
+#ifdef AO_MONITOR_BAD
+ uint8_t *recv;
+#endif
for (;;) {
ao_sleep(DATA_TO_XDATA(&ao_monitor_head));
- ao_led_for(AO_MONITOR_LED, AO_MS_TO_TICKS(100));
+#ifdef AO_MONITOR_BAD
+ recv = (uint8_t *) &ao_monitor_ring[ao_monitor_ring_prev(ao_monitor_head)];
+ if (ao_monitoring && !(recv[ao_monitoring + 1] & AO_RADIO_STATUS_CRC_OK))
+ ao_led_for(AO_MONITOR_BAD, AO_MS_TO_TICKS(100));
+ else
+#endif
+ ao_led_for(AO_MONITOR_LED, AO_MS_TO_TICKS(100));
}
}
#endif
{
#if LEGACY_MONITOR
__xdata char callsign[AO_MAX_CALLSIGN+1];
+#endif
+#if LEGACY_MONITOR || HAS_RSSI
int16_t rssi;
#endif
uint8_t ao_monitor_tail;
hex(sum);
putchar ('\n');
#if HAS_RSSI
- if (recv_raw.packet[ao_monitoring + 1] & PKT_APPEND_STATUS_1_CRC_OK) {
+ if (recv_raw.packet[ao_monitoring + 1] & AO_RADIO_STATUS_CRC_OK) {
rssi = AO_RSSI_FROM_RADIO(recv_raw.packet[ao_monitoring]);
ao_rssi_set(rssi);
}