快排仪表以及A270S版本生成
After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 2.8 KiB |
@ -171,6 +171,7 @@
|
||||
#include "default/inc/images/time_select.res"
|
||||
#include "default/inc/images/tire.res"
|
||||
#include "default/inc/images/wifi.res"
|
||||
#include "default/inc/images/_12_1x.res"
|
||||
#else
|
||||
#endif /*WITH_STB_IMAGE*/
|
||||
#ifdef WITH_VGCANVAS
|
||||
@ -359,6 +360,7 @@ ret_t assets_init_default(void) {
|
||||
assets_manager_add(am, image_time_select);
|
||||
assets_manager_add(am, image_tire);
|
||||
assets_manager_add(am, image_wifi);
|
||||
assets_manager_add(am, image__12_1x);
|
||||
#ifdef WITH_VGCANVAS
|
||||
#endif /*WITH_VGCANVAS*/
|
||||
#ifdef WITH_TRUETYPE_FONT
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 2.8 KiB |
@ -171,6 +171,7 @@
|
||||
#include "assets/default/inc/images/time_select.res"
|
||||
#include "assets/default/inc/images/tire.res"
|
||||
#include "assets/default/inc/images/wifi.res"
|
||||
#include "assets/default/inc/images/_12_1x.res"
|
||||
#else
|
||||
#endif /*WITH_STB_IMAGE*/
|
||||
#ifdef WITH_VGCANVAS
|
||||
@ -360,6 +361,7 @@ ret_t assets_init(void) {
|
||||
assets_manager_add(am, image_time_select);
|
||||
assets_manager_add(am, image_tire);
|
||||
assets_manager_add(am, image_wifi);
|
||||
assets_manager_add(am, image__12_1x);
|
||||
#ifdef WITH_VGCANVAS
|
||||
#endif /*WITH_VGCANVAS*/
|
||||
#ifdef WITH_TRUETYPE_FONT
|
||||
|
@ -83,4 +83,23 @@ uint8_t getBitValue(uint8_t count, int bitPosition) {
|
||||
}
|
||||
#endif
|
||||
|
||||
// 封装的函数,获取2个bit组合成的值
|
||||
uint8_t getBit2Value(uint8_t count, int bitPosition) {
|
||||
return (count >> bitPosition) & 0x3;
|
||||
}
|
||||
|
||||
// 封装的函数,获取3个bit组合成的值
|
||||
uint8_t getBit3Value(uint8_t count, int bitPosition) {
|
||||
return (count >> bitPosition) & 0x7;
|
||||
}
|
||||
|
||||
// 封装的函数,获取4个bit组合成的值
|
||||
uint8_t getBit4Value(uint8_t count, int bitPosition) {
|
||||
return (count >> bitPosition) & 0xf;
|
||||
}
|
||||
|
||||
// 封装的函数,获取5个bit组合成的值
|
||||
uint8_t getBit5Value(uint8_t count, int bitPosition) {
|
||||
return (count >> bitPosition) & 0x1f;
|
||||
}
|
||||
#endif /*WITH_MVVM*/
|
||||
|
@ -7,6 +7,7 @@
|
||||
#define MOTO_ICMX_GB518_A270M 1
|
||||
#define MOTO_ICMX_GB518_A270M_KP 2
|
||||
#define MOTO_ICMX_GB518_A270S 3
|
||||
#define MOTO_ICMX_GB518_A270S_KP 4
|
||||
|
||||
#define MOTO_WARE_HOSE MOTO_ICMX_GB518_A270S
|
||||
|
||||
@ -28,10 +29,20 @@
|
||||
|
||||
#elif (MOTO_WARE_HOSE == MOTO_ICMX_GB518_A270S)
|
||||
#define SOFT_WARE_HOST 0
|
||||
#define SOFT_WARE_ORDER 2
|
||||
#define SOFT_WARE_ORDER 3
|
||||
#define HARD_WARE "MXC-A27-M V4.5"
|
||||
#define HARD_WARE_LABEL "4.5"
|
||||
#define KEY_EXCHANGE 1
|
||||
#define MCU_INFO_LABEL "A270S"
|
||||
|
||||
#elif (MOTO_WARE_HOSE == MOTO_ICMX_GB518_A270S_KP)
|
||||
#define SOFT_WARE_HOST 0
|
||||
#define SOFT_WARE_ORDER 2
|
||||
#define HARD_WARE "MXC-A27-S-KP V4.5"
|
||||
#define HARD_WARE_LABEL "4.5"
|
||||
#define KEY_EXCHANGE 1
|
||||
#define UI_VIEW_QUICKLY_ARRANGE 1//快排功能宏
|
||||
|
||||
|
||||
|
||||
#else
|
||||
|
@ -169,7 +169,7 @@ void Power_On_Self_Test(void){
|
||||
widget_t* win = window_manager();
|
||||
widget_t* child = window_manager_get_top_main_window(win);
|
||||
widget_t* progress_circle = widget_lookup(win, "progress_circle", TRUE);
|
||||
widget_set_animation(progress_circle, "value(duration=1000,yoyo_times=1,easing=linear,from=120,to=1)");
|
||||
widget_set_animation(progress_circle, "value(duration=800,yoyo_times=1,easing=linear,from=120,to=1)");
|
||||
}
|
||||
|
||||
//长按事件处理
|
||||
@ -299,7 +299,7 @@ double calculateTotalDistance(uint8_t count)
|
||||
|
||||
|
||||
void ASB_speed_event_handing(int *buf){
|
||||
#if (MOTO_WARE_HOSE == MOTO_ICMX_GB518_A270S_KP)
|
||||
#ifdef UI_VIEW_QUICKLY_ARRANGE
|
||||
uint8_t data = 0;
|
||||
uint8_t speed_data = 0;
|
||||
uint8_t speed_flag = 0;
|
||||
@ -314,7 +314,8 @@ void ASB_speed_event_handing(int *buf){
|
||||
speed_flag = getBitValue(data,2);
|
||||
// printf("frontflag=%d.\r\n",speed_flag);
|
||||
//前轮速度有效
|
||||
if(!speed_flag){
|
||||
// if(!speed_flag){
|
||||
if(0){
|
||||
// printf("front>speed_data=%05X,speed=%08X,",speed_data,speed);
|
||||
speed = speed_data | speed<<5;
|
||||
// printf("rearspeed=%X.\r\n",speed);
|
||||
@ -352,7 +353,8 @@ void ASB_speed_event_handing(int *buf){
|
||||
// printf("data3=%X.\r\n",speed_data);
|
||||
speed_flag = getBitValue(data,4);
|
||||
// printf("rearflag=%d.\r\n",speed_flag);
|
||||
if(!speed_flag){
|
||||
// if(!speed_flag){
|
||||
if(1){
|
||||
speed = speed_data | speed<<3;
|
||||
// printf("rearspeed=%X.\r\n",speed);
|
||||
|
||||
@ -385,6 +387,54 @@ void ASB_speed_event_handing(int *buf){
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void ASB_141_speed_event_handing(int *buf){
|
||||
#ifdef UI_VIEW_QUICKLY_ARRANGE
|
||||
uint8_t data = 0;
|
||||
uint8_t speed_data = 0;
|
||||
uint8_t speed_flag = 0;
|
||||
uint16_t speed = 0;
|
||||
uint32_t trip = 0;
|
||||
uint32_t total = 0;
|
||||
uint16_t display_speed = 0;
|
||||
|
||||
*(buf++)&0xFF;
|
||||
*(buf++)&0xFF;
|
||||
*(buf++)&0xFF;
|
||||
*(buf++)&0xFF;
|
||||
|
||||
speed = *(buf++)&0xFF;
|
||||
data = *(buf++)&0xFF;
|
||||
speed_data = getBit5Value(data,3);
|
||||
speed = speed_data | speed<<5;
|
||||
|
||||
speed = (int)(speed * 0.05625);//偏移系数
|
||||
|
||||
display_speed = speed;//UI显示上浮8%
|
||||
// printf("display_speed=%X>%d,",speed,speed);
|
||||
speed = (int)(speed * 0.92);
|
||||
// printf("mile_speed=%X>%d.\r\n",speed,speed);
|
||||
|
||||
total_mile += calculateTotalDistance(speed);
|
||||
if(display_speed>=255)
|
||||
display_speed = 255;
|
||||
Set_sys_velocity(display_speed);
|
||||
trip = flash_trip_mile + total_mile;
|
||||
total = flash_total_mile + total_mile;
|
||||
|
||||
if((int)(total_mile)>=1 && (((int)total_mile)%1000 ==0) && total != total_flag){
|
||||
save_total_mile = 1;
|
||||
total_flag = total;
|
||||
}
|
||||
|
||||
Set_sys_trip_mileage(trip);
|
||||
Set_sys_total_mileage(total);
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void speed_event_handing(int *buf){
|
||||
uint16_t veer_velocity = 0;
|
||||
uint16_t eng_temp = 0;
|
||||
@ -403,13 +453,15 @@ void speed_event_handing(int *buf){
|
||||
speed = *(buf++)&0xFF;
|
||||
display_speed = speed;//UI显示上浮8%
|
||||
speed = (int)(speed * 0.92);
|
||||
#else
|
||||
*(buf++)&0xFF;
|
||||
#endif
|
||||
|
||||
*(buf++);
|
||||
eng_temp = *(buf++) &0xFF;
|
||||
eng_temp = (*(buf++)&0xFF) | eng_temp<<8;
|
||||
|
||||
*(buf++);
|
||||
// *(buf++);
|
||||
#if SPEED_DATA_CAN
|
||||
if(veer_velocity>16384)
|
||||
veer_velocity = 16384;
|
||||
@ -1254,7 +1306,7 @@ void information_win_init(widget_t* win){
|
||||
widget_set_text_utf8(child,tmpStr);
|
||||
|
||||
child = widget_lookup(win, "pcb", TRUE);
|
||||
tk_snprintf(tmpStr, sizeof(tmpStr), "%s V%d.%d",Get_device_produce_num(),Get_device_hardware_version_host(),Get_device_hardware_version_order());
|
||||
tk_snprintf(tmpStr, sizeof(tmpStr), "%s V%d.%d",MCU_INFO_LABEL,Get_device_hardware_version_host(),Get_device_hardware_version_order());
|
||||
widget_set_text_utf8(child,tmpStr);
|
||||
|
||||
child = widget_lookup(win, "bt", TRUE);
|
||||
|
@ -77,5 +77,6 @@ void list_theme_button2_init(void);
|
||||
void list_theme_button4_init(void);
|
||||
|
||||
void speed_event_handing(int *buf);
|
||||
void ASB_141_speed_event_handing(int *buf);
|
||||
|
||||
#endif
|
@ -201,6 +201,39 @@ static void tp_init(widget_t *win) {
|
||||
}*/
|
||||
|
||||
select_tab = widget_lookup(win, "cp_tab", TRUE);
|
||||
#else
|
||||
// 关闭对应按钮
|
||||
widget_t *dis_tab = widget_lookup(win, "aa_tab", TRUE);
|
||||
widget_t *cp_tab = widget_lookup(win, "cp_tab", TRUE);
|
||||
widget_t *ec_tab = widget_lookup(win, "ec_tab", TRUE);
|
||||
widget_set_visible(dis_tab, FALSE);
|
||||
widget_set_visible(cp_tab, FALSE);
|
||||
widget_set_visible(ec_tab, TRUE);
|
||||
|
||||
widget_set_visible(carplay_view, FALSE);
|
||||
widget_set_visible(android_view, FALSE);
|
||||
widget_set_visible(p2p_view, TRUE);
|
||||
|
||||
widget_t *bt_name = widget_lookup(win, "bt_name", TRUE);
|
||||
printf("strQrText=%s.\r\n",strQrText);
|
||||
widget_t *qr1 = qr_create(qr_view, 40, 81, 200, 200);
|
||||
// printf("qr1 >>option>> %d.\r\n",widget_index_of(qr1));
|
||||
qr_set_value(qr1, strQrText);
|
||||
// getLastNChars(strQrText, 22, tmpStr);
|
||||
getTextAfterLastEqual(strQrText, tmpStr);
|
||||
widget_set_text_utf8(bt_name, tmpStr);
|
||||
widget_t *uuid = widget_lookup(win, "uuid", TRUE);
|
||||
tk_snprintf(tmpStr, sizeof(tmpStr), "uuid:%s", UI_uuid);
|
||||
// printf("UI_uuid > %s .\r\n",UI_uuid);
|
||||
widget_set_text_utf8(uuid, tmpStr);
|
||||
// printf("tmpStr>%s.\r\n",tmpStr);
|
||||
ap_get_ssid(strQrText, tmpStr);
|
||||
printf("wifi_name>%s.\r\n",tmpStr);
|
||||
ap_get_pwd(strQrText, tmpStr);
|
||||
printf("wifi_pwd>%s.\r\n",tmpStr);
|
||||
|
||||
qr_flag = 1;
|
||||
select_tab = widget_lookup(win, "ec_tab", TRUE);
|
||||
|
||||
#endif
|
||||
|
||||
@ -563,6 +596,11 @@ static ret_t on_new_key_down(void *ctx, event_t *e) {
|
||||
#if (MOTO_WARE_HOSE == MOTO_ICMX_A591F)
|
||||
return_demo();
|
||||
#else
|
||||
|
||||
#ifdef UI_VIEW_QUICKLY_ARRANGE
|
||||
return_demo();
|
||||
#else
|
||||
|
||||
if(Get_sys_wifi_state())//连接上不允许切换
|
||||
return RET_OK;
|
||||
widget_t *qr_view = widget_lookup(win, "qr_view", TRUE);
|
||||
@ -659,6 +697,8 @@ static ret_t on_new_key_down(void *ctx, event_t *e) {
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
} else if (evt->key == TK_KEY_q) { // 灯光开关
|
||||
return_demo();
|
||||
}
|
||||
|
@ -191,6 +191,16 @@ void UI_init(void){
|
||||
|
||||
#ifdef AMT630HV100
|
||||
|
||||
#ifdef UI_VIEW_QUICKLY_ARRANGE
|
||||
printf("awtk init .ec\r\n");
|
||||
Set_sys_tp_state(2);
|
||||
|
||||
carlink_cp_enable(0);
|
||||
carlink_aa_enable(0);
|
||||
carlink_ec_enable(1);
|
||||
#else
|
||||
|
||||
|
||||
#if (MOTO_WARE_HOSE == MOTO_ICMX_A580A || (MOTO_WARE_HOSE == MOTO_ICMX_GB518_A270S))
|
||||
if(!Get_sys_tp_state()){//carplay
|
||||
printf("awtk init carplay.\r\n");
|
||||
@ -231,6 +241,8 @@ void UI_init(void){
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@ -573,11 +585,11 @@ void* test_timer_queue(void *args){
|
||||
A27_BT_init();
|
||||
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(800);
|
||||
#else
|
||||
sleep_ms(800);
|
||||
#endif
|
||||
// #ifdef AMT630HV100
|
||||
// vTaskDelay(800);
|
||||
// #else
|
||||
// sleep_ms(800);
|
||||
// #endif
|
||||
|
||||
Power_On_Self_Test();
|
||||
#ifdef AMT630HV100
|
||||
@ -590,7 +602,7 @@ 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 * 2.5){
|
||||
UI_init();
|
||||
}
|
||||
}
|
||||
|