diff options
author | jaseg <git@jaseg.net> | 2019-01-10 13:35:15 +0900 |
---|---|---|
committer | jaseg <git@jaseg.net> | 2019-01-10 13:35:15 +0900 |
commit | 0161d6665ce115bfb385e2dfd70c126528f9f985 (patch) | |
tree | 702c45540e1ca4122a68f4fb4460c7d24c2c5cd2 /driver_fw | |
parent | 5da6e46739689cab3827ca2c81e1651eeaf59d49 (diff) | |
download | 8seg-0161d6665ce115bfb385e2dfd70c126528f9f985.tar.gz 8seg-0161d6665ce115bfb385e2dfd70c126528f9f985.tar.bz2 8seg-0161d6665ce115bfb385e2dfd70c126528f9f985.zip |
Debug scope works nicely
Diffstat (limited to 'driver_fw')
-rw-r--r-- | driver_fw/main.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/driver_fw/main.c b/driver_fw/main.c index efea9c6..accb159 100644 --- a/driver_fw/main.c +++ b/driver_fw/main.c @@ -87,10 +87,11 @@ int main(void) { /* FIXME end test code */ while (42) { if (txstate.next_symbol == -NO_SYMBOL) { - if (txpos == -1) - txstate.next_symbol = xfr_8b10b_encode(&txstate.st, K28_1); - else - txstate.next_symbol = xfr_8b10b_encode(&txstate.st, txbuf[txpos]); + txstate.next_symbol = xfr_8b10b_encode(&txstate.st, K28_1); + //if (txpos == -1) + // txstate.next_symbol = xfr_8b10b_encode(&txstate.st, K28_1); + //else + // txstate.next_symbol = xfr_8b10b_encode(&txstate.st, txbuf[txpos]); txpos++; if (txpos == sizeof(txbuf)) @@ -100,6 +101,10 @@ int main(void) { } void TIM1_UP_IRQHandler() { + // FIXME debug code + static int debug_bit = 0; + debug_bit = !debug_bit; + TIM1->SR &= ~TIM_SR_UIF; int sym = txstate.current_symbol; int bit = sym&1; @@ -110,7 +115,7 @@ void TIM1_UP_IRQHandler() { } txstate.current_symbol = sym; - TIM1->CCR1 = bit ? 0xffff : 0x0000; + TIM1->CCR1 = debug_bit ? 0xffff : 0x0000; } void NMI_Handler(void) { |