Browse code

Fix bt icon, restyle about screen, remove enter hint in alarm fired screen

Dario Rodriguez authored on 10/01/2014 22:59:59
Showing 1 changed files
... ...
@@ -4,7 +4,7 @@
4 4
 #include <string.h>
5 5
 #include <stdint.h>
6 6
 
7
-#define OSWALD_VERSION "0.3antartica1"
7
+#define OSWALD_VERSION "v0.3antartica1"
8 8
 
9 9
 //#define DEBUG 1
10 10
 #ifdef DEBUG
Browse code

Enable 4 alarms, fix alarm UI, implement a rough version of the main menu

Dario Rodriguez authored on 08/01/2014 22:59:59
Showing 1 changed files
... ...
@@ -4,7 +4,7 @@
4 4
 #include <string.h>
5 5
 #include <stdint.h>
6 6
 
7
-#define OSWALD_VERSION "v0.3"
7
+#define OSWALD_VERSION "0.3antartica1"
8 8
 
9 9
 //#define DEBUG 1
10 10
 #ifdef DEBUG
Browse code

Replace font handling, add new watch face, add calendar. More watchfaces, make calendar interactive and start rearranging button functions

Dario Rodriguez authored on 17/12/2013 22:59:59
Showing 1 changed files
... ...
@@ -66,6 +66,7 @@ typedef enum {
66 66
 	APPLICATION_SCREEN,
67 67
 	DATETIME_SETTING_SCREEN,
68 68
 	ALARM_SCREEN,
69
+	CALENDAR_OVERVIEW_SCREEN,
69 70
 	SCREENS_END,
70 71
 } screen_number;
71 72
 
Browse code

Power saving changes, add new fonts, bitmaps and screens

Nils Faerber authored on 19/05/2013 00:07:04
Showing 1 changed files
... ...
@@ -53,12 +53,15 @@ typedef struct {
53 53
 
54 54
 typedef enum {
55 55
 	IDLE_SCREEN = 0,
56
+	MAIN_MENU_SCREEN,
56 57
 	ALARM_SETUP_SCREEN,
57 58
 	STOP_WATCH_SCREEN,
58 59
 	BLUETOOTH_SCREEN,
59 60
 	ACCEL_DISPLAY_SCREEN,
61
+	MESSAGES_SCREEN,
60 62
 	INFO_SCREEN,
61 63
 	LAST_SCREEN,		// a marker for the last (not valid) screen)
64
+	MESSAGE_SCREEN,
62 65
 	MENU_TEST_SCREEN,
63 66
 	APPLICATION_SCREEN,
64 67
 	DATETIME_SETTING_SCREEN,
Browse code

Add version information and info screen, some more work on the accel screen

Nils Faerber authored on 05/05/2013 01:54:24
Showing 1 changed files
... ...
@@ -4,6 +4,8 @@
4 4
 #include <string.h>
5 5
 #include <stdint.h>
6 6
 
7
+#define OSWALD_VERSION "v0.3"
8
+
7 9
 //#define DEBUG 1
8 10
 #ifdef DEBUG
9 11
 #define dbg_out( args... ) fprintf(stderr, args)
... ...
@@ -55,9 +57,10 @@ typedef enum {
55 57
 	STOP_WATCH_SCREEN,
56 58
 	BLUETOOTH_SCREEN,
57 59
 	ACCEL_DISPLAY_SCREEN,
58
-	MENU_TEST_SCREEN,
59
-//	APPLICATION_SCREEN,
60
+	INFO_SCREEN,
60 61
 	LAST_SCREEN,		// a marker for the last (not valid) screen)
62
+	MENU_TEST_SCREEN,
63
+	APPLICATION_SCREEN,
61 64
 	DATETIME_SETTING_SCREEN,
62 65
 	ALARM_SCREEN,
63 66
 	SCREENS_END,
... ...
@@ -103,9 +106,9 @@ typedef struct {
103 106
 } watch_state;
104 107
 
105 108
 typedef struct {
106
-	uint8_t	x;
107
-	uint8_t	y;
108
-	uint8_t	z;
109
+	int8_t	x;
110
+	int8_t	y;
111
+	int8_t	z;
109 112
 } accel_data_t;
110 113
 
111 114
 #define POWER_SOURCE_BATTERY	0
Browse code

Rework font code, add new fonts, also proportional, rework watch usage - "SET" button now enters settings mode

Nils Faerber authored on 04/05/2013 19:23:25
Showing 1 changed files
... ...
@@ -11,11 +11,7 @@
11 11
 #define dbg_out( args... ) do {} while (0)
12 12
 #endif
13 13
 
14
-typedef signed char s8t;
15
-typedef unsigned char u8t;
16
-typedef signed short s16t;
17
-typedef unsigned short u16t;
18
-typedef u8t boolean;
14
+typedef uint8_t boolean;
19 15
 #ifdef TRUE
20 16
 #undef TRUE
21 17
 #endif
... ...
@@ -29,13 +25,13 @@ typedef u8t boolean;
29 25
 #endif
30 26
 
31 27
 typedef struct {
32
-	u8t	hour;
33
-	u8t	minute;
34
-	u8t	second;
35
-	u8t	day;
36
-	u8t	wday; // day in week, 0=sunday, 1=monday,...
37
-	u8t	month;
38
-	u16t	year;
28
+	uint8_t	hour;
29
+	uint8_t	minute;
30
+	uint8_t	second;
31
+	uint8_t	day;
32
+	uint8_t	wday; // day in week, 0=sunday, 1=monday,...
33
+	uint8_t	month;
34
+	uint16_t	year;
39 35
 	boolean	clk24hr;
40 36
 	boolean day_first;
41 37
 } clock_state;
... ...
@@ -48,9 +44,9 @@ typedef struct {
48 44
 #define WDAY_FRIDAY	(1 << 5)
49 45
 #define WDAY_SATURDAY	(1 << 6)
50 46
 typedef struct {
51
-	u8t	hour;
52
-	u8t	minute;
53
-	u8t	wday; // bitfield 0 to 6, 1=sunday, 2=monday, 4=tuesday...
47
+	uint8_t	hour;
48
+	uint8_t	minute;
49
+	uint8_t	wday; // bitfield 0 to 6, 1=sunday, 2=monday, 4=tuesday...
54 50
 } alarm_clk;
55 51
 
56 52
 typedef enum {
... ...
@@ -88,10 +84,15 @@ typedef enum {
88 84
 #define EVENT_COMMS			(1<<9)		// communication, like Bluetooth I/O
89 85
 #define EVENT_POWER_STATE		(1<<10)		// power source changed or similar
90 86
 
87
+typedef enum {
88
+	EVENT_RET_UNHANDLED = 0,
89
+	EVENT_RET_HANDLED,
90
+	EVENT_RET_ERR
91
+} event_ret_t;
91 92
 
92 93
 typedef struct {
93
-	u16t event_mask;				// the event the screen wants to receive
94
-	void (*event_func)(u16t event, void *data);	// callback for events
94
+	uint16_t event_mask;				// the event the screen wants to receive
95
+	event_ret_t (*event_func)(uint16_t event, void *data);	// callback for events
95 96
 	void *user_data;
96 97
 } watch_screen;
97 98
 
... ...
@@ -102,9 +103,9 @@ typedef struct {
102 103
 } watch_state;
103 104
 
104 105
 typedef struct {
105
-	u8t	x;
106
-	u8t	y;
107
-	u8t	z;
106
+	uint8_t	x;
107
+	uint8_t	y;
108
+	uint8_t	z;
108 109
 } accel_data_t;
109 110
 
110 111
 #define POWER_SOURCE_BATTERY	0
... ...
@@ -116,10 +117,10 @@ typedef struct {
116 117
 #define POWER_CHARGER_UNK	3
117 118
 
118 119
 typedef struct {
119
-	u8t	source;
120
-	u8t	charge_state;
121
-	u8t	percent;
122
-	u16t	level;
120
+	uint8_t	source;
121
+	uint8_t	charge_state;
122
+	uint8_t	percent;
123
+	uint16_t	level;
123 124
 } power_state;
124 125
 
125 126
 typedef enum {
Browse code

Bluetooth handling, screen reworks for icons

Nils Faerber authored on 21/04/2013 23:10:13
Showing 1 changed files
... ...
@@ -1,5 +1,7 @@
1 1
 #ifndef _OSWALD_H
2 2
 #define _OSWALD_H
3
+#include <stdio.h>
4
+#include <string.h>
3 5
 #include <stdint.h>
4 6
 
5 7
 //#define DEBUG 1
... ...
@@ -55,6 +57,7 @@ typedef enum {
55 57
 	IDLE_SCREEN = 0,
56 58
 	ALARM_SETUP_SCREEN,
57 59
 	STOP_WATCH_SCREEN,
60
+	BLUETOOTH_SCREEN,
58 61
 	ACCEL_DISPLAY_SCREEN,
59 62
 	MENU_TEST_SCREEN,
60 63
 //	APPLICATION_SCREEN,
Browse code

Oh boy... lots of changes, too many to describe

Nils Faerber authored on 21/04/2013 14:26:38
Showing 1 changed files
... ...
@@ -1,5 +1,6 @@
1 1
 #ifndef _OSWALD_H
2 2
 #define _OSWALD_H
3
+#include <stdint.h>
3 4
 
4 5
 //#define DEBUG 1
5 6
 #ifdef DEBUG
... ...
@@ -30,20 +31,36 @@ typedef struct {
30 31
 	u8t	minute;
31 32
 	u8t	second;
32 33
 	u8t	day;
34
+	u8t	wday; // day in week, 0=sunday, 1=monday,...
33 35
 	u8t	month;
34 36
 	u16t	year;
35 37
 	boolean	clk24hr;
36 38
 	boolean day_first;
37 39
 } clock_state;
38 40
 
41
+#define WDAY_SUNDAY	(1 << 0)
42
+#define WDAY_MONDAY	(1 << 1)
43
+#define WDAY_TUESDAY	(1 << 2)
44
+#define WDAY_WEDNESDAY	(1 << 3)
45
+#define WDAY_THURSDAY	(1 << 4)
46
+#define WDAY_FRIDAY	(1 << 5)
47
+#define WDAY_SATURDAY	(1 << 6)
48
+typedef struct {
49
+	u8t	hour;
50
+	u8t	minute;
51
+	u8t	wday; // bitfield 0 to 6, 1=sunday, 2=monday, 4=tuesday...
52
+} alarm_clk;
53
+
39 54
 typedef enum {
40 55
 	IDLE_SCREEN = 0,
56
+	ALARM_SETUP_SCREEN,
57
+	STOP_WATCH_SCREEN,
41 58
 	ACCEL_DISPLAY_SCREEN,
42 59
 	MENU_TEST_SCREEN,
43
-	STOP_WATCH_SCREEN,
44 60
 //	APPLICATION_SCREEN,
45 61
 	LAST_SCREEN,		// a marker for the last (not valid) screen)
46 62
 	DATETIME_SETTING_SCREEN,
63
+	ALARM_SCREEN,
47 64
 	SCREENS_END,
48 65
 } screen_number;
49 66
 
... ...
@@ -66,6 +83,8 @@ typedef enum {
66 83
 #define EVENT_AMBIENTLIGHT_UPDATE	(1<<7)		// ambient light sensor updates
67 84
 #define EVENT_POWER_CHANGE		(1<<8)		// power source status change
68 85
 #define EVENT_COMMS			(1<<9)		// communication, like Bluetooth I/O
86
+#define EVENT_POWER_STATE		(1<<10)		// power source changed or similar
87
+
69 88
 
70 89
 typedef struct {
71 90
 	u16t event_mask;				// the event the screen wants to receive
... ...
@@ -85,5 +104,26 @@ typedef struct {
85 104
 	u8t	z;
86 105
 } accel_data_t;
87 106
 
88
-#endif
107
+#define POWER_SOURCE_BATTERY	0
108
+#define POWER_SOURCE_EXTERNAL	1
109
+
110
+#define POWER_CHARGER_DONE	0
111
+#define POWER_CHARGER_PRECHARGE	1
112
+#define POWER_CHARGER_CHARGING	2
113
+#define POWER_CHARGER_UNK	3
114
+
115
+typedef struct {
116
+	u8t	source;
117
+	u8t	charge_state;
118
+	u8t	percent;
119
+	u16t	level;
120
+} power_state;
89 121
 
122
+typedef enum {
123
+	BLUETOOTH_OFF = 0,
124
+	BLUETOOTH_ON,
125
+	BLUETOOTH_CONNECTED,
126
+	BLUETOOTH_ILL
127
+} bluetooth_state;
128
+
129
+#endif
Browse code

Add fixes for it to work properly on microcontroller

Nils Faerber authored on 19/03/2013 19:22:58
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 #ifndef _OSWALD_H
2 2
 #define _OSWALD_H
3 3
 
4
-#define DEBUG 1
4
+//#define DEBUG 1
5 5
 #ifdef DEBUG
6 6
 #define dbg_out( args... ) fprintf(stderr, args)
7 7
 #else
... ...
@@ -40,11 +40,11 @@ typedef enum {
40 40
 	IDLE_SCREEN = 0,
41 41
 	ACCEL_DISPLAY_SCREEN,
42 42
 	MENU_TEST_SCREEN,
43
-//	SCREEN2_SCREEN,
44
-//	SCREEN3_SCREEN,
43
+	STOP_WATCH_SCREEN,
45 44
 //	APPLICATION_SCREEN,
46 45
 	LAST_SCREEN,		// a marker for the last (not valid) screen)
47 46
 	DATETIME_SETTING_SCREEN,
47
+	SCREENS_END,
48 48
 } screen_number;
49 49
 
50 50
 typedef enum {
Browse code

Countless fixes and enhancements

Nils Faerber authored on 12/08/2012 21:14:19
Showing 1 changed files
... ...
@@ -31,18 +31,20 @@ typedef struct {
31 31
 	u8t	second;
32 32
 	u8t	day;
33 33
 	u8t	month;
34
-	u8t	year;
34
+	u16t	year;
35
+	boolean	clk24hr;
36
+	boolean day_first;
35 37
 } clock_state;
36 38
 
37 39
 typedef enum {
38 40
 	IDLE_SCREEN = 0,
39 41
 	ACCEL_DISPLAY_SCREEN,
40
-	DATETIME_SETTING_SCREEN,
41 42
 	MENU_TEST_SCREEN,
42 43
 //	SCREEN2_SCREEN,
43 44
 //	SCREEN3_SCREEN,
44 45
 //	APPLICATION_SCREEN,
45 46
 	LAST_SCREEN,		// a marker for the last (not valid) screen)
47
+	DATETIME_SETTING_SCREEN,
46 48
 } screen_number;
47 49
 
48 50
 typedef enum {
... ...
@@ -56,13 +58,14 @@ typedef enum {
56 58
 
57 59
 #define EVENT_SCREEN_VISIBLE		(1<<0)		// screen just became visible
58 60
 #define EVENT_SCREEN_DESTROY		(1<<1)		// screen is destroyed
59
-#define EVENT_ONE_SEC_TIMER		(1<<2)
60
-#define EVENT_MS_TIMER			(1<<3)
61
-#define EVENT_USER_BUTTONS		(1<<4)
62
-#define EVENT_ACCEL_UPDATE		(1<<5)
63
-#define EVENT_AMBIENTLIGHT_UPDATE	(1<<6)
64
-#define EVENT_POWER_CHANGE		(1<<7)
65
-#define EVENT_COMMS			(1<<8)
61
+#define EVENT_ONE_SEC_TIMER		(1<<2)		// one second timer for reguler clock
62
+#define EVENT_HALF_SEC_TIMER		(1<<3)		// half second timer for blinking displays
63
+#define EVENT_CS_TIMER			(1<<4)		// centisecond timer, e.g. for stop watch
64
+#define EVENT_USER_BUTTONS		(1<<5)		// button presses
65
+#define EVENT_ACCEL_UPDATE		(1<<6)		// accelerometer updates
66
+#define EVENT_AMBIENTLIGHT_UPDATE	(1<<7)		// ambient light sensor updates
67
+#define EVENT_POWER_CHANGE		(1<<8)		// power source status change
68
+#define EVENT_COMMS			(1<<9)		// communication, like Bluetooth I/O
66 69
 
67 70
 typedef struct {
68 71
 	u16t event_mask;				// the event the screen wants to receive
... ...
@@ -76,5 +79,11 @@ typedef struct {
76 79
 	boolean pending_idle;
77 80
 } watch_state;
78 81
 
82
+typedef struct {
83
+	u8t	x;
84
+	u8t	y;
85
+	u8t	z;
86
+} accel_data_t;
87
+
79 88
 #endif
80 89
 
Browse code

Make idle selectable

Nils Faerber authored on 12/08/2012 02:11:30
Showing 1 changed files
... ...
@@ -67,18 +67,13 @@ typedef enum {
67 67
 typedef struct {
68 68
 	u16t event_mask;				// the event the screen wants to receive
69 69
 	void (*event_func)(u16t event, void *data);	// callback for events
70
-//	void (*button_func)(watch_button button);	// handles button presses
71
-//	void (*screendraw_func)(void);			// callback for screen update
72
-//	void *user_data;
70
+	void *user_data;
73 71
 } watch_screen;
74 72
 
75 73
 typedef struct {
76 74
 	screen_number	screen_id;
77
-	// void (*draw_watchface_func)(boolean show_seconds);
78
-	boolean idle_show_seconds;
79 75
 	watch_screen *screen;		// the current screen
80
-	// void (*user_button_func)(watch_button button);
81
-	// void (*user_screendraw_func)(void);
76
+	boolean pending_idle;
82 77
 } watch_state;
83 78
 
84 79
 #endif
Browse code

Redesign to an event based handling

Nils Faerber authored on 07/08/2012 22:09:29
Showing 1 changed files
... ...
@@ -1,6 +1,13 @@
1 1
 #ifndef _OSWALD_H
2 2
 #define _OSWALD_H
3 3
 
4
+#define DEBUG 1
5
+#ifdef DEBUG
6
+#define dbg_out( args... ) fprintf(stderr, args)
7
+#else
8
+#define dbg_out( args... ) do {} while (0)
9
+#endif
10
+
4 11
 typedef signed char s8t;
5 12
 typedef unsigned char u8t;
6 13
 typedef signed short s16t;
... ...
@@ -29,7 +36,9 @@ typedef struct {
29 36
 
30 37
 typedef enum {
31 38
 	IDLE_SCREEN = 0,
32
-	SETTING_DATETIME_SCREEN,
39
+	ACCEL_DISPLAY_SCREEN,
40
+	DATETIME_SETTING_SCREEN,
41
+	MENU_TEST_SCREEN,
33 42
 //	SCREEN2_SCREEN,
34 43
 //	SCREEN3_SCREEN,
35 44
 //	APPLICATION_SCREEN,
... ...
@@ -45,16 +54,31 @@ typedef enum {
45 54
 	BUTTON_F,
46 55
 } watch_button;
47 56
 
57
+#define EVENT_SCREEN_VISIBLE		(1<<0)		// screen just became visible
58
+#define EVENT_SCREEN_DESTROY		(1<<1)		// screen is destroyed
59
+#define EVENT_ONE_SEC_TIMER		(1<<2)
60
+#define EVENT_MS_TIMER			(1<<3)
61
+#define EVENT_USER_BUTTONS		(1<<4)
62
+#define EVENT_ACCEL_UPDATE		(1<<5)
63
+#define EVENT_AMBIENTLIGHT_UPDATE	(1<<6)
64
+#define EVENT_POWER_CHANGE		(1<<7)
65
+#define EVENT_COMMS			(1<<8)
66
+
48 67
 typedef struct {
49
-	void (*button_func)(watch_button button);
68
+	u16t event_mask;				// the event the screen wants to receive
69
+	void (*event_func)(u16t event, void *data);	// callback for events
70
+//	void (*button_func)(watch_button button);	// handles button presses
71
+//	void (*screendraw_func)(void);			// callback for screen update
72
+//	void *user_data;
50 73
 } watch_screen;
51 74
 
52 75
 typedef struct {
53
-	screen_number	screen;
76
+	screen_number	screen_id;
54 77
 	// void (*draw_watchface_func)(boolean show_seconds);
55 78
 	boolean idle_show_seconds;
56
-	void (*user_button_func)(watch_button button);
57
-	void (*user_screendraw_func)(void);
79
+	watch_screen *screen;		// the current screen
80
+	// void (*user_button_func)(watch_button button);
81
+	// void (*user_screendraw_func)(void);
58 82
 } watch_state;
59 83
 
60 84
 #endif
Browse code

Add support for more screens

Nils Faerber authored on 06/08/2012 14:12:20
Showing 1 changed files
... ...
@@ -3,6 +3,8 @@
3 3
 
4 4
 typedef signed char s8t;
5 5
 typedef unsigned char u8t;
6
+typedef signed short s16t;
7
+typedef unsigned short u16t;
6 8
 typedef u8t boolean;
7 9
 #ifdef TRUE
8 10
 #undef TRUE
... ...
@@ -27,7 +29,11 @@ typedef struct {
27 29
 
28 30
 typedef enum {
29 31
 	IDLE_SCREEN = 0,
30
-	APPLICATION_SCREEN,
32
+	SETTING_DATETIME_SCREEN,
33
+//	SCREEN2_SCREEN,
34
+//	SCREEN3_SCREEN,
35
+//	APPLICATION_SCREEN,
36
+	LAST_SCREEN,		// a marker for the last (not valid) screen)
31 37
 } screen_number;
32 38
 
33 39
 typedef enum {
... ...
@@ -39,12 +45,17 @@ typedef enum {
39 45
 	BUTTON_F,
40 46
 } watch_button;
41 47
 
48
+typedef struct {
49
+	void (*button_func)(watch_button button);
50
+} watch_screen;
51
+
42 52
 typedef struct {
43 53
 	screen_number	screen;
44
-	void (*idle_draw_func)(boolean show_seconds);
54
+	// void (*draw_watchface_func)(boolean show_seconds);
45 55
 	boolean idle_show_seconds;
56
+	void (*user_button_func)(watch_button button);
57
+	void (*user_screendraw_func)(void);
46 58
 } watch_state;
47 59
 
48
-
49 60
 #endif
50 61
 
Browse code

Too much to note...

Nils Faerber authored on 05/08/2012 17:07:17
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,50 @@
1
+#ifndef _OSWALD_H
2
+#define _OSWALD_H
3
+
4
+typedef signed char s8t;
5
+typedef unsigned char u8t;
6
+typedef u8t boolean;
7
+#ifdef TRUE
8
+#undef TRUE
9
+#endif
10
+#define TRUE 1
11
+#ifdef FALSE
12
+#undef FALSE
13
+#endif
14
+#define FALSE 0
15
+#ifndef NULL
16
+#define NULL 0
17
+#endif
18
+
19
+typedef struct {
20
+	u8t	hour;
21
+	u8t	minute;
22
+	u8t	second;
23
+	u8t	day;
24
+	u8t	month;
25
+	u8t	year;
26
+} clock_state;
27
+
28
+typedef enum {
29
+	IDLE_SCREEN = 0,
30
+	APPLICATION_SCREEN,
31
+} screen_number;
32
+
33
+typedef enum {
34
+	BUTTON_A = 0,
35
+	BUTTON_B,
36
+	BUTTON_C,
37
+	BUTTON_D,
38
+	BUTTON_E,
39
+	BUTTON_F,
40
+} watch_button;
41
+
42
+typedef struct {
43
+	screen_number	screen;
44
+	void (*idle_draw_func)(boolean show_seconds);
45
+	boolean idle_show_seconds;
46
+} watch_state;
47
+
48
+
49
+#endif
50
+