refactor: comment out unused fields in CaptureSample_t and streamline capture logging
This commit is contained in:
@@ -45,11 +45,11 @@ typedef enum
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t timestamp;
|
||||
// uint32_t timestamp;
|
||||
uint16_t iac;
|
||||
uint16_t vac;
|
||||
uint16_t vbus;
|
||||
uint16_t vcr;
|
||||
// uint16_t vac;
|
||||
// uint16_t vbus;
|
||||
// uint16_t vcr;
|
||||
} CaptureSample_t;
|
||||
|
||||
//=============================================================================
|
||||
@@ -222,11 +222,11 @@ static inline void Capture_Sample_ISR(void)
|
||||
if (idx >= CAPTURE_BUF_SIZE)
|
||||
return;
|
||||
|
||||
capture_buf[idx].timestamp = sys_get_tick();
|
||||
// capture_buf[idx].timestamp = sys_get_tick();
|
||||
capture_buf[idx].iac = iac;
|
||||
capture_buf[idx].vac = vac;
|
||||
capture_buf[idx].vbus = vbus;
|
||||
capture_buf[idx].vcr = vcr;
|
||||
// capture_buf[idx].vac = vac;
|
||||
// capture_buf[idx].vbus = vbus;
|
||||
// capture_buf[idx].vcr = vcr;
|
||||
|
||||
idx++;
|
||||
capture_idx = idx;
|
||||
@@ -245,12 +245,14 @@ static void Capture_Dump_IfReady(void)
|
||||
|
||||
for (uint16_t i = 0; i < CAPTURE_BUF_SIZE; i++)
|
||||
{
|
||||
msg("%d,%d,%d,%d,%d\r\n",
|
||||
capture_buf[i].timestamp,
|
||||
capture_buf[i].iac,
|
||||
capture_buf[i].vac,
|
||||
capture_buf[i].vbus,
|
||||
capture_buf[i].vcr);
|
||||
msg("%d\r\n", capture_buf[i].iac);
|
||||
|
||||
// msg("%d,%d,%d,%d,%d\r\n",
|
||||
// capture_buf[i].timestamp,
|
||||
// capture_buf[i].iac,
|
||||
// capture_buf[i].vac,
|
||||
// capture_buf[i].vbus,
|
||||
// capture_buf[i].vcr);
|
||||
}
|
||||
|
||||
capture_ready = 0;
|
||||
@@ -619,7 +621,12 @@ __INTERRUPT void isr_adc_handle(void)
|
||||
|
||||
if (cur_loop_fun_en) Cur_Loop_PFC_2P2Z(); // current loop
|
||||
|
||||
Capture_Sample_ISR();
|
||||
static uint8_t cnt = 0;
|
||||
if (cnt++ >= 10)
|
||||
{
|
||||
Capture_Sample_ISR();
|
||||
cnt = 0;
|
||||
}
|
||||
|
||||
// GPIO_ResetBits(GPIOA, GPIO_Pin_06);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user