/* * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include "board/board.h" #include "util/time/time.h" #include #include //! @file alarm.h //! Allows a user to set an alarm for a given time in the future. When this time arrives, a //! PEBBLE_ALARM_CLOCK_EVENT event will be put. //! //! These alarm settings will be persisted across watch resets. #define SMART_ALARM_RANGE_S (30 * SECONDS_PER_MINUTE) #define SMART_ALARM_SNOOZE_DELAY_S (1 * SECONDS_PER_MINUTE) #define SMART_ALARM_MAX_LIGHT_SLEEP_S (30 * SECONDS_PER_MINUTE) #define SMART_ALARM_MAX_SMART_SNOOZE (SMART_ALARM_RANGE_S / SMART_ALARM_SNOOZE_DELAY_S) #define ALARMS_APP_HIGHLIGHT_COLOR PBL_IF_COLOR_ELSE(GColorJaegerGreen, GColorBlack) typedef int AlarmId; //! A unique ID that can be used to refer to each configured alarm. #define ALARM_INVALID_ID (-1) typedef enum AlarmKind { ALARM_KIND_EVERYDAY = 0, // Alarms of this type will happen each day ALARM_KIND_WEEKENDS, // Alarms of this type will happen Monday - Friday ALARM_KIND_WEEKDAYS, // Alarms of this type happen Saturaday and Sunday ALARM_KIND_JUST_ONCE, // Alarms of this type will happen next time the specified time occurs ALARM_KIND_CUSTOM, // Alarms of this type happen on specified days } AlarmKind; typedef enum AlarmType { AlarmType_Basic, AlarmType_Smart, AlarmTypeCount, } AlarmType; typedef struct AlarmInfo { int hour; //