From: xue <2144439972@qq.com> Date: Mon, 27 Oct 2025 07:40:00 +0000 (+0800) Subject: 重新提交 X-Git-Tag: V1.0.9_20251128_194606_LN~167^2~1 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=f6389b0dec4c38927e90fd36d7495caf84b03f3c;p=mirrors%2FFD230.git 重新提交 --- diff --git a/code/sdk/application/brandy/brandy_recovery/recovery_display.c b/code/sdk/application/brandy/brandy_recovery/recovery_display.c index 1ea9c3eb7..3777ef1c7 100644 --- a/code/sdk/application/brandy/brandy_recovery/recovery_display.c +++ b/code/sdk/application/brandy/brandy_recovery/recovery_display.c @@ -16,6 +16,7 @@ #include "lcd_qspi.h" #include "pinctrl_porting.h" #include "product_evb4_standard.h" + #include "gpio.h" // 添加GPIO控制头文件 #ifdef QSPI_DISPLAY #define DPU_FRAME_BUFF_ADDR 0x60280000 @@ -27,6 +28,19 @@ #define DPU_STRIDER_DIVIDER 8 #define DISP_POWER_ON_DELAY_MS 10 +// 背光控制引脚定义 +#define LCD_BACKLIGHT_PWM_PIN S_AGPIO_L16 /* 背光PWM引脚 */ + +// 直接控制背光函数 +static void recovery_lcd_backlight_on(void) +{ + PRINT("Turning on LCD backlight via GPIO control...\n"); + uapi_pin_set_mode(LCD_BACKLIGHT_PWM_PIN, HAL_PIO_FUNC_GPIO); + uapi_gpio_set_dir(LCD_BACKLIGHT_PWM_PIN, GPIO_DIRECTION_OUTPUT); + uapi_gpio_set_val(LCD_BACKLIGHT_PWM_PIN, GPIO_LEVEL_HIGH); // 开启背光 + PRINT("LCD backlight turned on via GPIO\n"); +} + static const lcd_bus_api g_recovery_display_api_mipi = { .bus_init = mipi_bus_init, .bus_deinit = mipi_bus_deinit, @@ -118,11 +132,11 @@ void recovery_display_sample(void) ext_dpu_layer_info layer_info = {0}; #ifdef BOARD_LEINIAO ext_rect update_rect = {0, 0, 360, 360}; // 定义一个局部区域 - #else + #else ext_rect update_rect = {0, 0, 466, 466}; // 定义一个局部区域 #endif - // ext_rect update_rect = {223, 223, 20, 20}; // 定义一个局部区域 + //ext_rect update_rect = {0, 133, 180, 200}; // 定义一个局部区域 recovery_dispay_layer_and_surface_init(&surface, &layer_info, &update_rect); // 设置layer全白色, 也可以使用接口 recovery_dispay_read_image_and_savein_surface 实现从文件系统读图片 @@ -187,4 +201,5 @@ void recovery_display_init(void) uapi_lcd_deinit(); return; } + recovery_lcd_backlight_on(); // 开启背光 } diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/include/uiservice/ui_service.h b/code/sdk/application/wearable/ln/nativeapp/nativeui/include/uiservice/ui_service.h index a44a75dc8..8966aefac 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/include/uiservice/ui_service.h +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/include/uiservice/ui_service.h @@ -67,6 +67,7 @@ typedef enum { HAND_DOWNLOAD_PROGRESS_NOTIFY, // 下载进度通知 HAND_AUDIO_PLAYBACK_START_NOTIFY, // 音频播放开始通知 HAND_AUDIO_PLAYBACK_END_NOTIFY, // 音频播放结束通知 + HAND_AUDIO_RECORDING_END_NOTIFY, // 录音结束通知 HAND_NPC_EMOTION_CHANGE_NOTIFY, // npc表情变化通知 HAND_TIMELINE_STATUS_CHANGE_NOTIFY, // 时间线状态变化通知 MAX_NUM_HANDLER, diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaModel.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaModel.cpp index 8c1dad34a..0fff6491c 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaModel.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaModel.cpp @@ -260,6 +260,7 @@ namespace OHOS void OtaModel::CheckOtaResult(int status) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "OtaModel::CheckOtaResult"); + uapi_setScreenDuration(30000); // 重新设置30秒自动息屏 if(status == 3) { OtaView::GetInstance()->ChangeView(OtaView::OTA_VIEW_UPDATING, OtaView::OTA_VIEW_UPDATE_FAILED); @@ -411,6 +412,7 @@ namespace OHOS { if(OtaDownloadView::GetInstance()) { + uapi_setScreenDuration(30000); // 重新设置30秒自动息屏 OtaView::GetInstance()->ChangeView(OtaView::OTA_VIEW_DOWNLOAD, OtaView::OTA_VIEW_UPDATE_SUCCESS); OtaSuccessView::GetInstance()->UpdateDownloadSuccess("下载成功"); } @@ -430,6 +432,7 @@ namespace OHOS { if(OtaDownloadView::GetInstance()) { + uapi_setScreenDuration(30000); // 重新设置30秒自动息屏 OtaView::GetInstance()->ChangeView(OtaView::OTA_VIEW_DOWNLOAD, OtaView::OTA_VIEW_UPDATE_SUCCESS); OtaSuccessView::GetInstance()->UpdateDownloadSuccess("下载失败"); } diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdModel.h b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdModel.h index f421625b5..30e1929a0 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdModel.h +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdModel.h @@ -229,6 +229,9 @@ namespace OHOS // NPC表情变化处理函数 void HandleNpcEmotionChange(const char* emotion); + // 录音结束处理函数 + void HandleAudioRecordingEnd(); + // 将英文表情映射到英文文件名 std::string MapEmotionToFileName(const char* emotion); diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdAdjustView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdAdjustView.cpp index 421442e92..0e64ad40a 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdAdjustView.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdAdjustView.cpp @@ -201,7 +201,7 @@ namespace OHOS } if (RemindLabel) { - RemindLabel->SetPosition(132, 284, 96, 28); + RemindLabel->SetPosition(136, 275, 96, 25); RemindLabel->SetText("按 退出"); RemindLabel->SetVisible(true); } @@ -213,16 +213,16 @@ namespace OHOS } if (RemindIcon2) { - RemindIcon2->SetPosition(105, 277, 22, 22); + RemindIcon2->SetPosition(159, 276, 22, 22); RemindIcon2->SetSrc("/user/res/volume_down.bin"); RemindIcon2->SetVisible(true); } - if (RemindIcon3) - { - RemindIcon3->SetPosition(211, 276, 22, 22); - RemindIcon3->SetSrc("/user/res/volume_up.bin"); - RemindIcon3->SetVisible(true); - } + // if (RemindIcon3) + // { + // RemindIcon3->SetPosition(211, 276, 22, 22); + // RemindIcon3->SetSrc("/user/res/volume_up.bin"); + // RemindIcon3->SetVisible(true); + // } break; } case THUNDERBIRD_ADJUSTVIEW_NETWORK_CONNECTING: diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdDialogueView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdDialogueView.cpp index ccf2a1c24..d7a1ddf9f 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdDialogueView.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdDialogueView.cpp @@ -166,13 +166,13 @@ namespace OHOS ScreenAlwaysOnCtr(OPEN_SCREEN_ALWAYS_ON); if (TextLabel) { - TextLabel->SetPosition(20, 64, 340, 42); + TextLabel->SetPosition(35, 64, 325, 42); TextLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); TextLabel->SetVisible(true); } if (TextLabel_Y) { - TextLabel_Y->SetPosition(22, 66, 340, 42); + TextLabel_Y->SetPosition(35, 66, 325, 42); TextLabel_Y->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); TextLabel_Y->SetVisible(true); } @@ -226,14 +226,14 @@ namespace OHOS } if (TextLabel) { - TextLabel->SetPosition(0, 64, 360, 42); + TextLabel->SetPosition(35, 64, 325, 42); TextLabel->SetText(currentStatusText.c_str()); TextLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); TextLabel->SetVisible(true); } if (TextLabel_Y) { - TextLabel_Y->SetPosition(2, 66, 360, 42); + TextLabel_Y->SetPosition(37, 66, 325, 42); TextLabel_Y->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); TextLabel_Y->SetText(currentStatusText.c_str()); TextLabel_Y->SetVisible(true); @@ -247,8 +247,18 @@ namespace OHOS void ThunderBirdDialogueView::UpdateDialogueText(const char *text) { if(!TextLabel || !TextLabel_Y) return; + + // 先停止滚动,确保同步 + TextLabel->SetAnimState(Animator::STOP); + TextLabel_Y->SetAnimState(Animator::STOP); + + // 设置文本 TextLabel->SetText(text); - TextLabel_Y->SetText(text); + TextLabel_Y->SetText(text); + + // 同时开始滚动,确保同步 + TextLabel->SetAnimState(Animator::START); + TextLabel_Y->SetAnimState(Animator::START); } void ThunderBirdDialogueView::AudioPlaybackEnd() diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdGuideView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdGuideView.cpp index 91ab067c1..885dc07ae 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdGuideView.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdGuideView.cpp @@ -78,7 +78,7 @@ namespace OHOS qrcode_ = new UIQrcode(); if (qrcode_) { - qrcode_->SetPosition(133, 169, 104, 104); + qrcode_->SetPosition(119, 157, 111, 111); qrcode_->SetQrcodeInfo(ThunderBirdModel::GetInstance()->GetQrcodeContent().c_str()); qrcode_->SetStyle(STYLE_PADDING_LEFT, 4); qrcode_->SetStyle(STYLE_PADDING_RIGHT, 4); @@ -187,7 +187,7 @@ namespace OHOS { if (TextLabel) { - TextLabel->SetPosition(0, 64, 360, 42); + TextLabel->SetPosition(35, 64, 325, 42); TextLabel->SetText("我可以和你聊天,哄你睡觉"); TextLabel->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); TextLabel->SetRollSpeed(35); @@ -195,7 +195,7 @@ namespace OHOS } if (TextLabel_Y) { - TextLabel_Y->SetPosition(2, 66, 360, 42); + TextLabel_Y->SetPosition(37, 66, 325, 42); TextLabel_Y->SetText("我可以和你聊天,哄你睡觉"); TextLabel_Y->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); TextLabel_Y->SetRollSpeed(35); @@ -260,14 +260,11 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "start qrcode path:%s", ThunderBirdModel::GetInstance()->GetQrcodeContent().c_str()); // 重新设置二维码的尺寸和样式,防止变小 - qrcode_->SetPosition(133, 169, 104, 104); - qrcode_->SetStyle(STYLE_PADDING_LEFT, 4); - qrcode_->SetStyle(STYLE_PADDING_RIGHT, 4); - qrcode_->SetStyle(STYLE_PADDING_TOP, 4); - qrcode_->SetStyle(STYLE_PADDING_BOTTOM, 4); + qrcode_->SetPosition(119, 157, 111, 111); qrcode_->SetQrcodeInfo(ThunderBirdModel::GetInstance()->GetQrcodeContent().c_str()); - //打印 + + // 强制重新设置尺寸,防止SetQrcodeInfo后尺寸被改变 qrcode_->Invalidate();//刷新 } } diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdLullabyView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdLullabyView.cpp index e73f2d21d..3031a7152 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdLullabyView.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdLullabyView.cpp @@ -361,14 +361,14 @@ namespace OHOS ScreenAlwaysOnCtr(OPEN_SCREEN_ALWAYS_ON); if (TextLabel) { - TextLabel->SetPosition(0, 64, 360, 42); + TextLabel->SetPosition(35, 64, 325, 42); TextLabel->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); TextLabel->SetRollSpeed(55); TextLabel->SetVisible(true); } if (TextLabel_Y) { - TextLabel_Y->SetPosition(2, 66, 360, 42); + TextLabel_Y->SetPosition(37, 66, 325, 42); TextLabel_Y->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); TextLabel_Y->SetStyle(STYLE_TEXT_COLOR, 0xff000000); TextLabel_Y->SetRollSpeed(55); @@ -434,8 +434,17 @@ namespace OHOS void ThunderBirdLullabyView::UpdateLullabyText(const char *text) { - TextLabel->SetText(text); - TextLabel_Y->SetText(text); + // 先停止滚动,确保同步 + TextLabel->SetAnimState(Animator::STOP); + TextLabel_Y->SetAnimState(Animator::STOP); + + // 设置文本 + TextLabel->SetText(text); + TextLabel_Y->SetText(text); + + // 同时开始滚动,确保同步 + TextLabel->SetAnimState(Animator::START); + TextLabel_Y->SetAnimState(Animator::START); } } diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdMainView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdMainView.cpp index 868eda3a8..132fe03cd 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdMainView.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdMainView.cpp @@ -40,7 +40,7 @@ namespace OHOS static constexpr int16_t JPEG_HEIGHT_DIVISOR = 2; static const int64_t COLOR_SIGNAL_ON = 0xffffffff; - static const int64_t COLOR_SIGNAL_OFF = 0xff383838; + static const int64_t COLOR_SIGNAL_OFF = 0xff909090; static MediaVideoPlay *g_videoPlay = nullptr; static bool g_lastPlayed = false; diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp index ac9dd9646..407378021 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp @@ -1511,7 +1511,7 @@ currentSubView == ThunderBirdAdjustView::THUNDERBIRD_ADJUSTVIEW_WARNING) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "警告界面超时,检查是否为解绑警告"); // 检查是否为解绑警告,如果是则恢复出厂设置 - if (bind_status == true) { + if (bind_status == false) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "解绑警告界面超时,恢复出厂设置"); restore_factory_settings(); } else { @@ -2239,6 +2239,7 @@ //增加设备解绑提示 int currentView = ThunderBirdMainView::GetInstance()->GetCurrentView(); //获取当前视图 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdModel::HandleBindAndUnbind: 设备已解绑,显示解绑警告"); + bind_status = false;//解绑标志值位,用于界面跳转真正解绑放到出厂设置里面 ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_ADJUSTVIEW, ThunderBirdAdjustView::THUNDERBIRD_ADJUSTVIEW_WARNING); if(ThunderBirdAdjustView::GetInstance()) { @@ -2334,6 +2335,34 @@ } } + // 录音结束处理函数 + void ThunderBirdModel::HandleAudioRecordingEnd() + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdModel::HandleAudioRecordingEnd: 录音结束,跳转到播放界面"); + + // 获取当前视图状态 + ThunderBirdMainView *view = ThunderBirdMainView::GetInstance(); + if (view) { + int16_t currentView = view->GetCurrentView(); + int16_t currentSubView = view->GetCurrentSubView(); + + // 如果当前在对话界面,且不是在状态显示界面(说明是正常录音结束,不是退出对话) + if (currentView == THUNDERBIRD_DIALOGUEVIEW && + currentSubView != ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_STATUS_SHOW) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "录音结束,跳转到播放界面"); + view->ChangeView(currentView, THUNDERBIRD_DIALOGUEVIEW, ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_SPEAKING); + + // 停止聆听超时定时器 + StopCountUpTimer(); + + // 清空音频文本队列 + ClearAudioTextQueue(); + } else { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "录音结束,但当前在状态显示界面,跳过界面跳转(可能是退出对话模式)"); + } + } + } + // 将英文表情映射到英文文件名 std::string ThunderBirdModel::MapEmotionToFileName(const char* emotion) { diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp index 43044cf1d..89c9a44ec 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp @@ -290,6 +290,10 @@ namespace OHOS // 处理对话功能 HandleDialogueFunction(currentView, currentSubView); } + else + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HandleFuncKey: KEY_TYPE_FUNC press, but not in dialogue mode"); + } } return true; @@ -362,6 +366,8 @@ namespace OHOS */ void ThunderBirdPresenter::HandleDialogueFunction(int16_t currentView, int16_t currentSubView) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HandleDialogueFunction: currentView=%d, currentSubView=%d", currentView, currentSubView); + //bool flag = ThunderBirdModel::GetInstance()->Get_is_all_services_ready(); // if(flag == false) // { @@ -375,6 +381,7 @@ namespace OHOS DialogueingFlag = true; } else*/if (currentView == THUNDERBIRD_DIALOGUEVIEW && currentSubView == ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_LISTENING ) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "停止录音,跳转到思考状态"); // 停止录音并发送 // 停止聆听超时定时器 ThunderBirdModel::GetInstance()->StopCountUpTimer(); @@ -383,6 +390,7 @@ namespace OHOS //清空音频文本队列 ThunderBirdModel::GetInstance()->ClearAudioTextQueue(); } else { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "开始录音,跳转到聆听状态"); // 开始录音 ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_DIALOGUEVIEW, ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_LISTENING); ThunderBirdDialogueView::GetInstance()->UpdateDialogueText("超认真聆听中"); @@ -680,8 +688,12 @@ namespace OHOS int16_t currentView = ThunderBirdMainView::GetInstance()->GetCurrentView(); int16_t currentSubView = ThunderBirdMainView::GetInstance()->GetCurrentSubView(); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HandleFuncKeyLongPress: currentView=%d, currentSubView=%d, isDialogueing=%d", + currentView, currentSubView, isDialogueing); + if(currentView == THUNDERBIRD_DIALOGUEVIEW && currentSubView == ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_STATUS_SHOW) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "进入对话模式"); ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_DIALOGUEVIEW, ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_LISTENING); isDialogueing = true; // 进入对话模式时记录当前表情 @@ -689,12 +701,20 @@ namespace OHOS //ThunderBirdDialogueView::GetInstance()->UpdateDialogueText("点击开始对话"); //DialogueingFlag = true; //ln_ws_audio_init();//功耗优化 - do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_AUDIO_INIT, NULL, 0); ln_ws_start_audio_chat(LN_AUDIO_CHAT_VOICE_CHAT_REQUEST);//开始对话 + + do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_AUDIO_INIT, NULL, 0); } else if(currentView == THUNDERBIRD_DIALOGUEVIEW) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "退出对话模式,当前子状态: %d", currentSubView); + // 先停止定时器,避免在退出过程中继续触发 + if(currentSubView == ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_LISTENING) + { + ThunderBirdModel::GetInstance()->StopCountUpTimer(); + } + // 停止实际的音频播放 // ai_media_play_stop(); // WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ThunderBirdDialogueView::AudioPlaybackEnd: Stopped audio playback"); @@ -711,10 +731,6 @@ namespace OHOS isDialogueing = false; // DialogueingFlag = false; ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_DIALOGUEVIEW, ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_STATUS_SHOW); - if(currentSubView == ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_LISTENING) - { - ThunderBirdModel::GetInstance()->StopCountUpTimer(); - } ThunderBirdModel::GetInstance()->OnExitDialogueMode(); } diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdReminderView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdReminderView.cpp index 8ff2af773..f3d2e3f78 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdReminderView.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdReminderView.cpp @@ -161,8 +161,8 @@ namespace OHOS if (TextLabel) { // 文本位置:图标右侧,紧挨着 - TextLabel->SetPosition(96, 64, 300, 42); - TextLabel->SetText("11点了该睡觉了"); + TextLabel->SetPosition(35, 64, 325, 42); + TextLabel->SetText("你有一条提醒"); TextLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); // 左对齐,因为已经整体居中了 TextLabel->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); TextLabel->SetRollSpeed(35); @@ -172,8 +172,8 @@ namespace OHOS if (TextLabel_Y) { // 黑色文本:位置比白色文本偏移2像素 - TextLabel_Y->SetPosition(98, 66, 300, 42); - TextLabel_Y->SetText("11点了该睡觉了"); + TextLabel_Y->SetPosition(37, 66, 325, 42); + TextLabel_Y->SetText("你有一条提醒"); TextLabel_Y->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); TextLabel_Y->SetStyle(STYLE_TEXT_COLOR, 0xff000000); TextLabel_Y->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); @@ -478,8 +478,8 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Updated task reminder text with content only: %s", content); } else { // 都没有,使用默认文本 - TextLabel->SetText("11点了该睡觉了"); - TextLabel_Y->SetText("11点了该睡觉了"); + TextLabel->SetText("你有一条提醒"); + TextLabel_Y->SetText("你有一条提醒"); WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Updated task reminder text with default text"); } } diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/uiservice/src/ui_service.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/uiservice/src/ui_service.cpp index d8e4c8020..4ceb644fd 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/uiservice/src/ui_service.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/uiservice/src/ui_service.cpp @@ -103,6 +103,7 @@ static void HandDownloadFailNotify(Request *request); static void HandDownloadProgressNotify(Request *request); static void HandAudioPlaybackStartNotify(Request *request); static void HandAudioPlaybackEndNotify(Request *request); +static void HandAudioRecordingEndNotify(Request *request); static void HandNpcEmotionChangeNotify(Request *request); static void HandTimelineStatusChangeNotify(Request *request); // 消息处理程序项数组(每个消息类型对应一个处理函数,函数名以 Handle 开头) @@ -124,6 +125,7 @@ MsgHandlerEntry msgHandlers[] = { {HAND_DOWNLOAD_PROGRESS_NOTIFY,HandDownloadProgressNotify}, {HAND_AUDIO_PLAYBACK_START_NOTIFY,HandAudioPlaybackStartNotify}, {HAND_AUDIO_PLAYBACK_END_NOTIFY,HandAudioPlaybackEndNotify}, + {HAND_AUDIO_RECORDING_END_NOTIFY,HandAudioRecordingEndNotify}, {HAND_NPC_EMOTION_CHANGE_NOTIFY,HandNpcEmotionChangeNotify}, {HAND_TIMELINE_STATUS_CHANGE_NOTIFY,HandTimelineStatusChangeNotify}, }; @@ -658,6 +660,14 @@ void HandAudioPlaybackEndNotify(Request *request) GraphicService::GetInstance()->PostGraphicEvent( std::bind(&OHOS::ThunderBirdModel::HandleAudioPlaybackEnd,OHOS::ThunderBirdModel::GetInstance())); } + +// 录音结束通知 +void HandAudioRecordingEndNotify(Request *request) +{ + WEARABLE_LOGE(WEARABLE_LOG_MODULE_UI_SERVICE, "HandAudioRecordingEndNotify msg_id = %d", request->msgId); + GraphicService::GetInstance()->PostGraphicEvent( + std::bind(&OHOS::ThunderBirdModel::HandleAudioRecordingEnd,OHOS::ThunderBirdModel::GetInstance())); +} // 通知npc表情变化 void HandNpcEmotionChangeNotify(Request *request) { diff --git a/code/sdk/application/wearable/ohos_startup/ohosfwk_startup.c b/code/sdk/application/wearable/ohos_startup/ohosfwk_startup.c index cc0800f09..5a70c16d6 100644 --- a/code/sdk/application/wearable/ohos_startup/ohosfwk_startup.c +++ b/code/sdk/application/wearable/ohos_startup/ohosfwk_startup.c @@ -16,6 +16,10 @@ #include "power_display_service.h" #endif +#if defined(CUSTOM_UTILS) && defined(BOARD_LEINIAO) +#include "custom_utils.h" +#endif + #include "soc_lcd_api.h" // int32_t user_get_random_bytes(uint32_t size, uint8_t *randnum) @@ -45,6 +49,12 @@ void ohos_show_bootup_logo(void) return; } +#if defined(CUSTOM_UTILS) && defined(BOARD_LEINIAO) + PRINT("Turning on LCD backlight...\n"); + uapi_lcd_backlight_on(); + PRINT("LCD backlight turned on (CUSTOM_UTILS + BOARD_LEINIAO)\n"); +#endif + #ifdef ENABLE_UIKIT InitGraphicService(); #endif diff --git a/code/sdk/build/config/target_config/brandy/config.py b/code/sdk/build/config/target_config/brandy/config.py index 421dd6a81..28c9282bf 100644 --- a/code/sdk/build/config/target_config/brandy/config.py +++ b/code/sdk/build/config/target_config/brandy/config.py @@ -1374,8 +1374,11 @@ target = { # 'TPTYPE_FT6X46', 'CFG_FLASH_SIZE=16', 'CONFIG_NORFLASH_SIZE=16', + 'CUSTOM_UTILS', 'LEINIAO', - 'SINGLE_USER_PARTITION' + 'SINGLE_USER_PARTITION', + # 添加显示支持 + 'LCD_JD9885', ], 'ram_component': ["at_cmd"] }, @@ -1546,8 +1549,11 @@ target = { # 'TPTYPE_FT6X46', 'CFG_FLASH_SIZE=16', 'CONFIG_NORFLASH_SIZE=16', + 'CUSTOM_UTILS', 'LEINIAO', - 'SINGLE_USER_PARTITION' + 'SINGLE_USER_PARTITION', + # 添加显示支持 + 'LCD_JD9885', ], 'ram_component': ["at_cmd"] }, diff --git a/code/sdk/drivers/boards/brandy_evb/board_config/board_leiniao.h b/code/sdk/drivers/boards/brandy_evb/board_config/board_leiniao.h index 07a30ca66..7ab99de56 100644 --- a/code/sdk/drivers/boards/brandy_evb/board_config/board_leiniao.h +++ b/code/sdk/drivers/boards/brandy_evb/board_config/board_leiniao.h @@ -288,7 +288,7 @@ const hal_gpio_config_t g_gpio_function_config[PIN_MAX_NUMBER] = { { S_AGPIO_L20, HAL_GPIO_DIRECTION_OUTPUT, HAL_GPIO_LEVEL_HIGH, 0, NULL }, #endif - // { S_AGPIO_L16, HAL_GPIO_DIRECTION_OUTPUT, HAL_GPIO_LEVEL_HIGH, 0, NULL }, + //{ S_AGPIO_L16, HAL_GPIO_DIRECTION_OUTPUT, HAL_GPIO_LEVEL_HIGH, 0, NULL }, //默认关闭马达 { S_AGPIO_L32, HAL_GPIO_DIRECTION_OUTPUT, HAL_GPIO_LEVEL_LOW, 0, NULL }, { S_AGPIO_R0, HAL_GPIO_DIRECTION_OUTPUT, HAL_GPIO_LEVEL_LOW, 0, NULL }, diff --git a/code/sdk/files/leiniao/fs/user/system/SystemUpdateing.bin b/code/sdk/files/leiniao/fs/user/system/SystemUpdateing.bin index 8bd87fab4..f9a331c76 100644 Binary files a/code/sdk/files/leiniao/fs/user/system/SystemUpdateing.bin and b/code/sdk/files/leiniao/fs/user/system/SystemUpdateing.bin differ diff --git a/code/sdk/zhihui/leiniao/imsl_ln/ln_api.c b/code/sdk/zhihui/leiniao/imsl_ln/ln_api.c index 1a56180d8..094d34d70 100644 --- a/code/sdk/zhihui/leiniao/imsl_ln/ln_api.c +++ b/code/sdk/zhihui/leiniao/imsl_ln/ln_api.c @@ -991,6 +991,11 @@ void ln_ws_process_message(const ws_data_msg_t *data_msg, ws_command_t type) push_audio_playback_start_notification(); break; } + case WS_CMD_AUDIO_RECORDING_END: + { + push_audio_recording_end_notification(); + break; + } default: { printf("[WS] Unknown command=%s\n", cmd_str ? cmd_str : ""); diff --git a/code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.cpp b/code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.cpp index ec570196d..d9a104e1c 100644 --- a/code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.cpp +++ b/code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.cpp @@ -254,17 +254,22 @@ void push_download_progress_notification(int progress) SendMsgToUIService(HAND_DOWNLOAD_PROGRESS_NOTIFY, 0, &progress, sizeof(progress)); } -//通知音频播放结束了 //通知音频播放开始了 void push_audio_playback_start_notification(void) { SendMsgToUIService(HAND_AUDIO_PLAYBACK_START_NOTIFY, 0, NULL, 0); } +//通知音频播放结束了 void push_audio_playback_end_notification(void) { SendMsgToUIService(HAND_AUDIO_PLAYBACK_END_NOTIFY, 0, NULL, 0); } +//通知录音结束 +void push_audio_recording_end_notification(void) +{ + SendMsgToUIService(HAND_AUDIO_RECORDING_END_NOTIFY, 0, NULL, 0); +} //通知npc表情变化 void push_npc_emotion_change_notification(const char *emotion) { diff --git a/code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.h b/code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.h index 02df5a0b6..ea27b270c 100644 --- a/code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.h +++ b/code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.h @@ -101,6 +101,8 @@ void push_download_progress_notification(int progress); //通知音频播放结束了 void push_audio_playback_start_notification(void); void push_audio_playback_end_notification(void); +//通知录音结束 +void push_audio_recording_end_notification(void); //通知npc表情变化 void push_npc_emotion_change_notification(const char *emotion); //通知时间线状态变化