]> rtime.felk.cvut.cz Git - fpga/lx-cpu1/lx-rocon.git/commitdiff
RoCoN: new mode for testlxpwrrx to capture position, PWM and current for controller...
authorPavel Pisa <ppisa@pikron.com>
Sat, 20 Jun 2015 19:28:04 +0000 (21:28 +0200)
committerPavel Pisa <ppisa@pikron.com>
Sat, 20 Jun 2015 19:28:04 +0000 (21:28 +0200)
Signed-off-by: Pavel Pisa <ppisa@pikron.com>
sw/app/rocon/appl_pxmc.c

index 5d19fb70caf12f56efe000e350d0d2617f657f9d..947d321982f17df2519a63a76c8bbad1eb8bee07 100644 (file)
@@ -1384,6 +1384,30 @@ IRQ_HANDLER_FNC(pxmc_rocon_rx_done_isr)
           *(pbuf++) = *(ptumbl++);
 
         pxmc_rocon_rx_data_hist_buff = pbuf;
+      } else if (!((pxmc_rocon_rx_data_hist_mode & 0xf8) ^ 0x10)) {
+        uint32_t *pbuf = (uint32_t *)pxmc_rocon_rx_data_hist_buff;
+        volatile pxmcc_data_t *mcc_data = pxmc_rocon_mcc_data();
+        volatile pxmcc_curadc_data_t *curadc;
+        pxmc_rocon_state_t *mcsrc = NULL;
+        int chan = pxmc_rocon_rx_data_hist_mode & 7;
+        if (chan < pxmc_main_list.pxml_cnt)
+          mcsrc = pxmc_state2rocon_state(pxmc_main_list.pxml_arr[chan]);
+        if (mcsrc) {
+          *(pbuf++) = pxmc_rocon_vin_act;
+          *(pbuf++) = fpga_irc[mcsrc->base.pxms_inp_info]->count;
+          *(pbuf++) = mcsrc->base.pxms_ene;
+          chan = mcsrc->base.pxms_out_info;
+          curadc = mcc_data->curadc + chan;
+          *(pbuf++) = *pxmc_rocon_pwm_chan2reg(chan++);
+          *(pbuf++) = (curadc++)->cur_val;
+          *(pbuf++) = *pxmc_rocon_pwm_chan2reg(chan++);
+          *(pbuf++) = (curadc++)->cur_val;
+          *(pbuf++) = *pxmc_rocon_pwm_chan2reg(chan++);
+          *(pbuf++) = (curadc++)->cur_val;
+          *(pbuf++) = *pxmc_rocon_pwm_chan2reg(chan++);
+          *(pbuf++) = (curadc++)->cur_val;
+          pxmc_rocon_rx_data_hist_buff = pbuf;
+        }
       }
     }