From 0161d6665ce115bfb385e2dfd70c126528f9f985 Mon Sep 17 00:00:00 2001 From: jaseg Date: Thu, 10 Jan 2019 13:35:15 +0900 Subject: Debug scope works nicely --- driver_fw/main.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'driver_fw') 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) { -- cgit