-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathalarms.h
60 lines (54 loc) · 1.28 KB
/
alarms.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//
// alarms.h
// alarms++
//
// Created by Christian Reinbacher on 01.11.14.
//
//
#ifndef alarms___alarms_h
#define alarms___alarms_h
#include <pebble.h>
#ifdef PBL_PLATFORM_APLITE
#define NUM_ALARMS 24
#define DESCRIPTION_LENGTH 9
typedef struct Alarm{
unsigned char hour;
unsigned char minute;
bool weekdays_active[7];
bool enabled;
WakeupId alarm_id;
char description[DESCRIPTION_LENGTH+1];
}Alarm;
#else
#define NUM_ALARMS 32
#define DESCRIPTION_LENGTH 19
typedef struct Alarm_old{
unsigned char hour;
unsigned char minute;
bool weekdays_active[7];
bool enabled;
WakeupId alarm_id;
char description[10];
}Alarm_old;
typedef struct Alarm{
unsigned char hour;
unsigned char minute;
bool enabled;
unsigned char smart_alarm_minutes;
WakeupId alarm_id;
bool weekdays_active[7];
char description[DESCRIPTION_LENGTH+1];
}Alarm;
#endif
void alarm_toggle_enable(Alarm *alarm);
time_t alarm_get_time_of_wakeup(Alarm *alarm);
void alarm_reset(Alarm *alarm);
void reschedule_wakeup(Alarm *alarms);
void convert_24_to_12(int hour_int, int* hour_out, bool* am);
bool alarm_is_one_time(Alarm *alarm);
bool alarm_is_set(Alarm *alarm);
bool alarm_has_description(Alarm *alarm);
int8_t get_next_free_slot(Alarm *alarms);
bool is_24h();
int get_next_alarm(Alarm *alarms);
#endif