A270S版本路测100km差1.2km-V0.10版本
This commit is contained in:
@ -155,16 +155,16 @@ uint8_t Get_sys_bt_on_off(void)
|
||||
}
|
||||
void Set_sys_bt_on_off(uint8_t value)
|
||||
{
|
||||
printf("Set_bt switch ===%d.\r\n",value);
|
||||
// printf("Set_bt switch ===%d.\r\n",value);
|
||||
if(value == NULL ){
|
||||
custom_data.user_data.bt_on_off = 0;
|
||||
custom_data.bt_connect_state = 0;
|
||||
custom_data.call.call_state = 0;
|
||||
SaveDataToFlash(custom_data.user_data);//保存数据
|
||||
printf("bw121 >>>>>>>>>>>>>>>0.\r\n");
|
||||
// printf("bw121 >>>>>>>>>>>>>>>0.\r\n");
|
||||
}else if(value != custom_data.user_data.bt_on_off){
|
||||
custom_data.user_data.bt_on_off = value;
|
||||
printf("bw121 >>>>>>>>>>>>>>>1.\r\n");
|
||||
// printf("bw121 >>>>>>>>>>>>>>>1.\r\n");
|
||||
SaveDataToFlash(custom_data.user_data);//保存数据
|
||||
}
|
||||
//gpio_direction_output(46,1);
|
||||
|
@ -12,9 +12,10 @@
|
||||
|
||||
#define MOTO_ICMX_GB518_A270T 1
|
||||
#define MOTO_ICMX_GB518_A272O 2
|
||||
#define MOTO_ICMX_GB518_A272U 3
|
||||
|
||||
|
||||
#define MOTO_WARE_HOSE MOTO_ICMX_GB518_A272O
|
||||
#define MOTO_WARE_HOSE MOTO_ICMX_GB518_A272U
|
||||
|
||||
#if (MOTO_WARE_HOSE == MOTO_ICMX_GB518_A270T)
|
||||
|
||||
@ -45,6 +46,23 @@
|
||||
// #define UI_TEMP_CLOSE 1
|
||||
// #define UI_FAN_CLOSE 1
|
||||
|
||||
#elif (MOTO_WARE_HOSE == MOTO_ICMX_GB518_A272U)
|
||||
|
||||
#define SOFT_WARE_HOST 0
|
||||
#define SOFT_WARE_ORDER 1
|
||||
|
||||
#define TP_VERSION OVERSEAS_VERSION_2
|
||||
|
||||
#define HARD_WARE "MXC-A272U V4.5"
|
||||
#define MCU_INFO_LABEL "A272U"
|
||||
|
||||
//胎压功能宏
|
||||
#define UI_VIEW_TIRE_PRESSURE 0
|
||||
|
||||
#define UI_TCS_CLOSE 1
|
||||
// #define UI_FAN_CLOSE 1
|
||||
#define ANIMO_CLOSE 1
|
||||
|
||||
#else
|
||||
#define SOFT_WARE_HOST 0
|
||||
#define SOFT_WARE_ORDER 1
|
||||
|
@ -83,17 +83,6 @@ extern uint8_t bt_communication_heartbeat;
|
||||
|
||||
extern uint8_t flash_bt_state;
|
||||
void A27_BT_init(void){
|
||||
#if 0
|
||||
//蓝牙初始化
|
||||
printf("enter A27_BT_init state = %d .\r\n",Get_sys_bt_on_off());
|
||||
|
||||
if(Get_sys_bt_on_off()==0){
|
||||
DEBUG_PRINT("BT_SWITCH close .\r\n");
|
||||
BT2_Switch(0);
|
||||
}else{
|
||||
DEBUG_PRINT("BT_SWITCH open .\r\n");
|
||||
}
|
||||
#else
|
||||
//蓝牙初始化
|
||||
printf("enter A27_BT_init state = %d ,flash_bt_state=%d.\r\n",Get_sys_bt_on_off(),flash_bt_state);
|
||||
|
||||
@ -119,7 +108,6 @@ void A27_BT_init(void){
|
||||
}else
|
||||
DEBUG_PRINT("BT_SWITCH open .\r\n");
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
uint8_t velocity_light_flag = 0;
|
||||
@ -180,20 +168,12 @@ extern uint8_t bt2_state_now_flag;
|
||||
uint8_t bw_121_time = 0;
|
||||
|
||||
void UI_init(void){
|
||||
#if 0
|
||||
Set_sys_power_on_self_test(DEMO_UI_SELF_FINISH);//自检完成
|
||||
|
||||
animo_time = 511;
|
||||
if(bt2_switch_time)
|
||||
bt2_switch_time = 0;
|
||||
#else
|
||||
printf("UI_init ...........................................\r\n");
|
||||
|
||||
Set_sys_power_on_self_test(DEMO_UI_SELF_FINISH);//自检完成
|
||||
animo_time = 511;
|
||||
if(bt2_switch_time)
|
||||
bt2_switch_time = 0;
|
||||
// Send_software_version();
|
||||
|
||||
#ifdef AMT630HV100
|
||||
|
||||
@ -236,8 +216,8 @@ void UI_init(void){
|
||||
carlink_ec_enable(0);
|
||||
|
||||
#elif (CARLINK_TP_EC)
|
||||
printf("only tp init cp.\r\n");
|
||||
Set_sys_tp_state(1);
|
||||
printf("only tp init EC.\r\n");
|
||||
Set_sys_tp_state(2);
|
||||
carlink_cp_enable(0);
|
||||
carlink_aa_enable(0);
|
||||
carlink_ec_enable(1);
|
||||
@ -247,21 +227,21 @@ void UI_init(void){
|
||||
#endif
|
||||
|
||||
// console_send_atcmd("AT+ADDR\r\n", strlen("AT+ADDR\r\n"));//开蓝牙
|
||||
#ifdef AMT630HV100
|
||||
vTaskDelay(10);
|
||||
#else
|
||||
sleep_ms(10);
|
||||
#endif
|
||||
#if (MOTO_WARE_HOSE == MOTO_ICMX_GB518_A270T)
|
||||
console_send_atcmd("AT+NAME=A27_MOTO_Phone,1\r\n", strlen("AT+NAME=A27_MOTO_Phone,1\r\n"));//修改蓝牙名
|
||||
#else
|
||||
console_send_atcmd("AT+NAME=A59_MOTO_Phone,1\r\n", strlen("AT+NAME=A59_MOTO_Phone,1\r\n"));//修改蓝牙名
|
||||
#endif
|
||||
#ifdef AMT630HV100
|
||||
vTaskDelay(10);
|
||||
#else
|
||||
sleep_ms(10);
|
||||
#endif
|
||||
// #ifdef AMT630HV100
|
||||
// vTaskDelay(10);
|
||||
// #else
|
||||
// sleep_ms(10);
|
||||
// #endif
|
||||
// #if (MOTO_WARE_HOSE == MOTO_ICMX_GB518_A270T)
|
||||
// console_send_atcmd("AT+NAME=A27_MOTO_Phone,1\r\n", strlen("AT+NAME=A27_MOTO_Phone,1\r\n"));//修改蓝牙名
|
||||
// #else
|
||||
// console_send_atcmd("AT+NAME=A59_MOTO_Phone,1\r\n", strlen("AT+NAME=A59_MOTO_Phone,1\r\n"));//修改蓝牙名
|
||||
// #endif
|
||||
// #ifdef AMT630HV100
|
||||
// vTaskDelay(10);
|
||||
// #else
|
||||
// sleep_ms(10);
|
||||
// #endif
|
||||
console_send_atcmd("AT+NAME\r\n", strlen("AT+NAME\r\n"));//查询蓝牙名
|
||||
|
||||
A27_BT_init();
|
||||
@ -294,7 +274,6 @@ void UI_init(void){
|
||||
//允许AP连接
|
||||
cp_wlan_start();
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
static ret_t on_timer(const idle_info_t* idle){
|
||||
@ -477,6 +456,18 @@ void* test_timer_queue(void *args){
|
||||
#ifndef AMT630HV100
|
||||
Set_sys_power_on_self_test(DEMO_UI_SELF_START);
|
||||
#endif
|
||||
#ifdef ANIMO_CLOSE
|
||||
if(animo_time>110){
|
||||
BrightnessPowerOnSetting();
|
||||
pwm_enable(2);
|
||||
pwm_enable(3);
|
||||
extern void anim_close_lcd_open(void);
|
||||
anim_close_lcd_open();
|
||||
}
|
||||
|
||||
if(animo_time>=130)
|
||||
Set_sys_power_on_self_test(DEMO_UI_SELF_START);
|
||||
#endif
|
||||
}else if(Get_sys_power_on_self_test()==DEMO_UI_SELF_START){
|
||||
|
||||
#ifdef AMT630HV100
|
||||
@ -492,7 +483,7 @@ void* test_timer_queue(void *args){
|
||||
Set_sys_power_on_self_test(DEMO_UI_SELF_CHECKING);//设置为自检中
|
||||
console_send_atcmd("AT+NAME=A27_MOTO_Phone,1\r\n", strlen("AT+NAME=A27_MOTO_Phone,1\r\n"));//修改蓝牙名
|
||||
#ifdef AMT630HV100
|
||||
vTaskDelay(500);
|
||||
vTaskDelay(1000);
|
||||
#else
|
||||
sleep_ms(200);
|
||||
#endif
|
||||
@ -502,7 +493,12 @@ void* test_timer_queue(void *args){
|
||||
|
||||
#ifdef AMT630HV100
|
||||
}else if(Get_sys_power_on_self_test()==DEMO_UI_SELF_CHECKING){
|
||||
if(xTaskGetTickCount() - idletick > configTICK_RATE_HZ * 3){
|
||||
if(xTaskGetTickCount() - idletick > configTICK_RATE_HZ * 3.5){
|
||||
#ifdef AMT630HV100
|
||||
vTaskDelay(100);
|
||||
#else
|
||||
sleep_ms(100);
|
||||
#endif
|
||||
UI_init();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user