[Upload Code]:add Pad Read Code
This commit is contained in:
parent
3bdf15cce7
commit
aa18aaaa87
@ -46,7 +46,7 @@ extern "C" {
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
/* USER CODE BEGIN EC */
|
||||
|
||||
#define SENSOR_RX_BUFFER_SIZE 1024
|
||||
#define SENSOR_RX_BUFFER_SIZE 2048
|
||||
#define OUTPUT_RX_BUFFER_SIZE 512
|
||||
/* USER CODE END EC */
|
||||
|
||||
|
@ -106,6 +106,7 @@ static void create_binary_mask(const uint16_t *sensor_data)
|
||||
/*
|
||||
* Simple connected component labeling using flood fill
|
||||
*/
|
||||
int stack_ptr = 0;
|
||||
int stack[TOTAL_SENSORS] = {0};
|
||||
static uint8_t flood_fill(uint8_t *mask, int start_idx, uint8_t label)
|
||||
{
|
||||
@ -113,7 +114,7 @@ static uint8_t flood_fill(uint8_t *mask, int start_idx, uint8_t label)
|
||||
return 0;
|
||||
|
||||
// Simple stack using array (limit recursion depth)
|
||||
int stack_ptr = 0;
|
||||
stack_ptr = 0;
|
||||
uint8_t area = 0;
|
||||
|
||||
stack[stack_ptr++] = start_idx;
|
||||
@ -154,6 +155,9 @@ static uint8_t flood_fill(uint8_t *mask, int start_idx, uint8_t label)
|
||||
stack[stack_ptr++] = n_idx;
|
||||
}
|
||||
}
|
||||
if (stack_ptr >= 259)
|
||||
// stack_ptr = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
return area;
|
||||
|
@ -203,7 +203,8 @@ void aiRun(const void *in_data, void *out_data)
|
||||
}
|
||||
}
|
||||
|
||||
// 测试代码
|
||||
// AI代码
|
||||
AnalysisResult_t analysis_result;
|
||||
int AiModel(uint8_t *input)
|
||||
{
|
||||
//
|
||||
@ -212,20 +213,6 @@ int AiModel(uint8_t *input)
|
||||
rt_tick_t End_Tick = 0;
|
||||
int predicted_class = 0;
|
||||
float max_confidence = 0.0f;
|
||||
AnalysisResult_t analysis_result;
|
||||
|
||||
rt_kprintf("\nStart Test Code\n");
|
||||
// 转Float
|
||||
PictureCharArrayToFloat(input, inputBuf, AI_MODEL_IN_1_SIZE);
|
||||
// 数据前置处理
|
||||
preprocess_data((const float *)inputBuf, aiInData, AI_MODEL_IN_1_SIZE);
|
||||
|
||||
// 运算AI模型
|
||||
Start_Tick = rt_tick_get();
|
||||
aiRun(aiInData, aiOutData);
|
||||
End_Tick = rt_tick_get();
|
||||
rt_kprintf("AI model UseTime : %ld ms\n", End_Tick - Start_Tick);
|
||||
|
||||
// 计算腰部位置
|
||||
if (analyze_body_posture((const uint16_t *)input, &analysis_result))
|
||||
{
|
||||
@ -240,6 +227,18 @@ int AiModel(uint8_t *input)
|
||||
else
|
||||
rt_kprintf("Analysis failed\n");
|
||||
|
||||
rt_kprintf("\nStart Test Code\n");
|
||||
// 转Float
|
||||
PictureCharArrayToFloat(input, inputBuf, AI_MODEL_IN_1_SIZE);
|
||||
// 数据前置处理
|
||||
preprocess_data((const float *)inputBuf, aiInData, AI_MODEL_IN_1_SIZE);
|
||||
|
||||
// 运算AI模型
|
||||
Start_Tick = rt_tick_get();
|
||||
aiRun(aiInData, aiOutData);
|
||||
End_Tick = rt_tick_get();
|
||||
rt_kprintf("AI model UseTime : %ld ms\n", End_Tick - Start_Tick);
|
||||
|
||||
for (int i = 0; i < AI_MODEL_OUT_1_SIZE; i++)
|
||||
{
|
||||
if (aiOutData[i] > max_confidence)
|
||||
@ -276,7 +275,7 @@ static void ai_thread_entry(void *parameter)
|
||||
rt_uint32_t e;
|
||||
while (1)
|
||||
{
|
||||
#if 1
|
||||
#if 0
|
||||
if (model.status == AI_STATUS_IDLE)
|
||||
AiModel((uint8_t *)test);
|
||||
#else
|
||||
|
@ -7,6 +7,9 @@
|
||||
#include "myEdge_ai_app.h"
|
||||
#include "myOutput_deal.h"
|
||||
#include "protocol_parser.h"
|
||||
#include "mcu_body_analyzer.h"
|
||||
|
||||
uint8_t UploadSrcMattressData[260] = {0};
|
||||
|
||||
static ProtocolFrame resp;
|
||||
static ProtocolFrame rx_frame;
|
||||
@ -18,6 +21,7 @@ static rt_uint16_t seq_num = 0xffff;
|
||||
static rt_uint16_t Upload_Time = 100;
|
||||
static CommState comm_state = STATE_WAIT_RECV;
|
||||
|
||||
extern AnalysisResult_t analysis_result;
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// 状态包上传
|
||||
@ -27,7 +31,10 @@ static void upload_StatusPackage(void)
|
||||
rt_uint8_t output_frame_ctrl = FRAME_CTL_TYPE_DATA;
|
||||
// TODO:数据填充
|
||||
//---------------------------------------------
|
||||
|
||||
myPayload[2] = analysis_result.bodies[0].posture + 1;
|
||||
myPayload[3] = (uint8_t)((analysis_result.bodies[0].waist_center.x_mm) / 10);
|
||||
myPayload[4] = (uint8_t)((analysis_result.bodies[0].waist_center.y_mm) / 10);
|
||||
rt_memcpy(myPayload + 8, UploadSrcMattressData, sizeof(UploadSrcMattressData));
|
||||
//---------------------------------------------
|
||||
output_frame_ctrl |= FRAME_CTL_CRC_EN;
|
||||
Protocol_BuildFrame(&resp,
|
||||
@ -38,7 +45,8 @@ static void upload_StatusPackage(void)
|
||||
true);
|
||||
Protocol_SerializeFrame(send_buf, sizeof(send_buf), &resp);
|
||||
HAL_UART_Transmit(&huart3, send_buf, 8 + sizeof(myPayload) + 2, 100);
|
||||
hex_dump_simple(send_buf, 8 + sizeof(myPayload) + 2);
|
||||
// hex_dump_simple(send_buf, 8 + sizeof(myPayload) + 2);
|
||||
;
|
||||
}
|
||||
|
||||
// 状态机处理
|
||||
@ -50,10 +58,12 @@ static void comm_state_machine_run(void)
|
||||
case STATE_WAIT_RECV:
|
||||
{
|
||||
// rt_kprintf("Wait Message...\n");
|
||||
if (rt_event_recv(&output_uart_rx_event, 0x01, RT_EVENT_FLAG_OR | RT_EVENT_FLAG_CLEAR, 100, &e) == RT_EOK)
|
||||
if (rt_event_recv(&output_uart_rx_event, 0x01, RT_EVENT_FLAG_OR | RT_EVENT_FLAG_CLEAR, 500, &e) == RT_EOK)
|
||||
{
|
||||
rt_kprintf("Deal Data Ready...\n");
|
||||
hex_dump_simple(output_uart_rx_buffer, output_uart_rx_len);
|
||||
// rt_kprintf("[O]: Deal Data Ready...\n");
|
||||
// rt_kprintf("///////////////////////////////////////\n");
|
||||
// hex_dump_simple(output_uart_rx_buffer, output_uart_rx_len);
|
||||
// rt_kprintf("///////////////////////////////////////\n");
|
||||
// 拷贝 成功
|
||||
rt_memcpy(recv_buf, output_uart_rx_buffer, output_uart_rx_len);
|
||||
recv_len = output_uart_rx_len;
|
||||
@ -82,7 +92,7 @@ static void comm_state_machine_run(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
rt_kprintf("Parse Data Fail...\n");
|
||||
// rt_kprintf("Parse Data Fail...\n");
|
||||
comm_state = STATE_BACK_WAIT;
|
||||
}
|
||||
break;
|
||||
@ -110,7 +120,7 @@ static void comm_state_machine_run(void)
|
||||
// 发送 数据
|
||||
Protocol_SerializeFrame(send_buf, sizeof(send_buf), &resp);
|
||||
HAL_UART_Transmit(&huart3, send_buf, 8 + sizeof(payload) + 2, 100);
|
||||
hex_dump_simple(send_buf, 8 + sizeof(payload) + 2);
|
||||
// hex_dump_simple(send_buf, 8 + sizeof(payload) + 2);
|
||||
}
|
||||
// 设置状态包上报间隔
|
||||
else if (mcmd == 0x02 && scmd == 0x10)
|
||||
@ -136,7 +146,7 @@ static void comm_state_machine_run(void)
|
||||
// 发送 数据
|
||||
Protocol_SerializeFrame(send_buf, sizeof(send_buf), &resp);
|
||||
HAL_UART_Transmit(&huart3, send_buf, 8 + sizeof(payload) + 2, 100);
|
||||
hex_dump_simple(send_buf, 8 + sizeof(payload) + 2);
|
||||
// hex_dump_simple(send_buf, 8 + sizeof(payload) + 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2,16 +2,55 @@
|
||||
#include "usart.h"
|
||||
#include "gpio.h"
|
||||
#include "math.h"
|
||||
#include "rthw.h"
|
||||
#include "string.h"
|
||||
#include "rtthread.h"
|
||||
#include "mySensor_deal.h"
|
||||
#include "myEdge_ai_app.h"
|
||||
|
||||
|
||||
#define FRAME_LEN 1024
|
||||
#define FRAME_HEADER_LEN 4
|
||||
#define FRAME_LEN 260
|
||||
|
||||
uint8_t Origin_MattressData_Resize[FRAME_LEN];
|
||||
|
||||
extern DMA_HandleTypeDef hdma_usart2_rx;
|
||||
extern uint8_t Origin_MattressData[AI_MODEL_IN_1_SIZE];
|
||||
|
||||
const uint8_t FRAME_HEADER[FRAME_HEADER_LEN] = {0xAA, 0x55, 0x03, 0x99};
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
void myUSART2_DMA_Disable(void)
|
||||
{
|
||||
// 停止 DMA 传输
|
||||
HAL_UART_DMAPause(&huart2);
|
||||
// 关闭 RX DMA 中断
|
||||
// __HAL_DMA_DISABLE_IT(&hdma_usart2_rx, DMA_IT_TC);
|
||||
// __HAL_DMA_DISABLE_IT(&hdma_usart2_rx, DMA_IT_TE);
|
||||
// HAL_NVIC_DisableIRQ(DMA1_Stream5_IRQn);
|
||||
}
|
||||
void myUSART2_DMA_Enable(void)
|
||||
{
|
||||
HAL_UART_DMAResume(&huart2);
|
||||
// 重新启用 NVIC 中断
|
||||
// HAL_NVIC_EnableIRQ(DMA1_Stream5_IRQn); // RX
|
||||
// 启动接收 DMA(假设循环接收)
|
||||
// HAL_UART_Receive_DMA(&huart2, sensor_uart_rx_buffer, SENSOR_RX_BUFFER_SIZE);
|
||||
}
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
// 生成1024点的正弦波模拟数据
|
||||
void generate_sine_wave(uint8_t data[1024])
|
||||
{
|
||||
const double PI = 3.14159265358979323846;
|
||||
for (int i = 0; i < 1024; i++)
|
||||
{
|
||||
// 生成0-255范围内的正弦波数据
|
||||
double value = sin(2.0 * PI * i / 1024.0); // -1.0到1.0
|
||||
data[i] = (uint8_t)((value + 1.0) * 127.5); // 映射到0-255
|
||||
}
|
||||
}
|
||||
|
||||
void uart_data_process(uint8_t *data, uint16_t len)
|
||||
{
|
||||
rt_kprintf("UART RX [%d bytes]: ", len);
|
||||
@ -22,7 +61,38 @@ void uart_data_process(uint8_t *data, uint16_t len)
|
||||
rt_kprintf("\n");
|
||||
}
|
||||
|
||||
const uint8_t FRAME_HEADER[FRAME_HEADER_LEN] = {0xAA, 0x55, 0x03, 0x99};
|
||||
/**
|
||||
* 从32x32的一维数组中提取26x10的子数组
|
||||
* @param src 源数组,32x32=1024个元素
|
||||
* @param dst 目标数组,26x10=260个元素
|
||||
* @param start_row 起始行索引(0-6),确保有足够的行空间
|
||||
* @param start_col 起始列索引(0-22),确保有足够的列空间
|
||||
* @return 成功返回0,参数错误返回-1
|
||||
*/
|
||||
int extract_subarray(const uint8_t src[1024], uint8_t dst[260],
|
||||
uint8_t start_row, uint8_t start_col)
|
||||
{
|
||||
// 检查参数有效性
|
||||
if (start_row > 6 || start_col > 22)
|
||||
{
|
||||
// 如果参数超出范围,使用默认值
|
||||
start_row = 0;
|
||||
start_col = 0;
|
||||
}
|
||||
|
||||
// 逐行提取子数组
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
int src_row = start_row + i;
|
||||
int src_offset = src_row * 32 + start_col;
|
||||
int dst_offset = i * 26;
|
||||
|
||||
// 复制一行数据(26个元素)
|
||||
rt_memcpy(&dst[dst_offset], &src[src_offset], 26);
|
||||
}
|
||||
|
||||
return 0; // 成功
|
||||
}
|
||||
|
||||
/**
|
||||
* 从 DMA 接收缓存中查找并提取一帧数据
|
||||
@ -30,16 +100,16 @@ const uint8_t FRAME_HEADER[FRAME_HEADER_LEN] = {0xAA, 0x55, 0x03, 0x99};
|
||||
* @param dma_len 实际接收长度
|
||||
* @return RT_TRUE表示找到并提取成功,RT_FALSE表示未找到
|
||||
*/
|
||||
static uint8_t local_buf[1024];
|
||||
static uint8_t local_buf[2048] = {0};
|
||||
extern uint8_t UploadSrcMattressData[260];
|
||||
rt_bool_t extract_mattress_frame(const uint8_t *dma_buf, size_t dma_len)
|
||||
{
|
||||
// 本地缓存用于查找帧头,不修改原始DMA缓存
|
||||
if (dma_len > sizeof(local_buf))
|
||||
{
|
||||
rt_kprintf("Data too large to cache\n");
|
||||
rt_kprintf("Data error to cache\n");
|
||||
return RT_FALSE;
|
||||
}
|
||||
rt_memcpy(local_buf, dma_buf, dma_len);
|
||||
// 查找帧头
|
||||
for (size_t i = 0; i + FRAME_HEADER_LEN <= dma_len; i++)
|
||||
{
|
||||
@ -47,7 +117,15 @@ rt_bool_t extract_mattress_frame(const uint8_t *dma_buf, size_t dma_len)
|
||||
{
|
||||
if (i + FRAME_LEN <= dma_len)
|
||||
{
|
||||
rt_memcpy(Origin_MattressData, &local_buf[i + FRAME_HEADER_LEN], FRAME_LEN);
|
||||
// 数据集采集到数据在最末端有标识符 (应急)
|
||||
if (i == 1024 && sensor_uart_rx_len == 1028)
|
||||
{
|
||||
rt_memcpy(Origin_MattressData_Resize, &local_buf[0], FRAME_LEN);
|
||||
}
|
||||
else
|
||||
rt_memcpy(Origin_MattressData_Resize, &local_buf[i + FRAME_HEADER_LEN], FRAME_LEN);
|
||||
extract_subarray(Origin_MattressData_Resize, Origin_MattressData, 0, 0);
|
||||
rt_memcpy(UploadSrcMattressData, Origin_MattressData, sizeof(Origin_MattressData));
|
||||
return RT_TRUE;
|
||||
}
|
||||
else
|
||||
@ -75,19 +153,26 @@ rt_uint16_t start_pos = 0;
|
||||
static void sensor_thread_entry(void *parameter)
|
||||
{
|
||||
rt_uint32_t e;
|
||||
rt_memset(local_buf, 0, sizeof(local_buf));
|
||||
while (1)
|
||||
{
|
||||
// rt_kprintf("Wait Message...\n");
|
||||
if (rt_event_recv(&uart_rx_event, 0x01, RT_EVENT_FLAG_OR | RT_EVENT_FLAG_CLEAR, RT_WAITING_FOREVER, &e) == RT_EOK)
|
||||
{
|
||||
if (sensor_uart_rx_len < 260)
|
||||
if (sensor_uart_rx_len < 1024)
|
||||
continue;
|
||||
rt_enter_critical();
|
||||
myUSART2_DMA_Disable();
|
||||
rt_memcpy(local_buf, sensor_uart_rx_buffer, sizeof(local_buf));
|
||||
myUSART2_DMA_Enable();
|
||||
// 临界区代码(可重入)
|
||||
rt_exit_critical();
|
||||
rt_memset(Origin_MattressData, 0, sizeof(Origin_MattressData));
|
||||
// 处理函数 拷贝 成功
|
||||
if (extract_mattress_frame(sensor_uart_rx_buffer, sizeof(sensor_uart_rx_buffer)))
|
||||
{
|
||||
model.status = AI_STATUS_IDLE;
|
||||
rt_kprintf("Deal Data Ready...\n");
|
||||
// rt_kprintf("Deal Data Ready...\n");
|
||||
rt_event_send(&data_ready_event, 0x01);
|
||||
}
|
||||
rt_memset(sensor_uart_rx_buffer, 0, sizeof(sensor_uart_rx_buffer));
|
||||
|
@ -70,8 +70,8 @@ extern UART_HandleTypeDef huart3;
|
||||
/* Cortex-M4 Processor Interruption and Exception Handlers */
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* @brief This function handles Non maskable interrupt.
|
||||
*/
|
||||
* @brief This function handles Non maskable interrupt.
|
||||
*/
|
||||
void NMI_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN NonMaskableInt_IRQn 0 */
|
||||
@ -86,8 +86,8 @@ void NMI_Handler(void)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Memory management fault.
|
||||
*/
|
||||
* @brief This function handles Memory management fault.
|
||||
*/
|
||||
void MemManage_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN MemoryManagement_IRQn 0 */
|
||||
@ -101,8 +101,8 @@ void MemManage_Handler(void)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Pre-fetch fault, memory access fault.
|
||||
*/
|
||||
* @brief This function handles Pre-fetch fault, memory access fault.
|
||||
*/
|
||||
void BusFault_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN BusFault_IRQn 0 */
|
||||
@ -116,8 +116,8 @@ void BusFault_Handler(void)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Undefined instruction or illegal state.
|
||||
*/
|
||||
* @brief This function handles Undefined instruction or illegal state.
|
||||
*/
|
||||
void UsageFault_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN UsageFault_IRQn 0 */
|
||||
@ -131,8 +131,8 @@ void UsageFault_Handler(void)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Debug monitor.
|
||||
*/
|
||||
* @brief This function handles Debug monitor.
|
||||
*/
|
||||
void DebugMon_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN DebugMonitor_IRQn 0 */
|
||||
@ -151,8 +151,8 @@ void DebugMon_Handler(void)
|
||||
/******************************************************************************/
|
||||
|
||||
/**
|
||||
* @brief This function handles DMA1 stream1 global interrupt.
|
||||
*/
|
||||
* @brief This function handles DMA1 stream1 global interrupt.
|
||||
*/
|
||||
void DMA1_Stream1_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN DMA1_Stream1_IRQn 0 */
|
||||
@ -165,8 +165,8 @@ void DMA1_Stream1_IRQHandler(void)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles DMA1 stream5 global interrupt.
|
||||
*/
|
||||
* @brief This function handles DMA1 stream5 global interrupt.
|
||||
*/
|
||||
void DMA1_Stream5_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN DMA1_Stream5_IRQn 0 */
|
||||
@ -179,8 +179,8 @@ void DMA1_Stream5_IRQHandler(void)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles CAN1 RX0 interrupts.
|
||||
*/
|
||||
* @brief This function handles CAN1 RX0 interrupts.
|
||||
*/
|
||||
void CAN1_RX0_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN CAN1_RX0_IRQn 0 */
|
||||
@ -193,8 +193,8 @@ void CAN1_RX0_IRQHandler(void)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles USART2 global interrupt.
|
||||
*/
|
||||
* @brief This function handles USART2 global interrupt.
|
||||
*/
|
||||
void USART2_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN USART2_IRQn 0 */
|
||||
@ -207,6 +207,7 @@ void USART2_IRQHandler(void)
|
||||
// 业务代码
|
||||
// HAL_UART_Transmit(&huart2, sensor_uart_rx_buffer, received_length, 100); // 发送接收到的数据 echo
|
||||
HAL_UART_Receive_DMA(&huart2, sensor_uart_rx_buffer, SENSOR_RX_BUFFER_SIZE); // 开启DMA接收
|
||||
// hex_dump_simple(sensor_uart_rx_buffer, received_length);
|
||||
sensor_uart_rx_len = received_length;
|
||||
// 发送事件通知处理线程
|
||||
rt_event_send(&uart_rx_event, 0x01);
|
||||
@ -219,19 +220,19 @@ void USART2_IRQHandler(void)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles USART3 global interrupt.
|
||||
*/
|
||||
* @brief This function handles USART3 global interrupt.
|
||||
*/
|
||||
void USART3_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN USART3_IRQn 0 */
|
||||
if (__HAL_UART_GET_FLAG(&huart3, UART_FLAG_IDLE) != RESET)
|
||||
{ // 判断是否产生IDLE中断
|
||||
{ // 判断是否产生IDLE中断
|
||||
__HAL_UART_CLEAR_IDLEFLAG(&huart3); // 清除IDLE中断标志位
|
||||
HAL_UART_DMAStop(&huart3); // 停止DMA接收
|
||||
uint16_t received_length = SENSOR_RX_BUFFER_SIZE - __HAL_DMA_GET_COUNTER(huart3.hdmarx); // 计算实际接收到的数据长度
|
||||
uint16_t received_length = OUTPUT_RX_BUFFER_SIZE - __HAL_DMA_GET_COUNTER(huart3.hdmarx); // 计算实际接收到的数据长度
|
||||
// 业务代码
|
||||
// HAL_UART_Transmit(&huart3, output_uart_rx_buffer, received_length, 100); // 发送接收到的数据 echo
|
||||
HAL_UART_Receive_DMA(&huart3, output_uart_rx_buffer, SENSOR_RX_BUFFER_SIZE); // 开启DMA接收
|
||||
HAL_UART_Receive_DMA(&huart3, output_uart_rx_buffer, OUTPUT_RX_BUFFER_SIZE); // 开启DMA接收
|
||||
output_uart_rx_len = received_length;
|
||||
// 发送事件通知处理线程
|
||||
rt_event_send(&output_uart_rx_event, 0x01);
|
||||
|
File diff suppressed because one or more lines are too long
@ -140,7 +140,7 @@
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGUARM</Key>
|
||||
<Name>d</Name>
|
||||
<Name></Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
@ -180,6 +180,46 @@
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>resp</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>4</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>Origin_MattressData_Resize</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>5</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>sensor_uart_rx_buffer,0x10</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>6</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>UploadSrcMattressData</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>7</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>local_buf,0x10</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>8</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>sensor_uart_rx_len,0x0A</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>9</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>status</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>10</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>model</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>11</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>stack_ptr,0x0A</ItemText>
|
||||
</Ww>
|
||||
</WatchWindow1>
|
||||
<Tracepoint>
|
||||
<THDelay>0</THDelay>
|
||||
@ -223,12 +263,6 @@
|
||||
<pszMrulep></pszMrulep>
|
||||
<pSingCmdsp></pSingCmdsp>
|
||||
<pMultCmdsp></pMultCmdsp>
|
||||
<SystemViewers>
|
||||
<Entry>
|
||||
<Name>System Viewer\CAN1</Name>
|
||||
<WinId>35905</WinId>
|
||||
</Entry>
|
||||
</SystemViewers>
|
||||
<DebugDescription>
|
||||
<Enable>1</Enable>
|
||||
<EnableFlashSeq>1</EnableFlashSeq>
|
||||
|
@ -81,7 +81,7 @@
|
||||
</BeforeMake>
|
||||
<AfterMake>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>1</RunUserProg2>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
@ -312,7 +312,7 @@
|
||||
</ArmAdsMisc>
|
||||
<Cads>
|
||||
<interw>1</interw>
|
||||
<Optim>4</Optim>
|
||||
<Optim>2</Optim>
|
||||
<oTime>0</oTime>
|
||||
<SplitLS>0</SplitLS>
|
||||
<OneElfS>1</OneElfS>
|
||||
|
File diff suppressed because it is too large
Load Diff
4
CAN/XM-01/MDK-ARM/data.log
Normal file
4
CAN/XM-01/MDK-ARM/data.log
Normal file
File diff suppressed because one or more lines are too long
@ -68,7 +68,7 @@
|
||||
| 2025-06-03 | 完成算法计算腰部位置代码移植 | 后续还需要更改 |
|
||||
| | 增加串口3作为输出 用于CAN替换 | 增加处理线程 |
|
||||
| 2025-06-04 | 完成串口协议的对接,串口可输出 | |
|
||||
| | | |
|
||||
| | 调试1024点完成,CAN版本。 | 串口接收有点问题后面需要看 |
|
||||
|
||||
---
|
||||
|
||||
|
@ -2,8 +2,8 @@ FUNC void showdata(void){
|
||||
int idx;
|
||||
exec("log >> data.log");
|
||||
printf("-------------------------------------1024---------------------------------\n");
|
||||
for(idx=0;idx<1024;idx++){
|
||||
printf(" %x ",Origin_MattressData[idx]);
|
||||
for(idx=0;idx<2048;idx++){
|
||||
printf(" %x ",sensor_uart_rx_buffer[idx]);
|
||||
}
|
||||
printf("\n");
|
||||
printf("-------------------------------------2048---------------------------------\n");
|
||||
|
Loading…
Reference in New Issue
Block a user