]> git.karo-electronics.de Git - oswald.git/blobdiff - ui/oswald.h
Countless fixes and enhancements
[oswald.git] / ui / oswald.h
index c49acec24f7b33f4548b7e6b9210da25b78b06f2..f92651dedd9b0ae6cba3b6d353337a813179a101 100644 (file)
@@ -31,18 +31,20 @@ typedef struct {
        u8t     second;
        u8t     day;
        u8t     month;
-       u8t     year;
+       u16t    year;
+       boolean clk24hr;
+       boolean day_first;
 } clock_state;
 
 typedef enum {
        IDLE_SCREEN = 0,
        ACCEL_DISPLAY_SCREEN,
-       DATETIME_SETTING_SCREEN,
        MENU_TEST_SCREEN,
 //     SCREEN2_SCREEN,
 //     SCREEN3_SCREEN,
 //     APPLICATION_SCREEN,
        LAST_SCREEN,            // a marker for the last (not valid) screen)
+       DATETIME_SETTING_SCREEN,
 } screen_number;
 
 typedef enum {
@@ -56,30 +58,32 @@ typedef enum {
 
 #define EVENT_SCREEN_VISIBLE           (1<<0)          // screen just became visible
 #define EVENT_SCREEN_DESTROY           (1<<1)          // screen is destroyed
-#define EVENT_ONE_SEC_TIMER            (1<<2)
-#define EVENT_MS_TIMER                 (1<<3)
-#define EVENT_USER_BUTTONS             (1<<4)
-#define EVENT_ACCEL_UPDATE             (1<<5)
-#define EVENT_AMBIENTLIGHT_UPDATE      (1<<6)
-#define EVENT_POWER_CHANGE             (1<<7)
-#define EVENT_COMMS                    (1<<8)
+#define EVENT_ONE_SEC_TIMER            (1<<2)          // one second timer for reguler clock
+#define EVENT_HALF_SEC_TIMER           (1<<3)          // half second timer for blinking displays
+#define EVENT_CS_TIMER                 (1<<4)          // centisecond timer, e.g. for stop watch
+#define EVENT_USER_BUTTONS             (1<<5)          // button presses
+#define EVENT_ACCEL_UPDATE             (1<<6)          // accelerometer updates
+#define EVENT_AMBIENTLIGHT_UPDATE      (1<<7)          // ambient light sensor updates
+#define EVENT_POWER_CHANGE             (1<<8)          // power source status change
+#define EVENT_COMMS                    (1<<9)          // communication, like Bluetooth I/O
 
 typedef struct {
        u16t event_mask;                                // the event the screen wants to receive
        void (*event_func)(u16t event, void *data);     // callback for events
-//     void (*button_func)(watch_button button);       // handles button presses
-//     void (*screendraw_func)(void);                  // callback for screen update
-//     void *user_data;
+       void *user_data;
 } watch_screen;
 
 typedef struct {
        screen_number   screen_id;
-       // void (*draw_watchface_func)(boolean show_seconds);
-       boolean idle_show_seconds;
        watch_screen *screen;           // the current screen
-       // void (*user_button_func)(watch_button button);
-       // void (*user_screendraw_func)(void);
+       boolean pending_idle;
 } watch_state;
 
+typedef struct {
+       u8t     x;
+       u8t     y;
+       u8t     z;
+} accel_data_t;
+
 #endif