From 406059f4a8699a49c31d77a3fe83b00c9dd150cb Mon Sep 17 00:00:00 2001 From: yuanQie Date: Mon, 26 May 2025 22:30:20 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=F0=9F=90=9B=20=E5=A2=9E=E5=87=8F?= =?UTF-8?q?=E6=89=93=E5=8D=B0=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/case52/src/testcase52.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/case52/src/testcase52.c b/test/case52/src/testcase52.c index 9d2b7f3..de1fd14 100755 --- a/test/case52/src/testcase52.c +++ b/test/case52/src/testcase52.c @@ -186,38 +186,43 @@ void *handleUdpTransmission(void *arg) printf("[while(1)]:/*************************************/\n"); while (1) { - printf("[slot]:%u \n", slot_ind_flag); + // printf("[slot]:%u \n", slot_ind_flag); if (1 == slot_ind_flag) { printf("[test 01]\n"); slot_ind_flag = 0; /************************************************************************************** */ // wr 16016*64(byte) [8008] 2字节复制,一次while循环会写入 1/20 的数据,触发条件为slot_ind_flag + printf("[test 02]\n"); size_t buffer_start = data_index;// 当前数据读取的起始索引 size_t elements_remaining = 65535 - buffer_start;// 从buffer_start到数组末尾的剩余元素数 size_t elements_to_copy = (elements_remaining >= 8008) ? 8008 : elements_remaining; // 剩余 + printf("[test 03]\n"); // 拷贝前半部分(可能跨数组末尾) + printf("[test 04]\n"); memcpy((char*)map_base_tx_case52 + wr_cunt * 16016, &txt_buffer[buffer_start], elements_to_copy * 2); + printf("[test 05]\n"); // 处理数组环绕 if (elements_to_copy < 8008) { size_t elements_needed = 8008 - elements_to_copy; memcpy((char*)map_base_tx_case52 + wr_cunt * 16016 + elements_to_copy * 2, &txt_buffer[0], elements_needed * 2); } - printf("[test 02]\n"); + printf("[test 06]\n"); // 更新数组索引和块索引 data_index = (data_index + 8008) % 65535; wr_cunt = (wr_cunt + 1) % 20; /************************************************************************************** */ // 更新生产者计数 + printf("[test 07]\n"); uint8_t w_idx = __atomic_load_n( (volatile uint8_t *)(map_base_rxf_case52 + 0), __ATOMIC_ACQUIRE ); - printf("[test 03]\n"); // uint8_t w_idx = *((volatile uint8_t *)map_base_rxf_case52); /************************************************************************************** */ // 尝试读取 uint8_t block_n = 0; + printf("[test 08]\n"); if (w_idx == r_idx){ printf("[while(1)]: w_idx = %hhu, r_idx = %hhu\n", w_idx, r_idx); printf("[while(1)]: 空\n");