修复界面无聚焦导致的按键无效问题

This commit is contained in:
2025-04-14 13:21:51 +08:00
parent fd1a5f56a9
commit f70040e5f3
24 changed files with 28481 additions and 28408 deletions

View File

@ -1065,11 +1065,11 @@ static void uart_rx_demo_thread(void *param)
//打印 //打印
if(len!=0){ if(len!=0){
printf("uart2>>>>>>"); // printf("uart2>>>>>>");
for(uint8_t i=0;i<len;i++){ // for(uint8_t i=0;i<len;i++){
printf("%c",uartrx[i]); // printf("%c",uartrx[i]);
} // }
printf("\r\n"); // printf("\r\n");
if((0x01 == len) && (0x00 == uartrx[0])) continue; if((0x01 == len) && (0x00 == uartrx[0])) continue;
memcpy((cmdstr+cmdlen), uartrx, len); memcpy((cmdstr+cmdlen), uartrx, len);

View File

@ -155,6 +155,8 @@ static uint16_t calculate_cumulative_sum(uint8_t *buf)
} }
static void protocol_uart_rx_thread(void *param) static void protocol_uart_rx_thread(void *param)
{
while (1)
{ {
UartPort_t *uap = xUartOpen(UART_BT_PORT); UartPort_t *uap = xUartOpen(UART_BT_PORT);
uint8_t uartrx[BUFFER_LEN]; uint8_t uartrx[BUFFER_LEN];
@ -173,6 +175,8 @@ static void protocol_uart_rx_thread(void *param)
bt_communication_heartbeat = 10; bt_communication_heartbeat = 10;
TaskHandle_t tx_task_handle;
if (!uap) { if (!uap) {
printf("open uart %d fail.\n", UART_BT_PORT); printf("open uart %d fail.\n", UART_BT_PORT);
vTaskDelete(NULL); vTaskDelete(NULL);
@ -183,7 +187,7 @@ static void protocol_uart_rx_thread(void *param)
vUartInit(uap, 115200, 0); vUartInit(uap, 115200, 0);
if (xTaskCreate(protocol_uart_tx_thread, "uartsend", configMINIMAL_STACK_SIZE, uap, if (xTaskCreate(protocol_uart_tx_thread, "uartsend", configMINIMAL_STACK_SIZE, uap,
configMAX_PRIORITIES / 3, NULL) != pdPASS) { configMAX_PRIORITIES / 3, &tx_task_handle) != pdPASS) {
printf("create uart tx demo task fail.\n"); printf("create uart tx demo task fail.\n");
vTaskDelete(NULL); vTaskDelete(NULL);
return; return;
@ -195,7 +199,6 @@ static void protocol_uart_rx_thread(void *param)
for (;;) { for (;;) {
len = iUartRead(uap, uartrx, BUFFER_LEN, pdMS_TO_TICKS(10)); len = iUartRead(uap, uartrx, BUFFER_LEN, pdMS_TO_TICKS(10));
// if(len){ // if(len){
// printf("uart2>"); // printf("uart2>");
// for(i=0;i<len;i++){ // for(i=0;i<len;i++){
@ -203,7 +206,6 @@ static void protocol_uart_rx_thread(void *param)
// } // }
// printf("\r\n"); // printf("\r\n");
// } // }
if(Get_sys_power_on_self_test() != 150 ){ if(Get_sys_power_on_self_test() != 150 ){
for(i=0;i<len;i++){ for(i=0;i<len;i++){
switch (upgrade_state) { switch (upgrade_state) {
@ -320,6 +322,7 @@ static void protocol_uart_rx_thread(void *param)
} }
}else{ }else{
uart_state = 3; uart_state = 3;
bt_communication_heartbeat = 3;
if(equipment_data){ if(equipment_data){
device_data_analysis(tlv_data_value); device_data_analysis(tlv_data_value);
equipment_data = 0; equipment_data = 0;
@ -405,9 +408,6 @@ static void protocol_uart_rx_thread(void *param)
} }
#endif #endif
} }
#if 1 #if 1
@ -501,15 +501,25 @@ static void protocol_uart_rx_thread(void *param)
//收不到蓝牙心跳信息 复位串口 //收不到蓝牙心跳信息 复位串口
if(uart_flag==1) { if(uart_flag==1) {
break;
}
}
uart_flag = 2; uart_flag = 2;
printf("reset uart.\r\n"); printf("reset uart.\r\n");
UART3_Modification_Type();
//关闭发送任务
vTaskDelete(tx_task_handle);
//关闭Uart
vUartClose(uap); vUartClose(uap);
uap = xUartOpen(UART_BT_PORT); //配置为GPIO
UART3_Modification_Type();
//延时100
vTaskDelay(pdMS_TO_TICKS(100));
//配置为Uart
UART3_Type_regression(); UART3_Type_regression();
vUartInit(uap,115200,0); //重置心跳检测
bt_communication_heartbeat = 10; bt_communication_heartbeat = 5;
}
} }
} }

View File

@ -194,10 +194,6 @@
<language name="en_US">Quickly arrange</language> <language name="en_US">Quickly arrange</language>
<language name="zh_CN">快排功能</language> <language name="zh_CN">快排功能</language>
</string> </string>
<string name="仪表蓝牙已关闭,不可连接">
<language name="zh_CN">仪表蓝牙已关闭,不可连接</language>
<language name="en_US">Instrument Bluetooth turned off, unable to connect</language>
</string>
<string name="热点: "> <string name="热点: ">
<language name="zh_CN">热点: </language> <language name="zh_CN">热点: </language>
<language name="en_US">Hotspot:</language> <language name="en_US">Hotspot:</language>
@ -230,17 +226,9 @@
<language name="en_US">4.After successful connection, allow Carplay to connect and start using the Carplay function.</language> <language name="en_US">4.After successful connection, allow Carplay to connect and start using the Carplay function.</language>
<language name="zh_CN">4.连接成功后允许Carplay连接就可以开始使用CarPlay功能了。</language> <language name="zh_CN">4.连接成功后允许Carplay连接就可以开始使用CarPlay功能了。</language>
</string> </string>
<string name="热点名称: "> <string name="仪表蓝牙已关闭">
<language name="en_US">Hotspot Name:</language> <language name="zh_CN">仪表蓝牙已关闭</language>
<language name="zh_CN">热点名称: </language> <language name="en_US">Instrument Bluetooth turned off</language>
</string>
<string name="快排功能">
<language name="en_US">Quickly arrange</language>
<language name="zh_CN">快排功能</language>
</string>
<string name="仪表蓝牙已关闭,不可连接">
<language name="zh_CN">仪表蓝牙已关闭,不可连接</language>
<language name="en_US">Instrument Bluetooth turned off, unable to connect</language>
</string> </string>
<string name="1.解锁您的智能手机,找到并进入“设置”菜单,确保蓝牙功能已开启。"> <string name="1.解锁您的智能手机,找到并进入“设置”菜单,确保蓝牙功能已开启。">
<language name="en_US">1. Unlock your smartphone, find and enter the "Settings" menu, and make sure the Bluetooth function is turned on.</language> <language name="en_US">1. Unlock your smartphone, find and enter the "Settings" menu, and make sure the Bluetooth function is turned on.</language>

View File

@ -29,7 +29,7 @@
<label name="uuid" h="37" style:normal:text_align_h="left" style:normal:font_size="30" style:normal:text_color="#FFFFFF" line_wrap="true" word_wrap="true" x="239" y="210" w="510"/> <label name="uuid" h="37" style:normal:text_align_h="left" style:normal:font_size="30" style:normal:text_color="#FFFFFF" line_wrap="true" word_wrap="true" x="239" y="210" w="510"/>
</view> </view>
<label name="uuid_text" h="52" style:normal:text_align_h="left" style:normal:font_size="30" style:normal:text_color="#FFFFFF" word_wrap="true" line_wrap="true" style:normal:font_name="default" x="68" y="328" w="345"/> <label name="uuid_text" h="52" style:normal:text_align_h="left" style:normal:font_size="30" style:normal:text_color="#FFFFFF" word_wrap="true" line_wrap="true" style:normal:font_name="default" x="68" y="328" w="345"/>
<label name="bt_hint" h="68" style:normal:text_align_h="left" style:normal:font_size="28" style:normal:text_color="#FF0000" word_wrap="true" line_wrap="true" style:normal:font_name="default" x="423" y="312" w="345" tr_text="仪表蓝牙已关闭,不可连接"/> <label name="bt_hint" h="52" style:normal:text_align_h="left" style:normal:font_size="28" style:normal:text_color="#FF0000" word_wrap="true" line_wrap="true" style:normal:font_name="default" x="423" y="328" w="367" tr_text="仪表蓝牙已关闭"/>
</view> </view>
</view> </view>
<view name="view2" h="100" style:normal:border="none" style:normal:border_width="2" style:normal:border_color="#FFFFFF" opacity="255" style:normal:bg_color="#000000" style:normal:bg_image="" x="0" y="380" w="800" enable="true" visible="true"> <view name="view2" h="100" style:normal:border="none" style:normal:border_width="2" style:normal:border_color="#FFFFFF" opacity="255" style:normal:bg_color="#000000" style:normal:bg_image="" x="0" y="380" w="800" enable="true" visible="true">

File diff suppressed because one or more lines are too long

View File

@ -15,8 +15,11 @@
#define MOTO_ICMX_GB518_A272U 3 #define MOTO_ICMX_GB518_A272U 3
#define MOTO_ICMX_GB518_A272W 4 #define MOTO_ICMX_GB518_A272W 4
#define MOTO_ICMX_GB518_A272T 5
#define MOTO_ICMX_GB518_A272R 6
#define MOTO_WARE_HOSE MOTO_ICMX_GB518_A272W
#define MOTO_WARE_HOSE MOTO_ICMX_GB518_A272O
#if (MOTO_WARE_HOSE == MOTO_ICMX_GB518_A270T) #if (MOTO_WARE_HOSE == MOTO_ICMX_GB518_A270T)
@ -34,7 +37,7 @@
#elif (MOTO_WARE_HOSE == MOTO_ICMX_GB518_A272O) #elif (MOTO_WARE_HOSE == MOTO_ICMX_GB518_A272O)
#define SOFT_WARE_HOST 0 #define SOFT_WARE_HOST 0
#define SOFT_WARE_ORDER 2 #define SOFT_WARE_ORDER 4
#define TP_VERSION OVERSEAS_VERSION_2 #define TP_VERSION OVERSEAS_VERSION_2
@ -54,7 +57,7 @@
#elif (MOTO_WARE_HOSE == MOTO_ICMX_GB518_A272U) #elif (MOTO_WARE_HOSE == MOTO_ICMX_GB518_A272U)
#define SOFT_WARE_HOST 0 #define SOFT_WARE_HOST 0
#define SOFT_WARE_ORDER 1 #define SOFT_WARE_ORDER 2
#define TP_VERSION OVERSEAS_VERSION_2 #define TP_VERSION OVERSEAS_VERSION_2
@ -72,7 +75,7 @@
#elif (MOTO_WARE_HOSE == MOTO_ICMX_GB518_A272W) #elif (MOTO_WARE_HOSE == MOTO_ICMX_GB518_A272W)
#define SOFT_WARE_HOST 0 #define SOFT_WARE_HOST 0
#define SOFT_WARE_ORDER 1 #define SOFT_WARE_ORDER 2
#define TP_VERSION OVERSEAS_VERSION_2 #define TP_VERSION OVERSEAS_VERSION_2
@ -88,6 +91,47 @@
#define UI_TEMP_CLOSE 1 #define UI_TEMP_CLOSE 1
#define UI_ENGINE_CLOSE 1 #define UI_ENGINE_CLOSE 1
#elif (MOTO_WARE_HOSE == MOTO_ICMX_GB518_A272T)
#define SOFT_WARE_HOST 0
#define SOFT_WARE_ORDER 2
#define TP_VERSION OVERSEAS_VERSION_2
#define HARD_WARE "MXC-A272T V4.5"
#define MCU_INFO_LABEL "A272T"
//胎压功能宏
#define UI_VIEW_TIRE_PRESSURE 0
#define UI_TEMP_CLOSE 1
// #define UI_ABS_CLOSE 1
// #define UI_TCS_CLOSE 1
#define UI_FAN_CLOSE 1
// #define UI_FAN_CLOSE 1
#elif (MOTO_WARE_HOSE == MOTO_ICMX_GB518_A272R)
#define SOFT_WARE_HOST 0
#define SOFT_WARE_ORDER 2
#define TP_VERSION OVERSEAS_VERSION_2
#define HARD_WARE "MXC-A272R V4.5"
#define MCU_INFO_LABEL "A272R"
//胎压功能宏
#define UI_VIEW_TIRE_PRESSURE 0
// #define UI_TEMP_CLOSE 1
// #define UI_ABS_CLOSE 1
// #define UI_TCS_CLOSE 1
// #define UI_FAN_CLOSE 1
// #define UI_FAN_CLOSE 1
#else #else
#define SOFT_WARE_HOST 0 #define SOFT_WARE_HOST 0
@ -158,7 +202,7 @@
#define LOW_BRIGHTNESS_MODE 20 #define LOW_BRIGHTNESS_MODE 20
// 打印 // 打印
#define DEBUG 1 // #define DEBUG 1
#ifdef DEBUG #ifdef DEBUG
#define DEBUG_PRINT(fmt, ...) printf(fmt, ##__VA_ARGS__) #define DEBUG_PRINT(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else #else

View File

@ -22,16 +22,11 @@ extern void defect_code_win_init(widget_t* win);
void return_theme(void){ void return_theme(void){
widget_t* win = window_manager(); widget_t* win = window_manager();
widget_t* child = window_manager_get_top_main_window(win); widget_t* child = window_manager_get_top_window(win);
widget_t* widget = NULL; widget_t* widget = NULL;
if(child == NULL) if(child == NULL)
return; return;
if((strcmp(child->name,"ui_demo1")==0))
return;
if((strcmp(child->name,"new")==0)){
return;
}
DEBUG_PRINT("now them ==>> %d ,them_state ==>> %d\r\n",Get_sys_theme(),Get_sys_theme_state()); DEBUG_PRINT("now them ==>> %d ,them_state ==>> %d\r\n",Get_sys_theme(),Get_sys_theme_state());
@ -39,16 +34,16 @@ void return_theme(void){
navigator_close("set_list"); navigator_close("set_list");
}else if(strcmp(child->name,"set_time")==0){ }else if(strcmp(child->name,"set_time")==0){
navigator_close("set_time"); navigator_close("set_time");
navigator_close("setting_list"); navigator_close("set_list");
}else if(strcmp(child->name,"set_theme_bg")==0){ }else if(strcmp(child->name,"set_theme_bg")==0){
navigator_close("set_theme_bg"); navigator_close("set_theme_bg");
navigator_close("setting_list"); navigator_close("set_list");
}else if(strcmp(child->name,"set_tire_pressure")==0){ }else if(strcmp(child->name,"set_tire_pressure")==0){
navigator_close("set_tire_pressure"); navigator_close("set_tire_pressure");
navigator_close("setting_list"); navigator_close("set_list");
}else if(strcmp(child->name,"set_theme")==0){ }else if(strcmp(child->name,"set_theme")==0){
navigator_close("set_theme"); navigator_close("set_theme");
navigator_close("setting_list"); navigator_close("set_list");
}else if(strcmp(child->name,"new")==0){ }else if(strcmp(child->name,"new")==0){
navigator_close("new"); navigator_close("new");
} }
@ -59,7 +54,7 @@ void return_theme(void){
void Return_demo_win(void){//按键返回函数如果停止按键超过15s也会进入该函数 若界面不在demo界面则回到demo界面 void Return_demo_win(void){//按键返回函数如果停止按键超过15s也会进入该函数 若界面不在demo界面则回到demo界面
widget_t* win = window_manager(); widget_t* win = window_manager();
widget_t* child = window_manager_get_top_main_window(win); widget_t* child = window_manager_get_top_window(win);
if(child != NULL &&strcmp(child->name,"ui_demo1")!=0 && strcmp(child->name,"new")!=0) { if(child != NULL &&strcmp(child->name,"ui_demo1")!=0 && strcmp(child->name,"new")!=0) {
return_theme(); return_theme();
@ -222,16 +217,16 @@ ret_t long_key_event_handling(uint8_t key){
if(!tire_pressure_loading) if(!tire_pressure_loading)
tire_pressure_loading = 2; tire_pressure_loading = 2;
}else{ }else{
Set_sys_demo_position(4); Set_sys_return_demo(3);
} }
}else{ }else{
Set_sys_demo_position(4); Set_sys_return_demo(3);
} }
}else{ }else{
Set_sys_demo_position(4); Set_sys_return_demo(3);
} }
}else{ //返回到dmo界面 }else{ //返回到dmo界面
Set_sys_demo_position(4); Set_sys_return_demo(3);
} }
return RET_OK; return RET_OK;

View File

@ -444,6 +444,9 @@ static void ui_refresh_icons(widget_t *win)
static widget_t *warn_fan_icon = NULL; static widget_t *warn_fan_icon = NULL;
static widget_t *colon = NULL; static widget_t *colon = NULL;
static widget_t *right = NULL;
static widget_t *left = NULL;
// static widget_t *warn_tire_icon = NULL; // static widget_t *warn_tire_icon = NULL;
@ -459,6 +462,9 @@ static void ui_refresh_icons(widget_t *win)
colon = widget_lookup(win, "colon", TRUE); colon = widget_lookup(win, "colon", TRUE);
// warn_tire_icon = widget_lookup(win, "warn_tire_icon", TRUE); // warn_tire_icon = widget_lookup(win, "warn_tire_icon", TRUE);
//转向灯组
left = widget_lookup(win, "left", TRUE);//转向
right = widget_lookup(win, "right", TRUE);//转向
} }
@ -478,6 +484,25 @@ static void ui_refresh_icons(widget_t *win)
Universal_widget_display(warn_fan_icon, Get_sys_warning_fan()); Universal_widget_display(warn_fan_icon, Get_sys_warning_fan());
#endif #endif
switch(Get_sys_veer()){
case 1:
widget_set_visible(left,TRUE);
widget_set_visible(right,FALSE);
break;
case 2:
widget_set_visible(left,FALSE);
widget_set_visible(right,TRUE);
break;
case 3:
widget_set_visible(left,TRUE);
widget_set_visible(right,TRUE);
break;
default:
widget_set_visible(left,FALSE);
widget_set_visible(right,FALSE);
break;
}
widget_set_visible(colon,refresh500ms_flag); widget_set_visible(colon,refresh500ms_flag);
} }
@ -646,10 +671,12 @@ static void ui_refresh(widget_t *win)
ui_refresh_theme(win); ui_refresh_theme(win);
// 转速 // 转速
ui_refresh_rmp(win, Get_sys_veer_velocity()); ui_refresh_rmp(win, Get_sys_veer_velocity());
// 挡位 // 图标刷新
ui_refresh_gear(win, Get_sys_grade()); ui_refresh_icons(win);
// 速度 // 速度
ui_refresh_speed(win, Get_sys_velocity()); ui_refresh_speed(win, Get_sys_velocity());
// 挡位
ui_refresh_gear(win, Get_sys_grade());
// 油量 // 油量
ui_refresh_fuel(win, Get_sys_gas()); // 得到的是百分比 ui_refresh_fuel(win, Get_sys_gas()); // 得到的是百分比
#if !UI_TEMP_CLOSE #if !UI_TEMP_CLOSE
@ -662,8 +689,6 @@ static void ui_refresh(widget_t *win)
ui_refresh_call(win, Get_sys_call_state()); // 通话信息 ui_refresh_call(win, Get_sys_call_state()); // 通话信息
// 里程信息 // 里程信息
ui_refresh_mileage(win, Get_sys_total_mileage(), Get_sys_trip_mileage(), 0); ui_refresh_mileage(win, Get_sys_total_mileage(), Get_sys_trip_mileage(), 0);
// 图标刷新
ui_refresh_icons(win);
// 胎压 // 胎压
#if UI_VIEW_TIRE_PRESSURE #if UI_VIEW_TIRE_PRESSURE

View File

@ -300,10 +300,10 @@ static ret_t on_timer(const idle_info_t* idle){
if(child != NULL && strcmp(child->name,"set_list")==0){ if(child != NULL && strcmp(child->name,"set_list")==0){
list_win_init(child); list_win_init(child);
}else if(child != NULL && strcmp(child->name,"ui_demo1")==0){ // }else if(child != NULL && strcmp(child->name,"ui_demo1")==0){
// new_refreshes(child); // new_refreshes(child);
//灯光刷新 // //灯光刷新
light_refresh(child); // light_refresh(child);
// //通话界面刷新 // //通话界面刷新
// call_refresh(child); // call_refresh(child);
} }
@ -493,7 +493,7 @@ void* test_timer_queue(void *args){
#ifdef AMT630HV100 #ifdef AMT630HV100
}else if(Get_sys_power_on_self_test()==DEMO_UI_SELF_CHECKING){ }else if(Get_sys_power_on_self_test()==DEMO_UI_SELF_CHECKING){
if(xTaskGetTickCount() - idletick > configTICK_RATE_HZ * 3.5){ if(xTaskGetTickCount() - idletick > configTICK_RATE_HZ * 3){
#ifdef AMT630HV100 #ifdef AMT630HV100
vTaskDelay(100); vTaskDelay(100);
#else #else

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -137,7 +137,7 @@
<RecentlyUsedMenus>1</RecentlyUsedMenus> <RecentlyUsedMenus>1</RecentlyUsedMenus>
<MenuShadows>1</MenuShadows> <MenuShadows>1</MenuShadows>
<ShowAllMenusAfterDelay>1</ShowAllMenusAfterDelay> <ShowAllMenusAfterDelay>1</ShowAllMenusAfterDelay>
<CommandsUsage>4C0900008B0001DC00000300000002860000010000005786000001000000268400000300000019800000010000005984000002000000138600001301000021DE0000010000000880000001000000298100000C00000040E10000010000002CE10000020000007884000003000000048100000500000000DA00000100000015810000030000005684000001000000268100000100000010860000F403000045810000010000003184000001000000AF0600000400000016B0000001000000239200000100000007E100000200000029E1000001000000018100000E000000878000000A000000D884000002000000009000000500000002B0000001000000ED800000010000005F8600000700000020810000010000000F8100000200000004E1000002000000A680000001000000EA800000010000001D920000010000000D8000000200000026DE0000020000001D8100000900000001E10000070000003F810000010000000C8100009701000003DC000004000000D185000002000000048600000100000009810000010000001A8F00000100000003840000050000000186000001000000568600000F0000002881000001000000178100000500000000DC00000100000014810000060000007784000002000000558400001800000047810000010000003384000001000000808C0000010000002BE100000B0000000084000003000000118400000100000007B00000020000008386000002000000228100000100000028E100000100000085840000010000008980000001000000EF800000010000000E840000010000000C860000030000000081000001000000098600000100000028DE000003000000978000000100000025E100002C010000EC800000010000005E8600001600000003E100000A0000001A860000030000000E810000010000001F8100005901000000E1000002000000A5800000010000000B8100000E0000008E86000001000000E980000002000000D184000001000000038600000100000027840000010000002B8000000100000069860000010000005886000001000000058400000A00000014860000E400000002DC0000010000001681000001000000198F0000030000002A8F000002000000F4800000010000000086000001000000028400000300000027810000040000005586000002000000058100002000000011860000C7000000028100000100000074860000010000000BDE00000100000017B00000010000002AE1000001000000108400000D00000046810000E10000005184000001000000A486000001000000888000000100000044D50000010000004381000001000000608600004B000000EE8000000100000003B00000010000002181000006000000D684000001000000A186000002000000EB800000010000005D860000060000001E8100000300000035E100000600000002E100000300000008860000020000000D8100001000000024E1000001000000058600000100000007840000010000000A81000002000000E880000001000000</CommandsUsage> <CommandsUsage>850900008B0040E1000001000000298100000C000000088000000100000021DE00000100000013860000160100005984000002000000198000000100000026840000030000005786000001000000028600000100000001DC000003000000108600001104000026810000010000005684000001000000158100000300000000DA000001000000048100000500000078840000030000002CE1000002000000018100000E00000029E100000100000007E1000002000000239200000100000016B0000001000000AF060000040000003184000001000000458100000100000004E10000020000000F8100000200000020810000010000005F86000007000000ED8000000100000002B00000010000000090000005000000D884000002000000878000000A0000000C810000970100003F8100000100000001E10000070000001D8100000900000026DE0000020000000D800000020000001D92000001000000EA80000001000000A68000000100000009810000010000000486000001000000D18500000200000003DC00000400000000DC00000100000017810000050000002881000001000000568600000F000000018600000100000003840000050000001A8F00000100000007B0000002000000118400000100000000840000030000002BE100000B000000808C0000010000003384000001000000478100000100000055840000180000007784000002000000148100000600000000810000010000000C860000030000000E84000001000000EF800000010000008980000001000000858400000100000028E1000001000000228100000100000083860000020000001F810000630100000E810000010000001A8600000300000003E100000A0000005E86000016000000EC8000000100000025E100002C010000978000000100000028DE0000030000000986000001000000E9800000020000008E860000010000000B8100000E000000A58000000100000000E100000200000002DC00000100000014860000E9000000058400000A000000588600000100000069860000010000002B8000000100000027840000010000000386000001000000D18400000100000011860000CC00000005810000200000005586000002000000278100000400000002840000030000000086000001000000F4800000010000002A8F000002000000198F000003000000168100000100000046810000E6000000108400000D0000002AE100000100000017B00000010000000BDE00000100000074860000010000000281000001000000218100000600000003B0000001000000EE80000001000000608600004B000000438100000100000044D50000010000008880000001000000A486000001000000518400000100000024E10000010000000D81000010000000088600000200000002E100000300000035E10000060000001E810000030000005D86000006000000EB80000001000000A186000002000000D684000001000000E8800000010000000A8100000200000007840000010000000586000001000000</CommandsUsage>
</MFCToolBarParameters> </MFCToolBarParameters>
<CommandManager> <CommandManager>
<CommandsWithoutImages>4A0008800000098000000A8000000B8000000C800000158000000A810000FFFFFFFF01E8000012810000D2840000D1850000D78600000C84000033840000788400001184000020DE000021DE000026DE000028DE000023DE000022DE000024DE000027DE000025DE000020920000289200002992000037920000389200003492000033920000259200001E92000000DC000001DC000002DC000003DC0000748600007784000007840000808C000044D50000838600005886000004DC000001B0000002B0000003B0000004B0000005B0000006B0000007B0000008B0000009B000000AB000000BB000000CB000000DB000000EB0000000B00000248100002AE10000008200001C8200000182000067860000008800000188000002880000038800000488000005880000</CommandsWithoutImages> <CommandsWithoutImages>4A0008800000098000000A8000000B8000000C800000158000000A810000FFFFFFFF01E8000012810000D2840000D1850000D78600000C84000033840000788400001184000020DE000021DE000026DE000028DE000023DE000022DE000024DE000027DE000025DE000020920000289200002992000037920000389200003492000033920000259200001E92000000DC000001DC000002DC000003DC0000748600007784000007840000808C000044D50000838600005886000004DC000001B0000002B0000003B0000004B0000005B0000006B0000007B0000008B0000009B000000AB000000BB000000CB000000DB000000EB0000000B00000248100002AE10000008200001C8200000182000067860000008800000188000002880000038800000488000005880000</CommandsWithoutImages>

View File

@ -19,7 +19,7 @@
<LeaveTargetRunning>_ 0</LeaveTargetRunning> <LeaveTargetRunning>_ 0</LeaveTargetRunning>
</JLinkDriver> </JLinkDriver>
<DebugChecksum> <DebugChecksum>
<Checksum>278919780</Checksum> <Checksum>2449417590</Checksum>
</DebugChecksum> </DebugChecksum>
<Exceptions> <Exceptions>
<StopOnUncaught>_ 0</StopOnUncaught> <StopOnUncaught>_ 0</StopOnUncaught>

File diff suppressed because one or more lines are too long

View File

@ -1065,11 +1065,11 @@ static void uart_rx_demo_thread(void *param)
//打印 //打印
if(len!=0){ if(len!=0){
printf("uart2>>>>>>"); // printf("uart2>>>>>>");
for(uint8_t i=0;i<len;i++){ // for(uint8_t i=0;i<len;i++){
printf("%c",uartrx[i]); // printf("%c",uartrx[i]);
} // }
printf("\r\n"); // printf("\r\n");
if((0x01 == len) && (0x00 == uartrx[0])) continue; if((0x01 == len) && (0x00 == uartrx[0])) continue;
memcpy((cmdstr+cmdlen), uartrx, len); memcpy((cmdstr+cmdlen), uartrx, len);

View File

@ -148,6 +148,8 @@ static uint16_t calculate_cumulative_sum(uint8_t *buf)
} }
static void protocol_uart_rx_thread(void *param) static void protocol_uart_rx_thread(void *param)
{
while (1)
{ {
UartPort_t *uap = xUartOpen(UART_BT_PORT); UartPort_t *uap = xUartOpen(UART_BT_PORT);
uint8_t uartrx[BUFFER_LEN]; uint8_t uartrx[BUFFER_LEN];
@ -166,6 +168,8 @@ static void protocol_uart_rx_thread(void *param)
bt_communication_heartbeat = 10; bt_communication_heartbeat = 10;
TaskHandle_t tx_task_handle;
if (!uap) { if (!uap) {
printf("open uart %d fail.\n", UART_BT_PORT); printf("open uart %d fail.\n", UART_BT_PORT);
vTaskDelete(NULL); vTaskDelete(NULL);
@ -176,7 +180,7 @@ static void protocol_uart_rx_thread(void *param)
vUartInit(uap, 115200, 0); vUartInit(uap, 115200, 0);
if (xTaskCreate(protocol_uart_tx_thread, "uartsend", configMINIMAL_STACK_SIZE, uap, if (xTaskCreate(protocol_uart_tx_thread, "uartsend", configMINIMAL_STACK_SIZE, uap,
configMAX_PRIORITIES / 3, NULL) != pdPASS) { configMAX_PRIORITIES / 3, &tx_task_handle) != pdPASS) {
printf("create uart tx demo task fail.\n"); printf("create uart tx demo task fail.\n");
vTaskDelete(NULL); vTaskDelete(NULL);
return; return;
@ -188,7 +192,6 @@ static void protocol_uart_rx_thread(void *param)
for (;;) { for (;;) {
len = iUartRead(uap, uartrx, BUFFER_LEN, pdMS_TO_TICKS(10)); len = iUartRead(uap, uartrx, BUFFER_LEN, pdMS_TO_TICKS(10));
// if(len){ // if(len){
// printf("uart2>"); // printf("uart2>");
// for(i=0;i<len;i++){ // for(i=0;i<len;i++){
@ -196,7 +199,6 @@ static void protocol_uart_rx_thread(void *param)
// } // }
// printf("\r\n"); // printf("\r\n");
// } // }
if(Get_sys_power_on_self_test() != 150 ){ if(Get_sys_power_on_self_test() != 150 ){
for(i=0;i<len;i++){ for(i=0;i<len;i++){
switch (upgrade_state) { switch (upgrade_state) {
@ -399,8 +401,6 @@ static void protocol_uart_rx_thread(void *param)
#endif #endif
} }
#if 1 #if 1
@ -494,17 +494,26 @@ static void protocol_uart_rx_thread(void *param)
//收不到蓝牙心跳信息 复位串口 //收不到蓝牙心跳信息 复位串口
if(uart_flag==1) { if(uart_flag==1) {
uart_flag = 2; break;
printf("reset uart.\r\n");
UART3_Modification_Type();
vUartClose(uap);
uap = xUartOpen(UART_BT_PORT);
UART3_Type_regression();
vUartInit(uap,115200,0);
bt_communication_heartbeat = 10;
} }
} }
uart_flag = 2;
printf("reset uart.\r\n");
//关闭发送任务
vTaskDelete(tx_task_handle);
//关闭Uart
vUartClose(uap);
//配置为GPIO
UART3_Modification_Type();
//延时100
vTaskDelay(pdMS_TO_TICKS(100));
//配置为Uart
UART3_Type_regression();
//重置心跳检测
bt_communication_heartbeat = 5;
}
} }
int uart_communicates_with_bt(void) int uart_communicates_with_bt(void)

View File

@ -17,6 +17,8 @@
#define MOTO_ICMX_GB518_A270S_KP 4 #define MOTO_ICMX_GB518_A270S_KP 4
#define MOTO_ICMX_GB518_A272M 5 #define MOTO_ICMX_GB518_A272M 5
#define MOTO_ICMX_GB518_A272S 6
#define MOTO_WARE_HOSE MOTO_ICMX_GB518_A270S #define MOTO_WARE_HOSE MOTO_ICMX_GB518_A270S
#if (MOTO_WARE_HOSE == MOTO_ICMX_GB518_A270M) #if (MOTO_WARE_HOSE == MOTO_ICMX_GB518_A270M)