Add support for snoozing alarms

Also modified time_manager to pass time by value to time callbacks as
it's a fairly small struct and it will probably be more robust.
This commit is contained in:
2023-05-19 14:01:40 +01:00
parent 17704a5607
commit 9c9f027bb8
4 changed files with 108 additions and 33 deletions

View File

@@ -38,7 +38,7 @@ static void run_callbacks(void *arg)
{
const Time time = get_time();
for (unsigned i = 0; i < callback_count; ++i)
callbacks[i](&time);
callbacks[i](time);
}
static int time_command_func(int argc, char **argv)

View File

@@ -28,7 +28,7 @@ typedef enum {
WEEK_DAY_SUNDAY,
} WeekDay;
typedef void (*TimeCallback)(const Time *time);
typedef void (*TimeCallback)(Time now);
/**
* Initialize the time module.