aboutsummaryrefslogtreecommitdiff
path: root/center_fw/src
diff options
context:
space:
mode:
Diffstat (limited to 'center_fw/src')
-rw-r--r--center_fw/src/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/center_fw/src/main.c b/center_fw/src/main.c
index c066297..8c91607 100644
--- a/center_fw/src/main.c
+++ b/center_fw/src/main.c
@@ -209,7 +209,7 @@ void ADC1_IRQHandler(void) {
/* Read sample and apply threshold */
int sample = ADC1->DR; /* resets the EOC interrupt flag */
- int bit = sample > THRESHOLD_ADC_COUNTS;
+ int bit = sample < THRESHOLD_ADC_COUNTS;
int bit_margin = ((int)sample) - THRESHOLD_ADC_COUNTS;
if (bit_margin < 0) {
bit_margin = -bit_margin;