diff options
author | jaseg <git@jaseg.net> | 2019-01-12 22:38:23 +0900 |
---|---|---|
committer | jaseg <git@jaseg.net> | 2019-01-12 22:38:23 +0900 |
commit | 2d392fe60a9cc6c9541ae5db9b7857b7c0cdae06 (patch) | |
tree | 08c3cc55ac3938086a2845fa8a8a7e3a03814ba0 /fw/adc.c | |
parent | 43f64f0e1fad6e3586cdd5b6f0243f03db9adc23 (diff) | |
download | 8seg-2d392fe60a9cc6c9541ae5db9b7857b7c0cdae06.tar.gz 8seg-2d392fe60a9cc6c9541ae5db9b7857b7c0cdae06.tar.bz2 8seg-2d392fe60a9cc6c9541ae5db9b7857b7c0cdae06.zip |
bulk cmd test works
Diffstat (limited to 'fw/adc.c')
-rw-r--r-- | fw/adc.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -96,12 +96,10 @@ void adc_configure_monitor_mode(struct command_if_def *cmd_if, int ivl_us) { st.det_st.base_interval_cycles = 10; st.det_st.sync = 0; - st.det_st.rx_st.rxpos = -1; - st.det_st.rx_st.address = 5; /* FIXME debug code */ st.det_st.last_bit = 0; st.det_st.committed_len_ctr = st.det_st.len_ctr = 0; - st.det_st.rx_st.cmd_if = cmd_if; xfr_8b10b_reset((struct state_8b10b_dec *)&st.det_st.rx8b10b); + reset_receiver((struct proto_rx_st *)&st.det_st.rx_st, cmd_if); adc_dma_init(NCH, true); @@ -219,7 +217,7 @@ void bit_detector(struct bit_detector_st *st, int a) { } else if (st->len_ctr >= st->committed_len_ctr) { st->committed_len_ctr += st->base_interval_cycles; - receive_bit(&st->rx_st, st->last_bit); + receive_bit(st, st->last_bit); } } @@ -251,7 +249,7 @@ void DMA1_Channel1_IRQHandler(void) { const long vmeas_r_total = VMEAS_R_HIGH + VMEAS_R_LOW; //int a = adc_data.adc_vmeas_a_mv = (st.adc_aggregate[VMEAS_A]*(vmeas_r_total * vcc / VMEAS_R_LOW)) >> 12; int a = adc_data.adc_vmeas_a_mv = (adc_buf[VMEAS_A]*13300) >> 12; - bit_detector(&st.det_st, a); + bit_detector((struct bit_detector_st *)&st.det_st, a); /* ISR timing measurement for debugging */ int end = SysTick->VAL; |