summaryrefslogtreecommitdiff
path: root/src/ao_sample.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ao_sample.c')
-rw-r--r--src/ao_sample.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ao_sample.c b/src/ao_sample.c
index ac156646..88ba58c5 100644
--- a/src/ao_sample.c
+++ b/src/ao_sample.c
@@ -179,6 +179,8 @@ ao_sample(void)
* just dropped a bit of noise off the low end.
*/
ao_sample_accel = (uint16_t) ((((uint32_t) ao_sample_accel << 16) / (ao_accel_ref[ao_sample_adc] << 1))) >> 1;
+ if (ao_config.pad_orientation != AO_PAD_ORIENTATION_ANTENNA_UP)
+ ao_sample_accel = 0x7fff - ao_sample_accel;
ao_adc->accel = ao_sample_accel;
#endif
#endif