test: 🐛 取消原子读取操作

This commit is contained in:
yuanQie 2025-05-26 22:14:57 +08:00
parent 4fc398e038
commit 3c76a6bbcb

View File

@ -189,6 +189,7 @@ void *handleUdpTransmission(void *arg)
printf("[slot]:%u \n", slot_ind_flag); printf("[slot]:%u \n", slot_ind_flag);
if (1 == slot_ind_flag) if (1 == slot_ind_flag)
{ {
printf("[test 01]\n");
slot_ind_flag = 0; slot_ind_flag = 0;
/************************************************************************************** */ /************************************************************************************** */
// wr 16016*64(byte) [8008] 2字节复制一次while循环会写入 1/20 的数据触发条件为slot_ind_flag // wr 16016*64(byte) [8008] 2字节复制一次while循环会写入 1/20 的数据触发条件为slot_ind_flag
@ -202,15 +203,18 @@ void *handleUdpTransmission(void *arg)
size_t elements_needed = 8008 - elements_to_copy; 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); memcpy((char*)map_base_tx_case52 + wr_cunt * 16016 + elements_to_copy * 2, &txt_buffer[0], elements_needed * 2);
} }
printf("[test 02]\n");
// 更新数组索引和块索引 // 更新数组索引和块索引
data_index = (data_index + 8008) % 65535; data_index = (data_index + 8008) % 65535;
wr_cunt = (wr_cunt + 1) % 20; wr_cunt = (wr_cunt + 1) % 20;
/************************************************************************************** */ /************************************************************************************** */
// 更新生产者计数 // 更新生产者计数
uint8_t w_idx = __atomic_load_n( // uint8_t w_idx = __atomic_load_n(
(volatile uint8_t *)(map_base_rxf_case52 + 0), // (volatile uint8_t *)(map_base_rxf_case52 + 0),
__ATOMIC_ACQUIRE // __ATOMIC_ACQUIRE
); // );
printf("[test 03]\n");
uint8_t w_idx = *((volatile uint8_t *)map_base_rxf_case52);
/************************************************************************************** */ /************************************************************************************** */
// 尝试读取 // 尝试读取
uint8_t block_n = 0; uint8_t block_n = 0;