sensor-watch/make.mk

239 lines
8.4 KiB
Makefile
Raw Normal View History

2021-08-29 01:58:21 +08:00
##############################################################################
ifndef EMSCRIPTEN
2021-08-29 01:58:21 +08:00
BUILD = ./build
else
BUILD = ./build-sim
endif
2021-08-29 01:58:21 +08:00
BIN = watch
ifndef BOARD
override BOARD = OSO-SWAT-A1-05
endif
2021-08-29 01:58:21 +08:00
##############################################################################
.PHONY: all directory clean size
2022-05-10 14:37:02 +08:00
# OS detection, adapted from https://gist.github.com/sighingnow/deee806603ec9274fd47
DETECTED_OS :=
ifeq ($(OS),Windows_NT)
DETECTED_OS = WINDOWS
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
DETECTED_OS = LINUX
endif
ifeq ($(UNAME_S),Darwin)
DETECTED_OS = OSX
endif
endif
$(if ${VERBOSE},$(info OS detected: $(DETECTED_OS)))
2021-08-29 01:58:21 +08:00
ifeq ($(OS), Windows_NT)
MKDIR = gmkdir
else
MKDIR = mkdir
endif
ifeq ($(DETECTED_OS), LINUX)
MAKEFLAGS += -j $(shell nproc)
endif
ifeq ($(DETECTED_OS), OSX)
NPROCS = $(shell sysctl hw.ncpu | grep -o '[0-9]\+')
MAKEFLAGS += -j $(NPROCS)
endif
ifeq ($(DETECTED_OS), WINDOWS)
MAKEFLAGS += -j $(NUMBER_OF_PROCESSORS)
endif
Sensor Watch Simulator (#35) * Put something on screen * Use the 32bit watch_date_time repr to pass from JS * Implement periodic callbacks * Clear display on enabling * Hook up watch_set_led_color() to SVG (green-only) * Make debug output full-width * Remove default Emscripten canvas * Implement sleep and button clicks * Fix time zone conversion bug in beats-time app * Clean up warnings * Fix pin levels * Set time zone to browser value (if available) * Add basic backup data saving * Silence format specifier warnings in both targets * Remove unnecessary, copied files * Use RTC pointer to clear callbacks (if available) * Use preprocessor define to avoid hardcoding MOVEMENT_NUM_FACES * Change each face to const preprocessor definition * Remove Intl.DateTimeFormat usage * Update shell.html title, header * Add touch start/end event handlers on SVG buttons * Update shell.html * Update folder structure (shared, simulator, hardware under watch-library) * Tease out shared components from watch_slcd * Clean up simulator watch_slcd.c inline JS calls * Fix missing newlines at end of file * Add simulator warnings (except format, unused-paremter) * Implement remaining watch_rtc functions * Fix button bug on mouse down then drag out * Implement remaining watch_slcd functions * Link keyboard events to buttons (for keys A, L, M) * Rewrite event handling (mouse, touch, keyboard) in C * Set explicit text UTF-8 charset in shell.html * Address PR comments * Remove unused directories from include paths
2022-01-26 04:03:22 +08:00
ifndef EMSCRIPTEN
CC = arm-none-eabi-gcc
OBJCOPY = arm-none-eabi-objcopy
SIZE = arm-none-eabi-size
UF2 = python3 $(TOP)/utils/uf2conv.py
Sensor Watch Simulator (#35) * Put something on screen * Use the 32bit watch_date_time repr to pass from JS * Implement periodic callbacks * Clear display on enabling * Hook up watch_set_led_color() to SVG (green-only) * Make debug output full-width * Remove default Emscripten canvas * Implement sleep and button clicks * Fix time zone conversion bug in beats-time app * Clean up warnings * Fix pin levels * Set time zone to browser value (if available) * Add basic backup data saving * Silence format specifier warnings in both targets * Remove unnecessary, copied files * Use RTC pointer to clear callbacks (if available) * Use preprocessor define to avoid hardcoding MOVEMENT_NUM_FACES * Change each face to const preprocessor definition * Remove Intl.DateTimeFormat usage * Update shell.html title, header * Add touch start/end event handlers on SVG buttons * Update shell.html * Update folder structure (shared, simulator, hardware under watch-library) * Tease out shared components from watch_slcd * Clean up simulator watch_slcd.c inline JS calls * Fix missing newlines at end of file * Add simulator warnings (except format, unused-paremter) * Implement remaining watch_rtc functions * Fix button bug on mouse down then drag out * Implement remaining watch_slcd functions * Link keyboard events to buttons (for keys A, L, M) * Rewrite event handling (mouse, touch, keyboard) in C * Set explicit text UTF-8 charset in shell.html * Address PR comments * Remove unused directories from include paths
2022-01-26 04:03:22 +08:00
2021-12-05 20:58:44 +08:00
CFLAGS += -W -Wall -Wextra -Wmissing-prototypes -Wmissing-declarations
CFLAGS += --std=gnu99 -Os
2021-08-29 01:58:21 +08:00
CFLAGS += -fno-diagnostics-show-caret
CFLAGS += -fdata-sections -ffunction-sections
CFLAGS += -funsigned-char -funsigned-bitfields
CFLAGS += -mcpu=cortex-m0plus -mthumb
CFLAGS += -MD -MP -MT $(BUILD)/$(*F).o -MF $(BUILD)/$(@F).d
LDFLAGS += -mcpu=cortex-m0plus -mthumb
LDFLAGS += -Wl,--gc-sections
Sensor Watch Simulator (#35) * Put something on screen * Use the 32bit watch_date_time repr to pass from JS * Implement periodic callbacks * Clear display on enabling * Hook up watch_set_led_color() to SVG (green-only) * Make debug output full-width * Remove default Emscripten canvas * Implement sleep and button clicks * Fix time zone conversion bug in beats-time app * Clean up warnings * Fix pin levels * Set time zone to browser value (if available) * Add basic backup data saving * Silence format specifier warnings in both targets * Remove unnecessary, copied files * Use RTC pointer to clear callbacks (if available) * Use preprocessor define to avoid hardcoding MOVEMENT_NUM_FACES * Change each face to const preprocessor definition * Remove Intl.DateTimeFormat usage * Update shell.html title, header * Add touch start/end event handlers on SVG buttons * Update shell.html * Update folder structure (shared, simulator, hardware under watch-library) * Tease out shared components from watch_slcd * Clean up simulator watch_slcd.c inline JS calls * Fix missing newlines at end of file * Add simulator warnings (except format, unused-paremter) * Implement remaining watch_rtc functions * Fix button bug on mouse down then drag out * Implement remaining watch_slcd functions * Link keyboard events to buttons (for keys A, L, M) * Rewrite event handling (mouse, touch, keyboard) in C * Set explicit text UTF-8 charset in shell.html * Address PR comments * Remove unused directories from include paths
2022-01-26 04:03:22 +08:00
LDFLAGS += -Wl,--script=$(TOP)/watch-library/hardware/linker/saml22j18.ld
LDFLAGS += -Wl,--print-memory-usage
2021-08-29 01:58:21 +08:00
2021-11-23 01:09:52 +08:00
LIBS += -lm
2021-08-29 01:58:21 +08:00
INCLUDES += \
-I$(TOP)/tinyusb/src \
-I$(TOP)/boards/$(BOARD) \
Sensor Watch Simulator (#35) * Put something on screen * Use the 32bit watch_date_time repr to pass from JS * Implement periodic callbacks * Clear display on enabling * Hook up watch_set_led_color() to SVG (green-only) * Make debug output full-width * Remove default Emscripten canvas * Implement sleep and button clicks * Fix time zone conversion bug in beats-time app * Clean up warnings * Fix pin levels * Set time zone to browser value (if available) * Add basic backup data saving * Silence format specifier warnings in both targets * Remove unnecessary, copied files * Use RTC pointer to clear callbacks (if available) * Use preprocessor define to avoid hardcoding MOVEMENT_NUM_FACES * Change each face to const preprocessor definition * Remove Intl.DateTimeFormat usage * Update shell.html title, header * Add touch start/end event handlers on SVG buttons * Update shell.html * Update folder structure (shared, simulator, hardware under watch-library) * Tease out shared components from watch_slcd * Clean up simulator watch_slcd.c inline JS calls * Fix missing newlines at end of file * Add simulator warnings (except format, unused-paremter) * Implement remaining watch_rtc functions * Fix button bug on mouse down then drag out * Implement remaining watch_slcd functions * Link keyboard events to buttons (for keys A, L, M) * Rewrite event handling (mouse, touch, keyboard) in C * Set explicit text UTF-8 charset in shell.html * Address PR comments * Remove unused directories from include paths
2022-01-26 04:03:22 +08:00
-I$(TOP)/watch-library/shared/config/ \
-I$(TOP)/watch-library/shared/driver/ \
-I$(TOP)/watch-library/shared/watch/ \
-I$(TOP)/watch-library/hardware/include \
-I$(TOP)/watch-library/hardware/hal/ \
-I$(TOP)/watch-library/hardware/hal/documentation/ \
-I$(TOP)/watch-library/hardware/hal/include/ \
-I$(TOP)/watch-library/hardware/hal/src/ \
-I$(TOP)/watch-library/hardware/hal/utils/ \
-I$(TOP)/watch-library/hardware/hal/utils/include/ \
-I$(TOP)/watch-library/hardware/hal/utils/src/ \
-I$(TOP)/watch-library/hardware/hpl/ \
-I$(TOP)/watch-library/hardware/hpl/core/ \
-I$(TOP)/watch-library/hardware/hpl/dmac/ \
-I$(TOP)/watch-library/hardware/hpl/eic/ \
-I$(TOP)/watch-library/hardware/hpl/gclk/ \
-I$(TOP)/watch-library/hardware/hpl/mclk/ \
-I$(TOP)/watch-library/hardware/hpl/osc32kctrl/ \
-I$(TOP)/watch-library/hardware/hpl/oscctrl/ \
-I$(TOP)/watch-library/hardware/hpl/pm/ \
-I$(TOP)/watch-library/hardware/hpl/port/ \
-I$(TOP)/watch-library/hardware/hpl/sercom/ \
-I$(TOP)/watch-library/hardware/hpl/slcd/ \
-I$(TOP)/watch-library/hardware/hpl/systick/ \
-I$(TOP)/watch-library/hardware/hri/ \
-I$(TOP)/watch-library/hardware/hw/ \
-I$(TOP)/watch-library/hardware/watch/ \
-I$(TOP)/watch-library/hardware \
2021-08-29 01:58:21 +08:00
SRCS += \
$(TOP)/tinyusb/src/tusb.c \
$(TOP)/tinyusb/src/common/tusb_fifo.c \
$(TOP)/tinyusb/src/class/cdc/cdc_device.c \
$(TOP)/tinyusb/src/device/usbd.c \
$(TOP)/tinyusb/src/device/usbd_control.c \
$(TOP)/tinyusb/src/portable/microchip/samd/dcd_samd.c \
Sensor Watch Simulator (#35) * Put something on screen * Use the 32bit watch_date_time repr to pass from JS * Implement periodic callbacks * Clear display on enabling * Hook up watch_set_led_color() to SVG (green-only) * Make debug output full-width * Remove default Emscripten canvas * Implement sleep and button clicks * Fix time zone conversion bug in beats-time app * Clean up warnings * Fix pin levels * Set time zone to browser value (if available) * Add basic backup data saving * Silence format specifier warnings in both targets * Remove unnecessary, copied files * Use RTC pointer to clear callbacks (if available) * Use preprocessor define to avoid hardcoding MOVEMENT_NUM_FACES * Change each face to const preprocessor definition * Remove Intl.DateTimeFormat usage * Update shell.html title, header * Add touch start/end event handlers on SVG buttons * Update shell.html * Update folder structure (shared, simulator, hardware under watch-library) * Tease out shared components from watch_slcd * Clean up simulator watch_slcd.c inline JS calls * Fix missing newlines at end of file * Add simulator warnings (except format, unused-paremter) * Implement remaining watch_rtc functions * Fix button bug on mouse down then drag out * Implement remaining watch_slcd functions * Link keyboard events to buttons (for keys A, L, M) * Rewrite event handling (mouse, touch, keyboard) in C * Set explicit text UTF-8 charset in shell.html * Address PR comments * Remove unused directories from include paths
2022-01-26 04:03:22 +08:00
$(TOP)/watch-library/hardware/main.c \
$(TOP)/watch-library/hardware/startup_saml22.c \
$(TOP)/watch-library/hardware/hw/driver_init.c \
$(TOP)/watch-library/hardware/watch/watch_rtc.c \
$(TOP)/watch-library/hardware/watch/watch_slcd.c \
$(TOP)/watch-library/hardware/watch/watch_extint.c \
$(TOP)/watch-library/hardware/watch/watch_led.c \
$(TOP)/watch-library/hardware/watch/watch_buzzer.c \
$(TOP)/watch-library/hardware/watch/watch_adc.c \
$(TOP)/watch-library/hardware/watch/watch_gpio.c \
$(TOP)/watch-library/hardware/watch/watch_i2c.c \
2022-01-27 10:32:55 +08:00
$(TOP)/watch-library/hardware/watch/watch_spi.c \
Sensor Watch Simulator (#35) * Put something on screen * Use the 32bit watch_date_time repr to pass from JS * Implement periodic callbacks * Clear display on enabling * Hook up watch_set_led_color() to SVG (green-only) * Make debug output full-width * Remove default Emscripten canvas * Implement sleep and button clicks * Fix time zone conversion bug in beats-time app * Clean up warnings * Fix pin levels * Set time zone to browser value (if available) * Add basic backup data saving * Silence format specifier warnings in both targets * Remove unnecessary, copied files * Use RTC pointer to clear callbacks (if available) * Use preprocessor define to avoid hardcoding MOVEMENT_NUM_FACES * Change each face to const preprocessor definition * Remove Intl.DateTimeFormat usage * Update shell.html title, header * Add touch start/end event handlers on SVG buttons * Update shell.html * Update folder structure (shared, simulator, hardware under watch-library) * Tease out shared components from watch_slcd * Clean up simulator watch_slcd.c inline JS calls * Fix missing newlines at end of file * Add simulator warnings (except format, unused-paremter) * Implement remaining watch_rtc functions * Fix button bug on mouse down then drag out * Implement remaining watch_slcd functions * Link keyboard events to buttons (for keys A, L, M) * Rewrite event handling (mouse, touch, keyboard) in C * Set explicit text UTF-8 charset in shell.html * Address PR comments * Remove unused directories from include paths
2022-01-26 04:03:22 +08:00
$(TOP)/watch-library/hardware/watch/watch_uart.c \
$(TOP)/watch-library/hardware/watch/watch_storage.c \
Sensor Watch Simulator (#35) * Put something on screen * Use the 32bit watch_date_time repr to pass from JS * Implement periodic callbacks * Clear display on enabling * Hook up watch_set_led_color() to SVG (green-only) * Make debug output full-width * Remove default Emscripten canvas * Implement sleep and button clicks * Fix time zone conversion bug in beats-time app * Clean up warnings * Fix pin levels * Set time zone to browser value (if available) * Add basic backup data saving * Silence format specifier warnings in both targets * Remove unnecessary, copied files * Use RTC pointer to clear callbacks (if available) * Use preprocessor define to avoid hardcoding MOVEMENT_NUM_FACES * Change each face to const preprocessor definition * Remove Intl.DateTimeFormat usage * Update shell.html title, header * Add touch start/end event handlers on SVG buttons * Update shell.html * Update folder structure (shared, simulator, hardware under watch-library) * Tease out shared components from watch_slcd * Clean up simulator watch_slcd.c inline JS calls * Fix missing newlines at end of file * Add simulator warnings (except format, unused-paremter) * Implement remaining watch_rtc functions * Fix button bug on mouse down then drag out * Implement remaining watch_slcd functions * Link keyboard events to buttons (for keys A, L, M) * Rewrite event handling (mouse, touch, keyboard) in C * Set explicit text UTF-8 charset in shell.html * Address PR comments * Remove unused directories from include paths
2022-01-26 04:03:22 +08:00
$(TOP)/watch-library/hardware/watch/watch_deepsleep.c \
$(TOP)/watch-library/hardware/watch/watch_private.c \
$(TOP)/watch-library/hardware/watch/watch_private_cdc.c \
Sensor Watch Simulator (#35) * Put something on screen * Use the 32bit watch_date_time repr to pass from JS * Implement periodic callbacks * Clear display on enabling * Hook up watch_set_led_color() to SVG (green-only) * Make debug output full-width * Remove default Emscripten canvas * Implement sleep and button clicks * Fix time zone conversion bug in beats-time app * Clean up warnings * Fix pin levels * Set time zone to browser value (if available) * Add basic backup data saving * Silence format specifier warnings in both targets * Remove unnecessary, copied files * Use RTC pointer to clear callbacks (if available) * Use preprocessor define to avoid hardcoding MOVEMENT_NUM_FACES * Change each face to const preprocessor definition * Remove Intl.DateTimeFormat usage * Update shell.html title, header * Add touch start/end event handlers on SVG buttons * Update shell.html * Update folder structure (shared, simulator, hardware under watch-library) * Tease out shared components from watch_slcd * Clean up simulator watch_slcd.c inline JS calls * Fix missing newlines at end of file * Add simulator warnings (except format, unused-paremter) * Implement remaining watch_rtc functions * Fix button bug on mouse down then drag out * Implement remaining watch_slcd functions * Link keyboard events to buttons (for keys A, L, M) * Rewrite event handling (mouse, touch, keyboard) in C * Set explicit text UTF-8 charset in shell.html * Address PR comments * Remove unused directories from include paths
2022-01-26 04:03:22 +08:00
$(TOP)/watch-library/hardware/watch/watch.c \
$(TOP)/watch-library/hardware/hal/src/hal_atomic.c \
$(TOP)/watch-library/hardware/hal/src/hal_delay.c \
$(TOP)/watch-library/hardware/hal/src/hal_ext_irq.c \
$(TOP)/watch-library/hardware/hal/src/hal_gpio.c \
$(TOP)/watch-library/hardware/hal/src/hal_i2c_m_sync.c \
$(TOP)/watch-library/hardware/hal/src/hal_spi_m_sync.c \
2022-01-27 08:31:49 +08:00
$(TOP)/watch-library/hardware/hal/src/hal_usart_sync.c \
Sensor Watch Simulator (#35) * Put something on screen * Use the 32bit watch_date_time repr to pass from JS * Implement periodic callbacks * Clear display on enabling * Hook up watch_set_led_color() to SVG (green-only) * Make debug output full-width * Remove default Emscripten canvas * Implement sleep and button clicks * Fix time zone conversion bug in beats-time app * Clean up warnings * Fix pin levels * Set time zone to browser value (if available) * Add basic backup data saving * Silence format specifier warnings in both targets * Remove unnecessary, copied files * Use RTC pointer to clear callbacks (if available) * Use preprocessor define to avoid hardcoding MOVEMENT_NUM_FACES * Change each face to const preprocessor definition * Remove Intl.DateTimeFormat usage * Update shell.html title, header * Add touch start/end event handlers on SVG buttons * Update shell.html * Update folder structure (shared, simulator, hardware under watch-library) * Tease out shared components from watch_slcd * Clean up simulator watch_slcd.c inline JS calls * Fix missing newlines at end of file * Add simulator warnings (except format, unused-paremter) * Implement remaining watch_rtc functions * Fix button bug on mouse down then drag out * Implement remaining watch_slcd functions * Link keyboard events to buttons (for keys A, L, M) * Rewrite event handling (mouse, touch, keyboard) in C * Set explicit text UTF-8 charset in shell.html * Address PR comments * Remove unused directories from include paths
2022-01-26 04:03:22 +08:00
$(TOP)/watch-library/hardware/hal/src/hal_init.c \
$(TOP)/watch-library/hardware/hal/src/hal_io.c \
$(TOP)/watch-library/hardware/hal/src/hal_slcd_sync.c \
$(TOP)/watch-library/hardware/hal/src/hal_sleep.c \
$(TOP)/watch-library/hardware/hal/utils/src/utils_assert.c \
$(TOP)/watch-library/hardware/hal/utils/src/utils_event.c \
$(TOP)/watch-library/hardware/hal/utils/src/utils_list.c \
$(TOP)/watch-library/hardware/hal/utils/src/utils_syscalls.c \
$(TOP)/watch-library/hardware/hpl/core/hpl_core_m0plus_base.c \
$(TOP)/watch-library/hardware/hpl/core/hpl_init.c \
$(TOP)/watch-library/hardware/hpl/dmac/hpl_dmac.c \
$(TOP)/watch-library/hardware/hpl/eic/hpl_eic.c \
$(TOP)/watch-library/hardware/hpl/gclk/hpl_gclk.c \
$(TOP)/watch-library/hardware/hpl/mclk/hpl_mclk.c \
$(TOP)/watch-library/hardware/hpl/osc32kctrl/hpl_osc32kctrl.c \
$(TOP)/watch-library/hardware/hpl/oscctrl/hpl_oscctrl.c \
$(TOP)/watch-library/hardware/hpl/pm/hpl_pm.c \
$(TOP)/watch-library/hardware/hpl/sercom/hpl_sercom.c \
$(TOP)/watch-library/hardware/hpl/slcd/hpl_slcd.c \
$(TOP)/watch-library/hardware/hpl/systick/hpl_systick.c \
$(TOP)/watch-library/shared/driver/thermistor_driver.c \
Sensor Watch Simulator (#35) * Put something on screen * Use the 32bit watch_date_time repr to pass from JS * Implement periodic callbacks * Clear display on enabling * Hook up watch_set_led_color() to SVG (green-only) * Make debug output full-width * Remove default Emscripten canvas * Implement sleep and button clicks * Fix time zone conversion bug in beats-time app * Clean up warnings * Fix pin levels * Set time zone to browser value (if available) * Add basic backup data saving * Silence format specifier warnings in both targets * Remove unnecessary, copied files * Use RTC pointer to clear callbacks (if available) * Use preprocessor define to avoid hardcoding MOVEMENT_NUM_FACES * Change each face to const preprocessor definition * Remove Intl.DateTimeFormat usage * Update shell.html title, header * Add touch start/end event handlers on SVG buttons * Update shell.html * Update folder structure (shared, simulator, hardware under watch-library) * Tease out shared components from watch_slcd * Clean up simulator watch_slcd.c inline JS calls * Fix missing newlines at end of file * Add simulator warnings (except format, unused-paremter) * Implement remaining watch_rtc functions * Fix button bug on mouse down then drag out * Implement remaining watch_slcd functions * Link keyboard events to buttons (for keys A, L, M) * Rewrite event handling (mouse, touch, keyboard) in C * Set explicit text UTF-8 charset in shell.html * Address PR comments * Remove unused directories from include paths
2022-01-26 04:03:22 +08:00
$(TOP)/watch-library/shared/driver/lis2dw.c \
$(TOP)/watch-library/shared/driver/opt3001.c \
2022-01-27 11:39:09 +08:00
$(TOP)/watch-library/shared/driver/spiflash.c \
$(TOP)/watch-library/shared/watch/watch_private_buzzer.c \
Sensor Watch Simulator (#35) * Put something on screen * Use the 32bit watch_date_time repr to pass from JS * Implement periodic callbacks * Clear display on enabling * Hook up watch_set_led_color() to SVG (green-only) * Make debug output full-width * Remove default Emscripten canvas * Implement sleep and button clicks * Fix time zone conversion bug in beats-time app * Clean up warnings * Fix pin levels * Set time zone to browser value (if available) * Add basic backup data saving * Silence format specifier warnings in both targets * Remove unnecessary, copied files * Use RTC pointer to clear callbacks (if available) * Use preprocessor define to avoid hardcoding MOVEMENT_NUM_FACES * Change each face to const preprocessor definition * Remove Intl.DateTimeFormat usage * Update shell.html title, header * Add touch start/end event handlers on SVG buttons * Update shell.html * Update folder structure (shared, simulator, hardware under watch-library) * Tease out shared components from watch_slcd * Clean up simulator watch_slcd.c inline JS calls * Fix missing newlines at end of file * Add simulator warnings (except format, unused-paremter) * Implement remaining watch_rtc functions * Fix button bug on mouse down then drag out * Implement remaining watch_slcd functions * Link keyboard events to buttons (for keys A, L, M) * Rewrite event handling (mouse, touch, keyboard) in C * Set explicit text UTF-8 charset in shell.html * Address PR comments * Remove unused directories from include paths
2022-01-26 04:03:22 +08:00
$(TOP)/watch-library/shared/watch/watch_private_display.c \
$(TOP)/watch-library/shared/watch/watch_utility.c \
2021-08-29 01:58:21 +08:00
DEFINES += \
-D__SAML22J18A__ \
-DDONT_USE_CMSIS_INIT
2021-09-01 08:28:36 +08:00
Sensor Watch Simulator (#35) * Put something on screen * Use the 32bit watch_date_time repr to pass from JS * Implement periodic callbacks * Clear display on enabling * Hook up watch_set_led_color() to SVG (green-only) * Make debug output full-width * Remove default Emscripten canvas * Implement sleep and button clicks * Fix time zone conversion bug in beats-time app * Clean up warnings * Fix pin levels * Set time zone to browser value (if available) * Add basic backup data saving * Silence format specifier warnings in both targets * Remove unnecessary, copied files * Use RTC pointer to clear callbacks (if available) * Use preprocessor define to avoid hardcoding MOVEMENT_NUM_FACES * Change each face to const preprocessor definition * Remove Intl.DateTimeFormat usage * Update shell.html title, header * Add touch start/end event handlers on SVG buttons * Update shell.html * Update folder structure (shared, simulator, hardware under watch-library) * Tease out shared components from watch_slcd * Clean up simulator watch_slcd.c inline JS calls * Fix missing newlines at end of file * Add simulator warnings (except format, unused-paremter) * Implement remaining watch_rtc functions * Fix button bug on mouse down then drag out * Implement remaining watch_slcd functions * Link keyboard events to buttons (for keys A, L, M) * Rewrite event handling (mouse, touch, keyboard) in C * Set explicit text UTF-8 charset in shell.html * Address PR comments * Remove unused directories from include paths
2022-01-26 04:03:22 +08:00
else
CFLAGS += -W -Wall -Wextra -Wmissing-prototypes -Wmissing-declarations
CFLAGS += -Wno-format -Wno-unused-parameter
CFLAGS += -MD -MP -MT $(BUILD)/$(*F).o -MF $(BUILD)/$(@F).d
Sensor Watch Simulator (#35) * Put something on screen * Use the 32bit watch_date_time repr to pass from JS * Implement periodic callbacks * Clear display on enabling * Hook up watch_set_led_color() to SVG (green-only) * Make debug output full-width * Remove default Emscripten canvas * Implement sleep and button clicks * Fix time zone conversion bug in beats-time app * Clean up warnings * Fix pin levels * Set time zone to browser value (if available) * Add basic backup data saving * Silence format specifier warnings in both targets * Remove unnecessary, copied files * Use RTC pointer to clear callbacks (if available) * Use preprocessor define to avoid hardcoding MOVEMENT_NUM_FACES * Change each face to const preprocessor definition * Remove Intl.DateTimeFormat usage * Update shell.html title, header * Add touch start/end event handlers on SVG buttons * Update shell.html * Update folder structure (shared, simulator, hardware under watch-library) * Tease out shared components from watch_slcd * Clean up simulator watch_slcd.c inline JS calls * Fix missing newlines at end of file * Add simulator warnings (except format, unused-paremter) * Implement remaining watch_rtc functions * Fix button bug on mouse down then drag out * Implement remaining watch_slcd functions * Link keyboard events to buttons (for keys A, L, M) * Rewrite event handling (mouse, touch, keyboard) in C * Set explicit text UTF-8 charset in shell.html * Address PR comments * Remove unused directories from include paths
2022-01-26 04:03:22 +08:00
INCLUDES += \
-I$(TOP)/boards/$(BOARD) \
-I$(TOP)/watch-library/shared/driver/ \
-I$(TOP)/watch-library/shared/config/ \
-I$(TOP)/watch-library/shared/watch/ \
-I$(TOP)/watch-library/simulator/watch/ \
Sensor Watch Simulator (#35) * Put something on screen * Use the 32bit watch_date_time repr to pass from JS * Implement periodic callbacks * Clear display on enabling * Hook up watch_set_led_color() to SVG (green-only) * Make debug output full-width * Remove default Emscripten canvas * Implement sleep and button clicks * Fix time zone conversion bug in beats-time app * Clean up warnings * Fix pin levels * Set time zone to browser value (if available) * Add basic backup data saving * Silence format specifier warnings in both targets * Remove unnecessary, copied files * Use RTC pointer to clear callbacks (if available) * Use preprocessor define to avoid hardcoding MOVEMENT_NUM_FACES * Change each face to const preprocessor definition * Remove Intl.DateTimeFormat usage * Update shell.html title, header * Add touch start/end event handlers on SVG buttons * Update shell.html * Update folder structure (shared, simulator, hardware under watch-library) * Tease out shared components from watch_slcd * Clean up simulator watch_slcd.c inline JS calls * Fix missing newlines at end of file * Add simulator warnings (except format, unused-paremter) * Implement remaining watch_rtc functions * Fix button bug on mouse down then drag out * Implement remaining watch_slcd functions * Link keyboard events to buttons (for keys A, L, M) * Rewrite event handling (mouse, touch, keyboard) in C * Set explicit text UTF-8 charset in shell.html * Address PR comments * Remove unused directories from include paths
2022-01-26 04:03:22 +08:00
-I$(TOP)/watch-library/simulator/hpl/port/ \
-I$(TOP)/watch-library/hardware/include/component \
-I$(TOP)/watch-library/hardware/hal/include/ \
-I$(TOP)/watch-library/hardware/hal/utils/include/ \
-I$(TOP)/watch-library/hardware/hpl/slcd/ \
-I$(TOP)/watch-library/hardware/hw/ \
SRCS += \
$(TOP)/watch-library/simulator/main.c \
$(TOP)/watch-library/simulator/watch/watch_rtc.c \
$(TOP)/watch-library/simulator/watch/watch_slcd.c \
$(TOP)/watch-library/simulator/watch/watch_extint.c \
$(TOP)/watch-library/simulator/watch/watch_led.c \
$(TOP)/watch-library/simulator/watch/watch_buzzer.c \
$(TOP)/watch-library/simulator/watch/watch_adc.c \
$(TOP)/watch-library/simulator/watch/watch_gpio.c \
$(TOP)/watch-library/simulator/watch/watch_i2c.c \
2022-01-27 10:32:55 +08:00
$(TOP)/watch-library/simulator/watch/watch_spi.c \
Sensor Watch Simulator (#35) * Put something on screen * Use the 32bit watch_date_time repr to pass from JS * Implement periodic callbacks * Clear display on enabling * Hook up watch_set_led_color() to SVG (green-only) * Make debug output full-width * Remove default Emscripten canvas * Implement sleep and button clicks * Fix time zone conversion bug in beats-time app * Clean up warnings * Fix pin levels * Set time zone to browser value (if available) * Add basic backup data saving * Silence format specifier warnings in both targets * Remove unnecessary, copied files * Use RTC pointer to clear callbacks (if available) * Use preprocessor define to avoid hardcoding MOVEMENT_NUM_FACES * Change each face to const preprocessor definition * Remove Intl.DateTimeFormat usage * Update shell.html title, header * Add touch start/end event handlers on SVG buttons * Update shell.html * Update folder structure (shared, simulator, hardware under watch-library) * Tease out shared components from watch_slcd * Clean up simulator watch_slcd.c inline JS calls * Fix missing newlines at end of file * Add simulator warnings (except format, unused-paremter) * Implement remaining watch_rtc functions * Fix button bug on mouse down then drag out * Implement remaining watch_slcd functions * Link keyboard events to buttons (for keys A, L, M) * Rewrite event handling (mouse, touch, keyboard) in C * Set explicit text UTF-8 charset in shell.html * Address PR comments * Remove unused directories from include paths
2022-01-26 04:03:22 +08:00
$(TOP)/watch-library/simulator/watch/watch_uart.c \
$(TOP)/watch-library/simulator/watch/watch_storage.c \
Sensor Watch Simulator (#35) * Put something on screen * Use the 32bit watch_date_time repr to pass from JS * Implement periodic callbacks * Clear display on enabling * Hook up watch_set_led_color() to SVG (green-only) * Make debug output full-width * Remove default Emscripten canvas * Implement sleep and button clicks * Fix time zone conversion bug in beats-time app * Clean up warnings * Fix pin levels * Set time zone to browser value (if available) * Add basic backup data saving * Silence format specifier warnings in both targets * Remove unnecessary, copied files * Use RTC pointer to clear callbacks (if available) * Use preprocessor define to avoid hardcoding MOVEMENT_NUM_FACES * Change each face to const preprocessor definition * Remove Intl.DateTimeFormat usage * Update shell.html title, header * Add touch start/end event handlers on SVG buttons * Update shell.html * Update folder structure (shared, simulator, hardware under watch-library) * Tease out shared components from watch_slcd * Clean up simulator watch_slcd.c inline JS calls * Fix missing newlines at end of file * Add simulator warnings (except format, unused-paremter) * Implement remaining watch_rtc functions * Fix button bug on mouse down then drag out * Implement remaining watch_slcd functions * Link keyboard events to buttons (for keys A, L, M) * Rewrite event handling (mouse, touch, keyboard) in C * Set explicit text UTF-8 charset in shell.html * Address PR comments * Remove unused directories from include paths
2022-01-26 04:03:22 +08:00
$(TOP)/watch-library/simulator/watch/watch_deepsleep.c \
$(TOP)/watch-library/simulator/watch/watch_private.c \
$(TOP)/watch-library/simulator/watch/watch.c \
$(TOP)/watch-library/shared/driver/thermistor_driver.c \
$(TOP)/watch-library/shared/driver/opt3001.c \
$(TOP)/watch-library/shared/watch/watch_private_buzzer.c \
Sensor Watch Simulator (#35) * Put something on screen * Use the 32bit watch_date_time repr to pass from JS * Implement periodic callbacks * Clear display on enabling * Hook up watch_set_led_color() to SVG (green-only) * Make debug output full-width * Remove default Emscripten canvas * Implement sleep and button clicks * Fix time zone conversion bug in beats-time app * Clean up warnings * Fix pin levels * Set time zone to browser value (if available) * Add basic backup data saving * Silence format specifier warnings in both targets * Remove unnecessary, copied files * Use RTC pointer to clear callbacks (if available) * Use preprocessor define to avoid hardcoding MOVEMENT_NUM_FACES * Change each face to const preprocessor definition * Remove Intl.DateTimeFormat usage * Update shell.html title, header * Add touch start/end event handlers on SVG buttons * Update shell.html * Update folder structure (shared, simulator, hardware under watch-library) * Tease out shared components from watch_slcd * Clean up simulator watch_slcd.c inline JS calls * Fix missing newlines at end of file * Add simulator warnings (except format, unused-paremter) * Implement remaining watch_rtc functions * Fix button bug on mouse down then drag out * Implement remaining watch_slcd functions * Link keyboard events to buttons (for keys A, L, M) * Rewrite event handling (mouse, touch, keyboard) in C * Set explicit text UTF-8 charset in shell.html * Address PR comments * Remove unused directories from include paths
2022-01-26 04:03:22 +08:00
$(TOP)/watch-library/shared/watch/watch_private_display.c \
$(TOP)/watch-library/shared/watch/watch_utility.c \
endif
2021-09-01 08:28:36 +08:00
ifeq ($(LED), BLUE)
CFLAGS += -DWATCH_IS_BLUE_BOARD
2021-09-01 08:28:36 +08:00
endif
ifndef COLOR
$(error Set the COLOR variable to RED, BLUE, or GREEN depending on what board you have.)
endif
2023-09-13 23:39:58 +08:00
ifeq ($(COLOR), BLUE)
CFLAGS += -DWATCH_IS_BLUE_BOARD
endif
ifeq ($(COLOR), RED)
2023-07-29 19:01:19 +08:00
CFLAGS += -DWATCH_INVERT_LED_POLARITY
2023-08-18 02:25:33 +08:00
CFLAGS += -DNO_FREQCORR
2023-07-29 19:01:19 +08:00
endif
ifdef FIRMWARE
CFLAGS += -DMOVEMENT_FIRMWARE_$(FIRMWARE)=1
CFLAGS += -DMOVEMENT_FIRMWARE=MOVEMENT_FIRMWARE_$(FIRMWARE)
endif
ifeq ($(BOARD), OSO-FEAL-A1-00)
CFLAGS += -DCRYSTALLESS
endif
# Build options to customize movement and faces
ifdef CLOCK_FACE_24H_ONLY
CFLAGS += -DCLOCK_FACE_24H_ONLY
endif