#define SEDENTARY_TIME_RANGE (((curTime.tm_hour > sedentary_start_hour) || (curTime.tm_hour == sedentary_start_hour && curTime.tm_min >= sedentary_start_min)) && \\r
((curTime.tm_hour < sedentary_stop_hour) || (curTime.tm_hour == sedentary_stop_hour && curTime.tm_min < sedentary_stop_min)))\r
\r
-#define DRINKREMIND_TIME_RANGE (((curTime.tm_hour > drinkreminder_start_hour) || (curTime.tm_hour == drinkreminder_start_hour && curTime.tm_min >= drinkreminder_start_min)) && \\r
- ((curTime.tm_hour < drinkreminder_end_hour) || (curTime.tm_hour == drinkreminder_end_hour && curTime.tm_min < drinkreminder_end_min)))\r
+#define DRINKREMIND_TIME_RANGE ((((curTime.tm_hour > drinkreminder_start_hour && curTime.tm_hour < 24) || (curTime.tm_hour == drinkreminder_start_hour && curTime.tm_min >= drinkreminder_start_min)) && \\r
+ ((curTime.tm_hour < drinkreminder_end_hour && curTime.tm_hour >= 0) || (curTime.tm_hour == drinkreminder_end_hour && curTime.tm_min < drinkreminder_end_min))) || \\r
+ ((curTime.tm_hour >= 0 && curTime.tm_hour < drinkreminder_end_hour) || (curTime.tm_hour == drinkreminder_end_hour && curTime.tm_min < drinkreminder_end_min)) && \\r
+ ((curTime.tm_hour > drinkreminder_start_hour - 24 || (curTime.tm_hour == drinkreminder_start_hour - 24 && curTime.tm_min >= drinkreminder_start_min))))\r
\r
#define WAKE_TIME_RANGE (((wake_time_hour < sleep_time_hour) && \\r
((curTime.tm_hour > wake_time_hour) || \\r
// 判断当前时间是否在提醒时间段内\r
if (DRINKREMIND_TIME_RANGE)\r
{\r
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, " curTime.tm_sec = %d", curTime.tm_sec);\r
double interval_time = (drinkreminder_freq == 0) ? 0.5 : drinkreminder_freq; // 频率设置\r
int interval_time_seconds = static_cast<int>(interval_time * 60) * 60; // 设置的间隔时间秒数\r
int start_time_seconds = (drinkreminder_start_hour * 60 + drinkreminder_start_min) * 60; // 开始时间秒数\r
drinkremind_expectedTime = start_time_seconds + interval_time_seconds;\r
if (drinkremind_expectedTime >= hour_24_seconds)\r
{\r
- drinkremind_expectedTime = hour_24_seconds - drinkremind_expectedTime;\r
+ drinkremind_expectedTime = drinkremind_expectedTime - hour_24_seconds;\r
}\r
}\r
else\r