#include "remapping.h" #include "SYSTEM/system.h" #include "LVGL/lvgl_src.h" #include "config.h" volatile bool is_playing_music = false; // 默认表情路径(防止返回NULL导致黑屏) extern const char *default_emoji_path; char *remapping(uint32_t bits) { char *path = NULL; // 初始化为 NULL,而不是 {0} ESP_LOGE("ramming", "bits:0X%04X", (unsigned int)bits); // system_info.s_emoji_pack.using_pack = '0'; // if (system_info.s_emoji_pack.using_pack == '0') // { switch (bits) { // ESP_LOGE("ramming","bits:0X%04X",(unsigned int)bits); case emoji_event_start: path = lottie_files[start_emojo]; break; case emoji_event_play_music: path = lottie_files[music_emojo]; is_playing_music = true; ESP_LOGI("remapping", "emoji_event_play_music: music_emojo=%d, path=%s", music_emojo, path ? path : "NULL"); break; case emoji_event_pause_music: is_playing_music = false; path = lottie_files[music_emojo]; break; case emoji_event_stop_music: is_playing_music = false; path = lottie_files[music_emojo]; break; case emoji_event_continue_play_music: /* 与 0x0002 进入 listen 后一致,供 BLE 按「持续播放音乐」直通插播、停/暂停生效 */ is_playing_music = true; path = lottie_files[music_listen_emojo]; break; case emoji_event_cold_air: path = lottie_files[cold_air_emojo]; break; case emoji_event_warm_air: path = lottie_files[warm_air_emojo]; break; case emoji_event_open_window: path = lottie_files[open_left_window_emojo]; break; case emoji_event_charging: path = lottie_files[charging_emojo]; break; case emoji_event_charged_over: path = lottie_files[charged_over_emojo]; break; case emoji_event_answer_call: path = lottie_files[calling_emojo]; break; case emoji_event_hangup_call: path = lottie_files[calling_emojo]; break; case emoji_event_start_navigation: path = lottie_files[navigation_modle_emojo]; break; case emoji_event_stop_navigation: path = lottie_files[navigation_modle_emojo]; break; case emoji_event_camping_mode: path = lottie_files[camping_emojo]; break; case emoji_event_sleep_mode: path = lottie_files[snap_emojo]; break; case emoji_event_washing_mode: path = lottie_files[washing_emojo]; break; case emoji_event_welcome_mdoe: path = lottie_files[welcome_emojo]; break; case emoji_event_awake: path = lottie_files[hearing_emojo]; break; case emoji_event_arrive: path = lottie_files[arrive_emojo]; break; case emoji_event_guard: path = lottie_files[guard_emojo]; break; case emoji_event_protect: path = lottie_files[protect_emojo]; break; case emoji_event_mindfulness: path = lottie_files[breath_emojo]; break; case emoji_event_horoscope: path = lottie_files[horoscope_emojo]; break; case emoji_event_bless: path = lottie_files[bless_emojo]; break; // 带动作 case emoji_event_awake_diver: path = lottie_files[hearing_emojo]; break; case emoji_event_awake_passenger: path = lottie_files[hearing_emojo]; break; case emoji_event_belt_driver: path = lottie_files[saftybelt_emojo]; break; case emoji_event_belt_passenger: path = lottie_files[saftybelt_emojo]; break; case emoji_event_shock: path = lottie_files[hearing_emojo]; break; case emoji_event_check_back: path = lottie_files[hearing_emojo]; break; case emoji_event_open_door_driver: path = lottie_files[hello_emojo]; break; case emoji_event_open_door_passenger: path = lottie_files[hello_left_emojo]; break; case emoji_event_open_door_all: path = lottie_files[hello_left_emojo]; break; case emoji_event_not_belt_driver: path = lottie_files[saftybelt_no_emojo]; break; case emoji_event_not_belt_passenger: path = lottie_files[saftybelt_no_emojo]; break; case emoji_event_open_window_driver: path = lottie_files[open_left_window_emojo]; break; case emoji_event_cold_air_driver: path = lottie_files[cold_air_emojo]; break; case emoji_event_warm_air_driver: path = lottie_files[warm_air_emojo]; break; case emoji_event_left_rear_wake: path = lottie_files[hearing_emojo]; break; case emoji_event_right_rear_wake: path = lottie_files[hearing_emojo]; break; case emoji_event_turn_head_180: path = lottie_files[turn_around_emojo]; break; case emoji_event_click_to_start_play_music: path = lottie_files[music_emojo]; break; case emoji_event_sentinel_guard: path = lottie_files[guard_emojo]; break; case emoji_event_sentinel_protect: path = lottie_files[protect_emojo]; break; case emoji_event_turn_left: // 左转弯 path = lottie_files[turn_left_emojo]; break; case emoji_event_turn_right: // 右转弯 path = lottie_files[turn_right_emojo]; break; case emoji_event_drink_coffee: // 喝茶 path = lottie_files[tried_emojo]; break; case emoji_event_speedup: // 急加速 path = lottie_files[speedup_emojo]; break; case emoji_event_dizziness: // 眩晕 path = lottie_files[break_emojo]; break; case emoji_event_snail: // 蜗牛 🐌 path = lottie_files[trafficjam_emojo]; break; case emoji_event_money: // 掉金币 path = lottie_files[money_emojo]; break; case emoji_event_singing: // 唱歌🎤 path = lottie_files[sing_emojo]; break; case emoji_event_celebrate: // 庆祝🎉 path = lottie_files[holiday_emojo]; break; case emoji_event_breath_deeply: // 深呼吸 path = lottie_files[calm_down_emojo]; break; case emoji_event_autodrive: // 智能驾驶模式 path = lottie_files[autodrive_emojo]; break; case emoji_event_autoparking: // 自动泊车 path = lottie_files[auto_parking_emojo]; break; case emoji_event_back_up: // 倒车 path = lottie_files[back_car_emojo]; break; case emoji_event_car_turning: // 转弯 path = lottie_files[turn_left_emojo]; break; case emoji_event_back_home: // 回家 path = lottie_files[backhome_emojo]; break; case emoji_event_out_home: // 离家 path = lottie_files[outhome_emojo]; break; case emoji_event_card: //智付刷卡 path = lottie_files[card_emojo]; break; case emoji_event_distract: //分心 path = lottie_files[distract_emojo]; break; case emoji_event_coffe: //喝咖啡 path = lottie_files[tried_emojo]; break; case emoji_event_speed_over_60: //急加速 速度超过60km/h path = lottie_files[speedup_emojo]; break; case emoji_event_break_car: //刹车 减速到10km/h path = lottie_files[break_emojo]; break; case emoji_event_turn_to_left_light: //左转向灯 和 右转向灯 path = lottie_files[turn_left_emojo]; break; case emoji_event_turn_to_right_light: //左转向灯 和 右转向灯 path = lottie_files[turn_right_emojo]; break; case emoji_event_speed_over_120: //左转向灯 和 右转向灯 path = lottie_files[toofast_emojo]; break; case emoji_event_traffic_jam: //堵车 path = lottie_files[trafficjam_emojo]; break; case emoji_event_traffic_light: //交通灯 path = lottie_files[traffic_light_emojo]; break; case emoji_event_2h_drive: //连续驾驶2h汽车 path = lottie_files[_2h_emojo]; break; case emoji_event_AI_respond: //AI回复结束 path = lottie_files[AI_respond_emojo]; break; case emoji_event_windshield_wiper: //雨刮器 path = lottie_files[windshield_wiper_emojo]; break; case emoji_event_high_beam: //远光灯 path = lottie_files[deng_emojo]; break; case emoji_event_headlight: //大灯 path = lottie_files[deng_emojo]; break; case emoji_event_sortition: //抽签 path = lottie_files[auto_parking_emojo]; break; default: ESP_LOGE("remapping", "BITS ERROR: 0x%04X, using default animation", (unsigned int)bits); // 如果 bits 不匹配任何 case,返回默认动画路径而不是 NULL path = (char *)default_emoji_path; break; } // 如果 path 仍然是 NULL 或空字符串,返回默认动画路径(防止黑屏) if (path == NULL || path[0] == '\0') { ESP_LOGE("remapping", "path is NULL or empty (bits=0x%04X), using default animation", (unsigned int)bits); path = (char *)default_emoji_path; } ESP_LOGI("remapping", "remapping(0x%04X) returns: %s", (unsigned int)bits, path); return path; }