From 07d5e70f84230f58dbef576b1668208d24da79cb Mon Sep 17 00:00:00 2001 From: aiden Date: Tue, 16 Jun 2026 11:55:12 +0800 Subject: [PATCH] refactor: comment out unused fields in CaptureSample_t and streamline capture logging --- .../PFC_LLC_2026-05-20_2P2Z_ok/src/main.c | 37 +++++++++++-------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/pec930_sdk-v1.0.1/Examples/template/PFC_LLC_2026-05-20_2P2Z_ok/src/main.c b/pec930_sdk-v1.0.1/Examples/template/PFC_LLC_2026-05-20_2P2Z_ok/src/main.c index 2ac755c..ae714f8 100644 --- a/pec930_sdk-v1.0.1/Examples/template/PFC_LLC_2026-05-20_2P2Z_ok/src/main.c +++ b/pec930_sdk-v1.0.1/Examples/template/PFC_LLC_2026-05-20_2P2Z_ok/src/main.c @@ -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);