summaryrefslogtreecommitdiff
path: root/src/kernel/ao_data.h
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2019-07-16 11:12:49 -0700
committerKeith Packard <keithp@keithp.com>2019-07-16 11:12:49 -0700
commit8b2e457db8c4536440ecd7dc35d06f827fc008dc (patch)
treeabe53e894c9aad315be0b9c45b5223156132b2a1 /src/kernel/ao_data.h
parentc37cd66b7c11f904b528c5ff7e80e18c5e0d26e5 (diff)
altos: Record all failed sensors and report status at power up
Use DATA bits to mark which sensors have failed, then report that in beeps at startup time to help diagnose hardware failures while still allowing the board to be used over USB. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/kernel/ao_data.h')
-rw-r--r--src/kernel/ao_data.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/kernel/ao_data.h b/src/kernel/ao_data.h
index 5a340c3f..4fc9db8f 100644
--- a/src/kernel/ao_data.h
+++ b/src/kernel/ao_data.h
@@ -143,6 +143,12 @@ extern volatile uint8_t ao_data_count;
#define AO_DATA_PRESENT(bit) (ao_data_present |= (bit))
/*
+ * Mark sensor failed, and unblock the sample collection code by
+ * marking the data as present
+ */
+#define AO_SENSOR_ERROR(bit) (ao_data_present |= (ao_sensor_errors |= (bit)))
+
+/*
* Wait until it is time to write a sensor sample; this is
* signaled by the timer tick
*/