AlarmID_t TimeAlarmsClass::timerOnce(const int H, const int M, const int S, OnTick_t onTickHandler){ // As above with HMS arguments return create( AlarmHMS(H,M,S), onTickHandler, IS_ONESHOT, dtTimer ); }
AlarmID_t TimeAlarmsClass::timerRepeat(const int H, const int M, const int S, OnTick_t onTickHandler){ // trigger after the given number of seconds continuously return create( AlarmHMS(H,M,S), onTickHandler, IS_REPEAT, dtTimer); }
AlarmID_t TimeAlarmsClass::alarmRepeat(const int H, const int M, const int S, OnTick_t onTickHandler){ // as above with HMS arguments return create( AlarmHMS(H,M,S), onTickHandler, IS_REPEAT, dtDailyAlarm ); }
AlarmID_t TimeAlarmsClass::alarmRepeat(const timeDayOfWeek_t DOW, const int H, const int M, const int S, OnTick_t onTickHandler){ // as above, with day of week return create( (DOW-1) * SECS_PER_DAY + AlarmHMS(H,M,S), onTickHandler, IS_REPEAT, dtWeeklyAlarm ); }
AlarmID_t TimeAlarmsClass::alarmOnce(const timeDayOfWeek_t DOW, const int H, const int M, const int S, OnTick_t onTickHandler){ // as above, with day of week unsigned long dayOffset = ( 7 + DOW - dayOfWeek(now())) %7; return create( (dayOffset * SECS_PER_DAY) + AlarmHMS(H,M,S), onTickHandler, IS_ALARM, IS_ONESHOT ); }
AlarmID_t TimeAlarmsClass::alarmOnce(const int H, const int M, const int S,OnTick_t onTickHandler){ // as above with HMS arguments return create( AlarmHMS(H,M,S), onTickHandler, IS_ALARM, IS_ONESHOT ); }
AlarmID_t TimeAlarmsClass::alarmOnce(const timeDayOfWeek_t DOW, const int H, const int M, const int S, OnTick_t onTickHandler, void *onTickArgs){ // as above, with day of week return create( (DOW-1) * SECS_PER_DAY + AlarmHMS(H,M,S), onTickHandler, onTickArgs, IS_ONESHOT, dtWeeklyAlarm ); }
AlarmID_t TimeAlarmsClass::alarmOnce(const int H, const int M, const int S,OnTick_t onTickHandler, void *onTickArgs){ // as above with HMS arguments return create( AlarmHMS(H,M,S), onTickHandler, onTickArgs, IS_ONESHOT, dtDailyAlarm ); }
return dtINVALID_ALARM_ID; // dont't allocate if the time is greater than one day