diff options
Diffstat (limited to 'center_fw/src')
-rw-r--r-- | center_fw/src/main.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/center_fw/src/main.c b/center_fw/src/main.c index 59bd7a1..a4f7d9e 100644 --- a/center_fw/src/main.c +++ b/center_fw/src/main.c @@ -195,7 +195,9 @@ size_t adc_dump_pos = 0; uint8_t bit_dump[4096]; size_t bit_dump_pos = 0; +bool armed = false; void gdb_dump(void) { + armed = false; } void ADC1_IRQHandler(void) { @@ -237,10 +239,15 @@ void ADC1_IRQHandler(void) { bit_dump_pos++; if (bit_dump_pos == COUNT_OF(bit_dump)) { bit_dump_pos = 0; - gdb_dump(); + armed = true; } int rc = xfr_8b10b_feed_bit((struct state_8b10b_dec *)&st_8b10b_dec, bit); + if (rc == 0xfb) { + if (armed) + gdb_dump(); + } + if (rc > -K_CODES_LAST) { sym_dump[sym_dump_pos++] = rc; if (sym_dump_pos == COUNT_OF(sym_dump)) { @@ -279,7 +286,7 @@ void ADC1_IRQHandler(void) { } } } - } else { + } else if (rc == -DECODING_ERROR) { errors.decoding_errors++; } } |