Browse code

Use strutils instead of snprintf (to save some bytes), set default year to 2014, partial revamp of the stopwatch

Dario Rodriguez authored on 14/01/2014 22:59:59
Showing 1 changed files
... ...
@@ -33,7 +33,7 @@ OSWALD_SRC = ../ui/oswald_main.c ../ui/oswald_screens.c \
33 33
 	../ui/oswald_watch_faces.c \
34 34
 	../ui/oswald_strings.c ../ui/calendar.c \
35 35
 	../ui/oswald_graphics.c ../ui/oswald_fonts.c \
36
-	../ui/embedvm.c ../ui/dayslib.c
36
+	../ui/embedvm.c ../ui/dayslib.c ../ui/mymem.c ../ui/strutils.c
37 37
 
38 38
 SOURCES = mw_main.c mw_uart.c mw_lcd.c mw_adc.c mw_bt.c \
39 39
 	mw_acc.c $(BTCC256x_SCRIPT) \
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
... ...
@@ -33,7 +33,7 @@ OSWALD_SRC = ../ui/oswald_main.c ../ui/oswald_screens.c \
33 33
 	../ui/oswald_watch_faces.c \
34 34
 	../ui/oswald_strings.c ../ui/calendar.c \
35 35
 	../ui/oswald_graphics.c ../ui/oswald_fonts.c \
36
-	../ui/embedvm.c
36
+	../ui/embedvm.c ../ui/dayslib.c
37 37
 
38 38
 SOURCES = mw_main.c mw_uart.c mw_lcd.c mw_adc.c mw_bt.c \
39 39
 	mw_acc.c $(BTCC256x_SCRIPT) \
Browse code

Configure Makefile for the WDS112 (original digital metawatch)

Dario Rodriguez authored on 23/07/2013 21:59:59
Showing 1 changed files
... ...
@@ -23,8 +23,8 @@ MEMMODEL   = -mmemory-model=huge -fdata-sections -ffunction-sections # -mdata-re
23 23
 #APPCONFIG = -DDIGITAL -DMW_DIGITAL_V2 -DMW_DEBUG_UART
24 24
 APPCONFIG = -DDIGITAL -DMW_DIGITAL_V2
25 25
 
26
-#BTCC256x_SCRIPT = bluetooth_init_cc2560_2.44.c
27
-BTCC256x_SCRIPT = bluetooth_init_cc2564_2.8.c
26
+BTCC256x_SCRIPT = bluetooth_init_cc2560_2.44.c
27
+#BTCC256x_SCRIPT = bluetooth_init_cc2564_2.8.c
28 28
 
29 29
 # List all the source files here
30 30
 # eg if you have a source file foo.c then list it here
Browse code

Add option for debug UART on regular watches

Nils Faerber authored on 06/07/2013 21:20:33
Showing 1 changed files
... ...
@@ -20,6 +20,7 @@ MEMMODEL   = -mmemory-model=huge -fdata-sections -ffunction-sections # -mdata-re
20 20
 #APPCONFIG = -DDIGITAL -DMW_DEVBOARD_V2
21 21
 #APPCONFIG = -DDIGITAL -DMW_DEVBOARD_V2 -DWITH_BTSTACK
22 22
 #APPCONFIG = -DDIGITAL -DMW_DEVBOARD_V2 -DCC256x_TRANSP
23
+#APPCONFIG = -DDIGITAL -DMW_DIGITAL_V2 -DMW_DEBUG_UART
23 24
 APPCONFIG = -DDIGITAL -DMW_DIGITAL_V2
24 25
 
25 26
 #BTCC256x_SCRIPT = bluetooth_init_cc2560_2.44.c
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
... ...
@@ -22,8 +22,8 @@ MEMMODEL   = -mmemory-model=huge -fdata-sections -ffunction-sections # -mdata-re
22 22
 #APPCONFIG = -DDIGITAL -DMW_DEVBOARD_V2 -DCC256x_TRANSP
23 23
 APPCONFIG = -DDIGITAL -DMW_DIGITAL_V2
24 24
 
25
-BTCC256x_SCRIPT = bluetooth_init_cc2560_2.44.c
26
-#BTCC256x_SCRIPT = bluetooth_init_cc2564_2.8.c
25
+#BTCC256x_SCRIPT = bluetooth_init_cc2560_2.44.c
26
+BTCC256x_SCRIPT = bluetooth_init_cc2564_2.8.c
27 27
 
28 28
 # List all the source files here
29 29
 # eg if you have a source file foo.c then list it here
... ...
@@ -37,7 +37,9 @@ OSWALD_SRC = ../ui/oswald_main.c ../ui/oswald_screens.c \
37 37
 SOURCES = mw_main.c mw_uart.c mw_lcd.c mw_adc.c mw_bt.c \
38 38
 	mw_acc.c $(BTCC256x_SCRIPT) \
39 39
 	bt_hci.c bt_l2cap.c \
40
-	oswald_hal.c $(OSWALD_SRC)
40
+	oswald_hal.c $(OSWALD_SRC) \
41
+	F5xx_F6xx_Core_Lib/HAL_PMM.c \
42
+	F5xx_F6xx_Core_Lib/HAL_UCS.c
41 43
 #	$(BT_SMALLTOOTH_SRC)
42 44
 #	$(BT_STACK_SRC) \
43 45
 
Browse code

Some documentation hints

Nils Faerber authored on 05/05/2013 16:55:42
Showing 1 changed files
... ...
@@ -17,17 +17,17 @@ MEMMODEL   = -mmemory-model=huge -fdata-sections -ffunction-sections # -mdata-re
17 17
 # MEMMODEL   = -mmemory-model=medium -misr20
18 18
 #MEMMODEL   = -mmemory-model=medium
19 19
 
20
-APPCONFIG = -DDIGITAL -DMW_DEVBOARD_V2
20
+#APPCONFIG = -DDIGITAL -DMW_DEVBOARD_V2
21 21
 #APPCONFIG = -DDIGITAL -DMW_DEVBOARD_V2 -DWITH_BTSTACK
22 22
 #APPCONFIG = -DDIGITAL -DMW_DEVBOARD_V2 -DCC256x_TRANSP
23
-#APPCONFIG = -DDIGITAL -DMW_DIGITAL_V2
24
-
25
-# List all the source files here
26
-# eg if you have a source file foo.c then list it here
23
+APPCONFIG = -DDIGITAL -DMW_DIGITAL_V2
27 24
 
28 25
 BTCC256x_SCRIPT = bluetooth_init_cc2560_2.44.c
29 26
 #BTCC256x_SCRIPT = bluetooth_init_cc2564_2.8.c
30 27
 
28
+# List all the source files here
29
+# eg if you have a source file foo.c then list it here
30
+
31 31
 OSWALD_SRC = ../ui/oswald_main.c ../ui/oswald_screens.c \
32 32
 	../ui/oswald_watch_faces.c \
33 33
 	../ui/oswald_strings.c ../ui/calendar.c \
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
... ...
@@ -17,10 +17,10 @@ MEMMODEL   = -mmemory-model=huge -fdata-sections -ffunction-sections # -mdata-re
17 17
 # MEMMODEL   = -mmemory-model=medium -misr20
18 18
 #MEMMODEL   = -mmemory-model=medium
19 19
 
20
-#APPCONFIG = -DDIGITAL -DMW_DEVBOARD_V2
20
+APPCONFIG = -DDIGITAL -DMW_DEVBOARD_V2
21 21
 #APPCONFIG = -DDIGITAL -DMW_DEVBOARD_V2 -DWITH_BTSTACK
22 22
 #APPCONFIG = -DDIGITAL -DMW_DEVBOARD_V2 -DCC256x_TRANSP
23
-APPCONFIG = -DDIGITAL -DMW_DIGITAL_V2
23
+#APPCONFIG = -DDIGITAL -DMW_DIGITAL_V2
24 24
 
25 25
 # List all the source files here
26 26
 # eg if you have a source file foo.c then list it here
... ...
@@ -48,9 +48,12 @@ SOURCES = mw_main.c mw_uart.c mw_lcd.c mw_adc.c mw_bt.c \
48 48
 #INCLUDES = $(BT_SMALLTOOTH_INV)
49 49
 INCLUDES = -I../ui/
50 50
 
51
+# BUILDNO = \"\#$(shell cat .buildno)-$(shell date +%y%m%d)\"
52
+BUILDNO = \"$(shell date +%y%m%d)-\#$(shell cat .buildno)\"
53
+
51 54
 # Add or subtract whatever MSPGCC flags you want. There are plenty more
52 55
 #######################################################################################
53
-CFLAGS   = -mmcu=$(MCU) $(MEMMODEL) -g -Os -Wall -Wunused $(INCLUDES) $(APPCONFIG)
56
+CFLAGS   = -mmcu=$(MCU) $(MEMMODEL) -g -Os -Wall -Wunused $(INCLUDES) $(APPCONFIG) -DBUILDNO=$(BUILDNO)
54 57
 ASFLAGS  = -mmcu=$(MCU) $(MEMMODEL) -x assembler-with-cpp -Wa,-gstabs
55 58
 LDFLAGS  = -mmcu=$(MCU) $(MEMMODEL) -Wl,-gc-sections -Wl,-Map=$(TARGET).map
56 59
 ########################################################################################
... ...
@@ -76,7 +79,7 @@ DEPEND = $(SOURCES:.c=.d)
76 79
 # all the object files
77 80
 OBJECTS = $(SOURCES:.c=.o)
78 81
 
79
-all: $(TARGET).elf $(TARGET).hex $(TARGET).txt 
82
+all: .buildno $(TARGET).elf $(TARGET).hex $(TARGET).txt
80 83
 
81 84
 prog: $(TARGET).hex
82 85
 	mspdebug tilib -d /dev/ttyACM3 -v 2500 "prog $(TARGET).hex"
... ...
@@ -126,3 +129,7 @@ clean:
126 129
 	-$(RM) $(TARGET).*
127 130
 	-$(RM) $(SOURCES:.c=.lst)
128 131
 	-$(RM) $(DEPEND)
132
+
133
+.buildno: $(OBJECTS)
134
+	@if ! test -f .buildno; then echo 0 > .buildno; fi
135
+	@echo $$(($$(cat .buildno) + 1)) > .buildno
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
... ...
@@ -17,13 +17,17 @@ MEMMODEL   = -mmemory-model=huge -fdata-sections -ffunction-sections # -mdata-re
17 17
 # MEMMODEL   = -mmemory-model=medium -misr20
18 18
 #MEMMODEL   = -mmemory-model=medium
19 19
 
20
-APPCONFIG = -DDIGITAL -DMW_DEVBOARD_V2
20
+#APPCONFIG = -DDIGITAL -DMW_DEVBOARD_V2
21 21
 #APPCONFIG = -DDIGITAL -DMW_DEVBOARD_V2 -DWITH_BTSTACK
22 22
 #APPCONFIG = -DDIGITAL -DMW_DEVBOARD_V2 -DCC256x_TRANSP
23
-#APPCONFIG = -DDIGITAL -DMW_DIGITAL_V2
23
+APPCONFIG = -DDIGITAL -DMW_DIGITAL_V2
24 24
 
25 25
 # List all the source files here
26 26
 # eg if you have a source file foo.c then list it here
27
+
28
+BTCC256x_SCRIPT = bluetooth_init_cc2560_2.44.c
29
+#BTCC256x_SCRIPT = bluetooth_init_cc2564_2.8.c
30
+
27 31
 OSWALD_SRC = ../ui/oswald_main.c ../ui/oswald_screens.c \
28 32
 	../ui/oswald_watch_faces.c \
29 33
 	../ui/oswald_strings.c ../ui/calendar.c \
... ...
@@ -31,7 +35,7 @@ OSWALD_SRC = ../ui/oswald_main.c ../ui/oswald_screens.c \
31 35
 	../ui/embedvm.c
32 36
 
33 37
 SOURCES = mw_main.c mw_uart.c mw_lcd.c mw_adc.c mw_bt.c \
34
-	bluetooth_init_cc2560_2.44.c \
38
+	mw_acc.c $(BTCC256x_SCRIPT) \
35 39
 	bt_hci.c bt_l2cap.c \
36 40
 	oswald_hal.c $(OSWALD_SRC)
37 41
 #	$(BT_SMALLTOOTH_SRC)
Browse code

Starting to get rid of borrowed code (LcdDisplay, Fonts), integrate new fonts and stuff

Nils Faerber authored on 28/04/2013 22:38:41
Showing 1 changed files
... ...
@@ -25,8 +25,9 @@ APPCONFIG = -DDIGITAL -DMW_DEVBOARD_V2
25 25
 # List all the source files here
26 26
 # eg if you have a source file foo.c then list it here
27 27
 OSWALD_SRC = ../ui/oswald_main.c ../ui/oswald_screens.c \
28
-	../ui/oswald_watch_faces.c ../ui/Fonts.c ../ui/LcdDisplay.c \
28
+	../ui/oswald_watch_faces.c \
29 29
 	../ui/oswald_strings.c ../ui/calendar.c \
30
+	../ui/oswald_graphics.c ../ui/oswald_fonts.c \
30 31
 	../ui/embedvm.c
31 32
 
32 33
 SOURCES = mw_main.c mw_uart.c mw_lcd.c mw_adc.c mw_bt.c \
... ...
@@ -41,7 +42,7 @@ SOURCES = mw_main.c mw_uart.c mw_lcd.c mw_adc.c mw_bt.c \
41 42
 # Include are located in the Include directory
42 43
 #INCLUDES = $(BT_STACK_INC)
43 44
 #INCLUDES = $(BT_SMALLTOOTH_INV)
44
-INCLUDES = -I../ui/ -I../ui/bitmaps/
45
+INCLUDES = -I../ui/
45 46
 
46 47
 # Add or subtract whatever MSPGCC flags you want. There are plenty more
47 48
 #######################################################################################
Browse code

Here we are! MetaWatch support in Oswald!

Nils Faerber authored on 27/04/2013 20:22:32
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,123 @@
1
+#
2
+# Makefile for msp430
3
+# adapted from the example Makefile from the mspgcc project
4
+#
5
+# 'make' builds everything
6
+# 'make clean' deletes everything except source files and Makefile
7
+# You need to set TARGET, MCU and SOURCES for your project.
8
+# TARGET is the name of the executable file to be produced 
9
+# $(TARGET).elf $(TARGET).hex and $(TARGET).txt nad $(TARGET).map are all generated.
10
+# The TXT file is used for BSL loading, the ELF can be used for JTAG use
11
+# 
12
+TARGET     = oswald_mw
13
+MCU        = msp430f5438a
14
+MEMMODEL   = -mmemory-model=huge -fdata-sections -ffunction-sections # -mdata-region=far
15
+# -gdwarf-2 -fdata-sections -ffunction-sections
16
+#MEMMODEL   = -mmpy=16 -msr20 -md20 -gdwarf-2 -fdata-sections -ffunction-sections
17
+# MEMMODEL   = -mmemory-model=medium -misr20
18
+#MEMMODEL   = -mmemory-model=medium
19
+
20
+APPCONFIG = -DDIGITAL -DMW_DEVBOARD_V2
21
+#APPCONFIG = -DDIGITAL -DMW_DEVBOARD_V2 -DWITH_BTSTACK
22
+#APPCONFIG = -DDIGITAL -DMW_DEVBOARD_V2 -DCC256x_TRANSP
23
+#APPCONFIG = -DDIGITAL -DMW_DIGITAL_V2
24
+
25
+# List all the source files here
26
+# eg if you have a source file foo.c then list it here
27
+OSWALD_SRC = ../ui/oswald_main.c ../ui/oswald_screens.c \
28
+	../ui/oswald_watch_faces.c ../ui/Fonts.c ../ui/LcdDisplay.c \
29
+	../ui/oswald_strings.c ../ui/calendar.c \
30
+	../ui/embedvm.c
31
+
32
+SOURCES = mw_main.c mw_uart.c mw_lcd.c mw_adc.c mw_bt.c \
33
+	bluetooth_init_cc2560_2.44.c \
34
+	bt_hci.c bt_l2cap.c \
35
+	oswald_hal.c $(OSWALD_SRC)
36
+#	$(BT_SMALLTOOTH_SRC)
37
+#	$(BT_STACK_SRC) \
38
+
39
+#BT_STACK_INC = -Ibtstack/ -Ibtstack/include/
40
+#BT_SMALLTOOTH_INV = -IBluetooth/
41
+# Include are located in the Include directory
42
+#INCLUDES = $(BT_STACK_INC)
43
+#INCLUDES = $(BT_SMALLTOOTH_INV)
44
+INCLUDES = -I../ui/ -I../ui/bitmaps/
45
+
46
+# Add or subtract whatever MSPGCC flags you want. There are plenty more
47
+#######################################################################################
48
+CFLAGS   = -mmcu=$(MCU) $(MEMMODEL) -g -Os -Wall -Wunused $(INCLUDES) $(APPCONFIG)
49
+ASFLAGS  = -mmcu=$(MCU) $(MEMMODEL) -x assembler-with-cpp -Wa,-gstabs
50
+LDFLAGS  = -mmcu=$(MCU) $(MEMMODEL) -Wl,-gc-sections -Wl,-Map=$(TARGET).map
51
+########################################################################################
52
+CC       = msp430-gcc
53
+LD       = msp430-ld
54
+AR       = msp430-ar
55
+AS       = msp430-gcc
56
+GASP     = msp430-gasp
57
+NM       = msp430-nm
58
+OBJCOPY  = msp430-objcopy
59
+RANLIB   = msp430-ranlib
60
+STRIP    = msp430-strip
61
+SIZE     = msp430-size
62
+READELF  = msp430-readelf
63
+MAKETXT  = srec_cat
64
+CP       = cp -p
65
+RM       = rm -f
66
+MV       = mv
67
+########################################################################################
68
+# the file which will include dependencies
69
+DEPEND = $(SOURCES:.c=.d)
70
+
71
+# all the object files
72
+OBJECTS = $(SOURCES:.c=.o)
73
+
74
+all: $(TARGET).elf $(TARGET).hex $(TARGET).txt 
75
+
76
+prog: $(TARGET).hex
77
+	mspdebug tilib -d /dev/ttyACM3 -v 2500 "prog $(TARGET).hex"
78
+
79
+prog_watch: $(TARGET).hex
80
+	mspdebug rf2500 -v 2500 "prog $(TARGET).hex"
81
+
82
+$(TARGET).elf: $(OBJECTS)
83
+	echo "Linking $@"
84
+	$(CC) $(OBJECTS) $(LDFLAGS) $(LIBS) -o $@
85
+	echo
86
+	echo ">>>> Size of Firmware <<<<"
87
+	$(SIZE) $(TARGET).elf
88
+	echo
89
+
90
+%.hex: %.elf
91
+	$(OBJCOPY) -O ihex $< $@
92
+
93
+%.txt: %.hex
94
+	$(MAKETXT) -O $@ -TITXT $< -I
95
+	unix2dos $(TARGET).txt
96
+#  The above line is required for the DOS based TI BSL tool to be able to read the txt file generated from linux/unix systems.
97
+
98
+%.o: %.c
99
+	echo "Compiling $<"
100
+	$(CC) -c $(CFLAGS) -o $@ $<
101
+
102
+# rule for making assembler source listing, to see the code
103
+%.lst: %.c
104
+	$(CC) -c $(ASFLAGS) -Wa,-anlhd $< > $@
105
+
106
+# include the dependencies unless we're going to clean, then forget about them.
107
+ifneq ($(MAKECMDGOALS), clean)
108
+-include $(DEPEND)
109
+endif
110
+# dependencies file
111
+# includes also considered, since some of these are our own
112
+# (otherwise use -MM instead of -M)
113
+%.d: %.c
114
+	echo "Generating dependencies $@ from $<"
115
+	$(CC) -M ${CFLAGS} $< >$@
116
+
117
+#.SILENT:
118
+.PHONY:	clean
119
+clean:
120
+	-$(RM) $(OBJECTS)
121
+	-$(RM) $(TARGET).*
122
+	-$(RM) $(SOURCES:.c=.lst)
123
+	-$(RM) $(DEPEND)