summaryrefslogtreecommitdiff
path: root/src/core/ao.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/ao.h')
-rw-r--r--src/core/ao.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/ao.h b/src/core/ao.h
index 06daf48f..eb2d47cf 100644
--- a/src/core/ao.h
+++ b/src/core/ao.h
@@ -487,6 +487,12 @@ struct ao_telemetry_tiny_recv {
uint8_t status;
};
+/* Unfortunately, we've exposed the CC1111 rssi units as the 'usual' method
+ * for reporting RSSI. So, now we use these values everywhere
+ */
+#define AO_RSSI_FROM_RADIO(radio) ((int16_t) ((int8_t) (radio) >> 1) - 74)
+#define AO_RADIO_FROM_RSSI(rssi) (((int8_t) (rssi) + 74) << 1)
+
/*
* ao_radio_recv tacks on rssi and status bytes
*/