diff options
author | Joey Castillo <jose.castillo@gmail.com> | 2021-08-02 13:48:35 -0400 |
---|---|---|
committer | Joey Castillo <jose.castillo@gmail.com> | 2021-08-02 14:36:04 -0400 |
commit | 34945d78e933fc62bedcc975e88be02a0b7fcc2e (patch) | |
tree | 317edc18fe08d76a1f5d8c3aabf88cf58ba73897 /Smol Watch Project/My Project/main.c | |
parent | 2d1e2e8c76623543817f4c62b26fc300c1fd0d2c (diff) | |
download | Sensor-Watch-34945d78e933fc62bedcc975e88be02a0b7fcc2e.tar.gz Sensor-Watch-34945d78e933fc62bedcc975e88be02a0b7fcc2e.tar.bz2 Sensor-Watch-34945d78e933fc62bedcc975e88be02a0b7fcc2e.zip |
major project reorg, move library one level up
Diffstat (limited to 'Smol Watch Project/My Project/main.c')
-rw-r--r-- | Smol Watch Project/My Project/main.c | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/Smol Watch Project/My Project/main.c b/Smol Watch Project/My Project/main.c deleted file mode 100644 index 53ccda95..00000000 --- a/Smol Watch Project/My Project/main.c +++ /dev/null @@ -1,72 +0,0 @@ -#include <atmel_start.h> -#include <hpl_sleep.h> -#include "watch-library/watch.h" -#include "mars_clock.h" - -bool local = true; - -void calendar_callback(struct calendar_descriptor *const calendar) { -} - -static void mode_callback() { - local = !local; -} - -static void light_callback() { - struct calendar_date_time date_time; - calendar_get_date_time(&CALENDAR_0, &date_time); - date_time.time.min = (date_time.time.min + 1) % 60; - watch_set_date_time(date_time); -} - -static void alarm_callback() { - struct calendar_date_time date_time; - calendar_get_date_time(&CALENDAR_0, &date_time); - date_time.time.sec = 0; - watch_set_date_time(date_time); -} - -static void tick_callback() { -} - -int main(void) -{ - atmel_start_init(); - - watch_init(); - - watch_enable_date_time(); - struct calendar_date_time date_time; - date_time.date.year = 2021; - date_time.date.month = 5; - date_time.date.day = 8; - date_time.time.hour = 19; - date_time.time.min = 40; - date_time.time.sec = 0; - watch_set_date_time(date_time); - update_display(date_time, local); - watch_enable_tick(tick_callback); - - watch_enable_led(); - - watch_enable_buttons(); - watch_register_button_callback(BTN_MODE, &mode_callback); - watch_register_button_callback(BTN_ALARM, &alarm_callback); - watch_register_button_callback(BTN_LIGHT, &light_callback); - - watch_enable_display(); - watch_display_pixel(1, 16); - - while (1) { - if (watch_can_enter_standby()) { - sleep(4); - } else { - sleep(2); - } - struct calendar_date_time date_time; - calendar_get_date_time(&CALENDAR_0, &date_time); - update_display(date_time, local); - } - - return 0; -} |