From 2a5d47ddacca0bd8d3b082f969d04adcbf99dfb3 Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Tue, 11 Jun 2024 11:44:00 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E5=A4=8D=E9=97=B9=E9=92=9F=E5=8F=96?= =?utf8?q?=E6=B6=88=E5=90=8E=E4=BE=9D=E7=84=B6=E4=BC=9A=E5=93=8D=E7=9A=84b?= =?utf8?q?ug?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../alarmclockmanage/src/AlarmClockManage.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/alarmclockmanage/src/AlarmClockManage.cpp b/code/sdk/application/wearable/fd230app/nativeui/alarmclockmanage/src/AlarmClockManage.cpp index 8d03ec00c..86cfbd3eb 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/alarmclockmanage/src/AlarmClockManage.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/alarmclockmanage/src/AlarmClockManage.cpp @@ -372,13 +372,16 @@ static int32 SetFirstAlarmToday(FirstAlarmTodaySetType type) std::list< AlarmClockInfoToday>::iterator node; std::list< AlarmClockInfoToday>::iterator tempNode; - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetFirstAlarmToday !!"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SetFirstAlarmToday !!"); if (AlarmGetCurrentTimeInfo(&curTime) != 0) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SetFirstAlarmToday AlarmGetCurrentTimeInfo failed!!"); return STATUS_TIME_FUN_ERROR; } + + SetAlarm(ALARM_A, 0,255, 255); - for (node = g_alarmTodayList.begin(); node != g_alarmTodayList.end();) { + for (node = g_alarmTodayList.begin(); node != g_alarmTodayList.end();) + { tempNode = node; tempNode++; if (tempType == TYPE_CUR_NODE_SKIP) { // 第一个闹钟如果已响应直接跳过并删除,有连续相同闹铃时间则连续跳过并删除 @@ -391,17 +394,18 @@ static int32 SetFirstAlarmToday(FirstAlarmTodaySetType type) continue; } - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "alarmTime : %lx!!", node->alarmTime); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "curTime: hour %ld, min %ld!!", curTime.tm_hour, curTime.tm_min); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "alarmTime : %lx!!", node->alarmTime); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "curTime: hour %ld, min %ld!!", curTime.tm_hour, curTime.tm_min); if (((node->alarmTime >> TWO_BYTES_BITS == (uint32)curTime.tm_hour) && ((node->alarmTime & AND_FOR_LOW_TWO_BYTES) > (uint32)curTime.tm_min)) || node->alarmTime >> TWO_BYTES_BITS > (uint32)curTime.tm_hour) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "alarmTime > curTime!!"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "alarmTime > curTime!!"); SetAlarm(ALARM_A, 0, node->alarmTime >> TWO_BYTES_BITS, node->alarmTime & AND_FOR_LOW_TWO_BYTES); break; } else { // 已过期的直接删除 - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "alarmTime <= curTime!!"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "alarmTime <= curTime!!"); + g_alarmTodayList.erase(node); } node++; -- 2.17.1