summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexsander Akers <me@a2.io>2022-01-25 15:03:22 -0500
committerGitHub <noreply@github.com>2022-01-25 15:03:22 -0500
commitb8de35658ffd78ad8b22f91ccbbd3d63663afda9 (patch)
tree1f265ddfcc8e5abf0316b81b15f80bf5c70fa7b7
parent9e24f6c336773c7404139ab4db0eaab2f99504e2 (diff)
downloadSensor-Watch-b8de35658ffd78ad8b22f91ccbbd3d63663afda9.tar.gz
Sensor-Watch-b8de35658ffd78ad8b22f91ccbbd3d63663afda9.tar.bz2
Sensor-Watch-b8de35658ffd78ad8b22f91ccbbd3d63663afda9.zip
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
-rw-r--r--apps/beats-time/app.c4
-rw-r--r--make.mk193
-rw-r--r--movement/README.md28
-rw-r--r--movement/lib/TOTP-MCU/TOTP.c2
-rw-r--r--movement/lib/TOTP-MCU/sha1.c8
-rw-r--r--movement/movement.c27
-rw-r--r--movement/watch_faces/clock/simple_clock_face.h14
-rw-r--r--movement/watch_faces/clock/world_clock_face.h14
-rw-r--r--movement/watch_faces/complications/beats_face.c4
-rw-r--r--movement/watch_faces/complications/beats_face.h14
-rw-r--r--movement/watch_faces/complications/blinky_face.h16
-rw-r--r--movement/watch_faces/complications/countdown_face.h14
-rw-r--r--movement/watch_faces/complications/day_one_face.c2
-rw-r--r--movement/watch_faces/complications/day_one_face.h14
-rw-r--r--movement/watch_faces/complications/pulsometer_face.h16
-rw-r--r--movement/watch_faces/complications/stopwatch_face.h16
-rw-r--r--movement/watch_faces/complications/sunrise_sunset_face.h14
-rw-r--r--movement/watch_faces/complications/totp_face.h14
-rw-r--r--movement/watch_faces/demos/character_set_face.h16
-rw-r--r--movement/watch_faces/demos/demo_face.h16
-rw-r--r--movement/watch_faces/demos/hello_there_face.h14
-rw-r--r--movement/watch_faces/demos/lis2dh_logging_face.c18
-rw-r--r--movement/watch_faces/demos/lis2dh_logging_face.h14
-rw-r--r--movement/watch_faces/demos/voltage_face.c2
-rw-r--r--movement/watch_faces/demos/voltage_face.h16
-rw-r--r--movement/watch_faces/settings/preferences_face.h16
-rw-r--r--movement/watch_faces/settings/set_time_face.h14
-rw-r--r--movement/watch_faces/thermistor/thermistor_logging_face.h14
-rw-r--r--movement/watch_faces/thermistor/thermistor_readout_face.h14
-rw-r--r--rules.mk10
-rw-r--r--watch-library/hardware/hal/documentation/ext_irq.rst (renamed from watch-library/hal/documentation/ext_irq.rst)0
-rwxr-xr-xwatch-library/hardware/hal/documentation/flash.rst (renamed from watch-library/hal/documentation/flash.rst)0
-rw-r--r--watch-library/hardware/hal/documentation/i2c_master_sync.rst (renamed from watch-library/hal/documentation/i2c_master_sync.rst)0
-rwxr-xr-xwatch-library/hardware/hal/documentation/rand_sync.rst (renamed from watch-library/hal/documentation/rand_sync.rst)0
-rw-r--r--watch-library/hardware/hal/documentation/slcd_sync.rst (renamed from watch-library/hal/documentation/slcd_sync.rst)0
-rwxr-xr-xwatch-library/hardware/hal/documentation/spi_master_sync.rst (renamed from watch-library/hal/documentation/spi_master_sync.rst)0
-rwxr-xr-xwatch-library/hardware/hal/documentation/usart_sync.rst (renamed from watch-library/hal/documentation/usart_sync.rst)0
-rw-r--r--watch-library/hardware/hal/include/hal_atomic.h (renamed from watch-library/hal/include/hal_atomic.h)0
-rw-r--r--watch-library/hardware/hal/include/hal_calendar.h (renamed from watch-library/hal/include/hal_calendar.h)0
-rw-r--r--watch-library/hardware/hal/include/hal_delay.h (renamed from watch-library/hal/include/hal_delay.h)0
-rw-r--r--watch-library/hardware/hal/include/hal_ext_irq.h (renamed from watch-library/hal/include/hal_ext_irq.h)0
-rwxr-xr-xwatch-library/hardware/hal/include/hal_flash.h (renamed from watch-library/hal/include/hal_flash.h)0
-rw-r--r--watch-library/hardware/hal/include/hal_gpio.h (renamed from watch-library/hal/include/hal_gpio.h)0
-rw-r--r--watch-library/hardware/hal/include/hal_i2c_m_sync.h (renamed from watch-library/hal/include/hal_i2c_m_sync.h)0
-rw-r--r--watch-library/hardware/hal/include/hal_init.h (renamed from watch-library/hal/include/hal_init.h)0
-rw-r--r--watch-library/hardware/hal/include/hal_io.h (renamed from watch-library/hal/include/hal_io.h)0
-rwxr-xr-xwatch-library/hardware/hal/include/hal_rand_sync.h (renamed from watch-library/hal/include/hal_rand_sync.h)0
-rw-r--r--watch-library/hardware/hal/include/hal_slcd_sync.h (renamed from watch-library/hal/include/hal_slcd_sync.h)0
-rw-r--r--watch-library/hardware/hal/include/hal_sleep.h (renamed from watch-library/hal/include/hal_sleep.h)0
-rwxr-xr-xwatch-library/hardware/hal/include/hal_spi_m_sync.h (renamed from watch-library/hal/include/hal_spi_m_sync.h)0
-rwxr-xr-xwatch-library/hardware/hal/include/hal_usart_sync.h (renamed from watch-library/hal/include/hal_usart_sync.h)0
-rw-r--r--watch-library/hardware/hal/include/hpl_calendar.h (renamed from watch-library/hal/include/hpl_calendar.h)0
-rw-r--r--watch-library/hardware/hal/include/hpl_core.h (renamed from watch-library/hal/include/hpl_core.h)0
-rw-r--r--watch-library/hardware/hal/include/hpl_delay.h (renamed from watch-library/hal/include/hpl_delay.h)0
-rw-r--r--watch-library/hardware/hal/include/hpl_dma.h (renamed from watch-library/hal/include/hpl_dma.h)0
-rw-r--r--watch-library/hardware/hal/include/hpl_ext_irq.h (renamed from watch-library/hal/include/hpl_ext_irq.h)0
-rwxr-xr-xwatch-library/hardware/hal/include/hpl_flash.h (renamed from watch-library/hal/include/hpl_flash.h)0
-rw-r--r--watch-library/hardware/hal/include/hpl_gpio.h (renamed from watch-library/hal/include/hpl_gpio.h)0
-rw-r--r--watch-library/hardware/hal/include/hpl_i2c_m_async.h (renamed from watch-library/hal/include/hpl_i2c_m_async.h)0
-rw-r--r--watch-library/hardware/hal/include/hpl_i2c_m_sync.h (renamed from watch-library/hal/include/hpl_i2c_m_sync.h)0
-rw-r--r--watch-library/hardware/hal/include/hpl_i2c_s_async.h (renamed from watch-library/hal/include/hpl_i2c_s_async.h)0
-rw-r--r--watch-library/hardware/hal/include/hpl_i2c_s_sync.h (renamed from watch-library/hal/include/hpl_i2c_s_sync.h)0
-rw-r--r--watch-library/hardware/hal/include/hpl_init.h (renamed from watch-library/hal/include/hpl_init.h)0
-rw-r--r--watch-library/hardware/hal/include/hpl_irq.h (renamed from watch-library/hal/include/hpl_irq.h)0
-rw-r--r--watch-library/hardware/hal/include/hpl_missing_features.h (renamed from watch-library/hal/include/hpl_missing_features.h)0
-rwxr-xr-xwatch-library/hardware/hal/include/hpl_rand_sync.h (renamed from watch-library/hal/include/hpl_rand_sync.h)0
-rw-r--r--watch-library/hardware/hal/include/hpl_reset.h (renamed from watch-library/hal/include/hpl_reset.h)0
-rw-r--r--watch-library/hardware/hal/include/hpl_slcd.h (renamed from watch-library/hal/include/hpl_slcd.h)0
-rw-r--r--watch-library/hardware/hal/include/hpl_slcd_sync.h (renamed from watch-library/hal/include/hpl_slcd_sync.h)0
-rw-r--r--watch-library/hardware/hal/include/hpl_sleep.h (renamed from watch-library/hal/include/hpl_sleep.h)0
-rw-r--r--watch-library/hardware/hal/include/hpl_spi.h (renamed from watch-library/hal/include/hpl_spi.h)0
-rw-r--r--watch-library/hardware/hal/include/hpl_spi_async.h (renamed from watch-library/hal/include/hpl_spi_async.h)0
-rwxr-xr-xwatch-library/hardware/hal/include/hpl_spi_dma.h (renamed from watch-library/hal/include/hpl_spi_dma.h)0
-rw-r--r--watch-library/hardware/hal/include/hpl_spi_m_async.h (renamed from watch-library/hal/include/hpl_spi_m_async.h)0
-rw-r--r--watch-library/hardware/hal/include/hpl_spi_m_dma.h (renamed from watch-library/hal/include/hpl_spi_m_dma.h)0
-rw-r--r--watch-library/hardware/hal/include/hpl_spi_m_sync.h (renamed from watch-library/hal/include/hpl_spi_m_sync.h)0
-rw-r--r--watch-library/hardware/hal/include/hpl_spi_s_async.h (renamed from watch-library/hal/include/hpl_spi_s_async.h)0
-rw-r--r--watch-library/hardware/hal/include/hpl_spi_s_sync.h (renamed from watch-library/hal/include/hpl_spi_s_sync.h)0
-rw-r--r--watch-library/hardware/hal/include/hpl_spi_sync.h (renamed from watch-library/hal/include/hpl_spi_sync.h)0
-rw-r--r--watch-library/hardware/hal/include/hpl_time_measure.h (renamed from watch-library/hal/include/hpl_time_measure.h)0
-rw-r--r--watch-library/hardware/hal/include/hpl_timer.h (renamed from watch-library/hal/include/hpl_timer.h)0
-rw-r--r--watch-library/hardware/hal/include/hpl_usart.h (renamed from watch-library/hal/include/hpl_usart.h)0
-rw-r--r--watch-library/hardware/hal/include/hpl_usart_async.h (renamed from watch-library/hal/include/hpl_usart_async.h)0
-rw-r--r--watch-library/hardware/hal/include/hpl_usart_sync.h (renamed from watch-library/hal/include/hpl_usart_sync.h)0
-rwxr-xr-xwatch-library/hardware/hal/include/hpl_user_area.h (renamed from watch-library/hal/include/hpl_user_area.h)0
-rw-r--r--watch-library/hardware/hal/src/hal_atomic.c (renamed from watch-library/hal/src/hal_atomic.c)0
-rw-r--r--watch-library/hardware/hal/src/hal_calendar.c (renamed from watch-library/hal/src/hal_calendar.c)0
-rw-r--r--watch-library/hardware/hal/src/hal_delay.c (renamed from watch-library/hal/src/hal_delay.c)0
-rw-r--r--watch-library/hardware/hal/src/hal_ext_irq.c (renamed from watch-library/hal/src/hal_ext_irq.c)0
-rwxr-xr-xwatch-library/hardware/hal/src/hal_flash.c (renamed from watch-library/hal/src/hal_flash.c)0
-rw-r--r--watch-library/hardware/hal/src/hal_gpio.c (renamed from watch-library/hal/src/hal_gpio.c)0
-rw-r--r--watch-library/hardware/hal/src/hal_i2c_m_sync.c (renamed from watch-library/hal/src/hal_i2c_m_sync.c)0
-rw-r--r--watch-library/hardware/hal/src/hal_init.c (renamed from watch-library/hal/src/hal_init.c)0
-rw-r--r--watch-library/hardware/hal/src/hal_io.c (renamed from watch-library/hal/src/hal_io.c)0
-rwxr-xr-xwatch-library/hardware/hal/src/hal_rand_sync.c (renamed from watch-library/hal/src/hal_rand_sync.c)0
-rw-r--r--watch-library/hardware/hal/src/hal_slcd_sync.c (renamed from watch-library/hal/src/hal_slcd_sync.c)0
-rw-r--r--watch-library/hardware/hal/src/hal_sleep.c (renamed from watch-library/hal/src/hal_sleep.c)0
-rwxr-xr-xwatch-library/hardware/hal/src/hal_spi_m_sync.c (renamed from watch-library/hal/src/hal_spi_m_sync.c)0
-rwxr-xr-xwatch-library/hardware/hal/src/hal_usart_sync.c (renamed from watch-library/hal/src/hal_usart_sync.c)0
-rw-r--r--watch-library/hardware/hal/utils/include/compiler.h (renamed from watch-library/hal/utils/include/compiler.h)2
-rw-r--r--watch-library/hardware/hal/utils/include/err_codes.h (renamed from watch-library/hal/utils/include/err_codes.h)0
-rw-r--r--watch-library/hardware/hal/utils/include/events.h (renamed from watch-library/hal/utils/include/events.h)0
-rw-r--r--watch-library/hardware/hal/utils/include/parts.h (renamed from watch-library/hal/utils/include/parts.h)0
-rw-r--r--watch-library/hardware/hal/utils/include/utils.h (renamed from watch-library/hal/utils/include/utils.h)0
-rw-r--r--watch-library/hardware/hal/utils/include/utils_assert.h (renamed from watch-library/hal/utils/include/utils_assert.h)0
-rw-r--r--watch-library/hardware/hal/utils/include/utils_decrement_macro.h (renamed from watch-library/hal/utils/include/utils_decrement_macro.h)0
-rw-r--r--watch-library/hardware/hal/utils/include/utils_event.h (renamed from watch-library/hal/utils/include/utils_event.h)0
-rw-r--r--watch-library/hardware/hal/utils/include/utils_increment_macro.h (renamed from watch-library/hal/utils/include/utils_increment_macro.h)0
-rw-r--r--watch-library/hardware/hal/utils/include/utils_list.h (renamed from watch-library/hal/utils/include/utils_list.h)0
-rw-r--r--watch-library/hardware/hal/utils/include/utils_recursion_macro.h (renamed from watch-library/hal/utils/include/utils_recursion_macro.h)0
-rw-r--r--watch-library/hardware/hal/utils/include/utils_repeat_macro.h (renamed from watch-library/hal/utils/include/utils_repeat_macro.h)0
-rw-r--r--watch-library/hardware/hal/utils/src/utils_assert.c (renamed from watch-library/hal/utils/src/utils_assert.c)0
-rw-r--r--watch-library/hardware/hal/utils/src/utils_event.c (renamed from watch-library/hal/utils/src/utils_event.c)0
-rw-r--r--watch-library/hardware/hal/utils/src/utils_list.c (renamed from watch-library/hal/utils/src/utils_list.c)0
-rw-r--r--watch-library/hardware/hal/utils/src/utils_syscalls.c (renamed from watch-library/hal/utils/src/utils_syscalls.c)0
-rw-r--r--watch-library/hardware/hpl/core/hpl_core_m0plus_base.c (renamed from watch-library/hpl/core/hpl_core_m0plus_base.c)0
-rw-r--r--watch-library/hardware/hpl/core/hpl_core_port.h (renamed from watch-library/hpl/core/hpl_core_port.h)0
-rw-r--r--watch-library/hardware/hpl/core/hpl_init.c (renamed from watch-library/hpl/core/hpl_init.c)0
-rw-r--r--watch-library/hardware/hpl/dmac/hpl_dmac.c (renamed from watch-library/hpl/dmac/hpl_dmac.c)0
-rw-r--r--watch-library/hardware/hpl/eic/hpl_eic.c (renamed from watch-library/hpl/eic/hpl_eic.c)0
-rw-r--r--watch-library/hardware/hpl/gclk/hpl_gclk.c (renamed from watch-library/hpl/gclk/hpl_gclk.c)0
-rw-r--r--watch-library/hardware/hpl/gclk/hpl_gclk_base.h (renamed from watch-library/hpl/gclk/hpl_gclk_base.h)0
-rw-r--r--watch-library/hardware/hpl/mclk/hpl_mclk.c (renamed from watch-library/hpl/mclk/hpl_mclk.c)0
-rwxr-xr-xwatch-library/hardware/hpl/nvmctrl/hpl_nvmctrl.c (renamed from watch-library/hpl/nvmctrl/hpl_nvmctrl.c)0
-rw-r--r--watch-library/hardware/hpl/osc32kctrl/hpl_osc32kctrl.c (renamed from watch-library/hpl/osc32kctrl/hpl_osc32kctrl.c)0
-rw-r--r--watch-library/hardware/hpl/oscctrl/hpl_oscctrl.c (renamed from watch-library/hpl/oscctrl/hpl_oscctrl.c)0
-rw-r--r--watch-library/hardware/hpl/pm/hpl_pm.c (renamed from watch-library/hpl/pm/hpl_pm.c)0
-rw-r--r--watch-library/hardware/hpl/pm/hpl_pm_base.h (renamed from watch-library/hpl/pm/hpl_pm_base.h)0
-rw-r--r--watch-library/hardware/hpl/port/hpl_gpio_base.h (renamed from watch-library/hpl/port/hpl_gpio_base.h)0
-rw-r--r--watch-library/hardware/hpl/sercom/hpl_sercom.c (renamed from watch-library/hpl/sercom/hpl_sercom.c)0
-rw-r--r--watch-library/hardware/hpl/slcd/hpl_slcd.c (renamed from watch-library/hpl/slcd/hpl_slcd.c)0
-rw-r--r--watch-library/hardware/hpl/slcd/hpl_slcd_cm.h (renamed from watch-library/hpl/slcd/hpl_slcd_cm.h)0
-rw-r--r--watch-library/hardware/hpl/systick/hpl_systick.c (renamed from watch-library/hpl/systick/hpl_systick.c)0
-rwxr-xr-xwatch-library/hardware/hpl/trng/hpl_trng.c (renamed from watch-library/hpl/trng/hpl_trng.c)0
-rw-r--r--watch-library/hardware/hri/hri_ac_l22.h (renamed from watch-library/hri/hri_ac_l22.h)0
-rw-r--r--watch-library/hardware/hri/hri_adc_l22.h (renamed from watch-library/hri/hri_adc_l22.h)0
-rw-r--r--watch-library/hardware/hri/hri_aes_l22.h (renamed from watch-library/hri/hri_aes_l22.h)0
-rw-r--r--watch-library/hardware/hri/hri_ccl_l22.h (renamed from watch-library/hri/hri_ccl_l22.h)0
-rw-r--r--watch-library/hardware/hri/hri_dmac_l22.h (renamed from watch-library/hri/hri_dmac_l22.h)0
-rw-r--r--watch-library/hardware/hri/hri_dsu_l22.h (renamed from watch-library/hri/hri_dsu_l22.h)0
-rw-r--r--watch-library/hardware/hri/hri_eic_l22.h (renamed from watch-library/hri/hri_eic_l22.h)0
-rw-r--r--watch-library/hardware/hri/hri_evsys_l22.h (renamed from watch-library/hri/hri_evsys_l22.h)0
-rw-r--r--watch-library/hardware/hri/hri_freqm_l22.h (renamed from watch-library/hri/hri_freqm_l22.h)0
-rw-r--r--watch-library/hardware/hri/hri_gclk_l22.h (renamed from watch-library/hri/hri_gclk_l22.h)0
-rw-r--r--watch-library/hardware/hri/hri_l22.h (renamed from watch-library/hri/hri_l22.h)0
-rw-r--r--watch-library/hardware/hri/hri_mclk_l22.h (renamed from watch-library/hri/hri_mclk_l22.h)0
-rw-r--r--watch-library/hardware/hri/hri_mtb_l22.h (renamed from watch-library/hri/hri_mtb_l22.h)0
-rw-r--r--watch-library/hardware/hri/hri_nvic_l22.h (renamed from watch-library/hri/hri_nvic_l22.h)0
-rw-r--r--watch-library/hardware/hri/hri_nvmctrl_l22.h (renamed from watch-library/hri/hri_nvmctrl_l22.h)0
-rw-r--r--watch-library/hardware/hri/hri_osc32kctrl_l22.h (renamed from watch-library/hri/hri_osc32kctrl_l22.h)0
-rw-r--r--watch-library/hardware/hri/hri_oscctrl_l22.h (renamed from watch-library/hri/hri_oscctrl_l22.h)0
-rw-r--r--watch-library/hardware/hri/hri_pac_l22.h (renamed from watch-library/hri/hri_pac_l22.h)0
-rw-r--r--watch-library/hardware/hri/hri_pm_l22.h (renamed from watch-library/hri/hri_pm_l22.h)0
-rw-r--r--watch-library/hardware/hri/hri_port_l22.h (renamed from watch-library/hri/hri_port_l22.h)0
-rw-r--r--watch-library/hardware/hri/hri_rstc_l22.h (renamed from watch-library/hri/hri_rstc_l22.h)0
-rw-r--r--watch-library/hardware/hri/hri_rtc_l22.h (renamed from watch-library/hri/hri_rtc_l22.h)0
-rw-r--r--watch-library/hardware/hri/hri_sercom_l22.h (renamed from watch-library/hri/hri_sercom_l22.h)0
-rw-r--r--watch-library/hardware/hri/hri_slcd_l22.h (renamed from watch-library/hri/hri_slcd_l22.h)0
-rw-r--r--watch-library/hardware/hri/hri_supc_l22.h (renamed from watch-library/hri/hri_supc_l22.h)0
-rw-r--r--watch-library/hardware/hri/hri_systemcontrol_l22.h (renamed from watch-library/hri/hri_systemcontrol_l22.h)0
-rw-r--r--watch-library/hardware/hri/hri_systick_l22.h (renamed from watch-library/hri/hri_systick_l22.h)0
-rw-r--r--watch-library/hardware/hri/hri_tc_l22.h (renamed from watch-library/hri/hri_tc_l22.h)0
-rw-r--r--watch-library/hardware/hri/hri_tcc_l22.h (renamed from watch-library/hri/hri_tcc_l22.h)0
-rw-r--r--watch-library/hardware/hri/hri_trng_l22.h (renamed from watch-library/hri/hri_trng_l22.h)0
-rw-r--r--watch-library/hardware/hri/hri_usb_l22.h (renamed from watch-library/hri/hri_usb_l22.h)0
-rw-r--r--watch-library/hardware/hri/hri_wdt_l22.h (renamed from watch-library/hri/hri_wdt_l22.h)0
-rw-r--r--watch-library/hardware/hw/driver_init.c (renamed from watch-library/hw/driver_init.c)0
-rw-r--r--watch-library/hardware/hw/driver_init.h (renamed from watch-library/hw/driver_init.h)0
-rw-r--r--watch-library/hardware/include/component-version.h (renamed from watch-library/include/component-version.h)0
-rw-r--r--watch-library/hardware/include/component/ac.h (renamed from watch-library/include/component/ac.h)0
-rw-r--r--watch-library/hardware/include/component/adc.h (renamed from watch-library/include/component/adc.h)0
-rw-r--r--watch-library/hardware/include/component/aes.h (renamed from watch-library/include/component/aes.h)0
-rw-r--r--watch-library/hardware/include/component/ccl.h (renamed from watch-library/include/component/ccl.h)0
-rw-r--r--watch-library/hardware/include/component/dmac.h (renamed from watch-library/include/component/dmac.h)0
-rw-r--r--watch-library/hardware/include/component/dsu.h (renamed from watch-library/include/component/dsu.h)0
-rw-r--r--watch-library/hardware/include/component/eic.h (renamed from watch-library/include/component/eic.h)0
-rw-r--r--watch-library/hardware/include/component/evsys.h (renamed from watch-library/include/component/evsys.h)0
-rw-r--r--watch-library/hardware/include/component/freqm.h (renamed from watch-library/include/component/freqm.h)0
-rw-r--r--watch-library/hardware/include/component/gclk.h (renamed from watch-library/include/component/gclk.h)0
-rw-r--r--watch-library/hardware/include/component/mclk.h (renamed from watch-library/include/component/mclk.h)0
-rw-r--r--watch-library/hardware/include/component/mtb.h (renamed from watch-library/include/component/mtb.h)0
-rw-r--r--watch-library/hardware/include/component/nvmctrl.h (renamed from watch-library/include/component/nvmctrl.h)0
-rw-r--r--watch-library/hardware/include/component/osc32kctrl.h (renamed from watch-library/include/component/osc32kctrl.h)0
-rw-r--r--watch-library/hardware/include/component/oscctrl.h (renamed from watch-library/include/component/oscctrl.h)0
-rw-r--r--watch-library/hardware/include/component/pac.h (renamed from watch-library/include/component/pac.h)0
-rw-r--r--watch-library/hardware/include/component/pm.h (renamed from watch-library/include/component/pm.h)0
-rw-r--r--watch-library/hardware/include/component/port.h (renamed from watch-library/include/component/port.h)0
-rw-r--r--watch-library/hardware/include/component/rstc.h (renamed from watch-library/include/component/rstc.h)0
-rw-r--r--watch-library/hardware/include/component/rtc.h (renamed from watch-library/include/component/rtc.h)0
-rw-r--r--watch-library/hardware/include/component/sercom.h (renamed from watch-library/include/component/sercom.h)0
-rw-r--r--watch-library/hardware/include/component/slcd.h (renamed from watch-library/include/component/slcd.h)0
-rw-r--r--watch-library/hardware/include/component/supc.h (renamed from watch-library/include/component/supc.h)0
-rw-r--r--watch-library/hardware/include/component/tc.h (renamed from watch-library/include/component/tc.h)0
-rw-r--r--watch-library/hardware/include/component/tcc.h (renamed from watch-library/include/component/tcc.h)0
-rw-r--r--watch-library/hardware/include/component/trng.h (renamed from watch-library/include/component/trng.h)0
-rw-r--r--watch-library/hardware/include/component/usb.h (renamed from watch-library/include/component/usb.h)0
-rw-r--r--watch-library/hardware/include/component/wdt.h (renamed from watch-library/include/component/wdt.h)0
-rwxr-xr-xwatch-library/hardware/include/core_cm0plus.h (renamed from watch-library/include/core_cm0plus.h)0
-rwxr-xr-xwatch-library/hardware/include/core_cmFunc.h (renamed from watch-library/include/core_cmFunc.h)0
-rwxr-xr-xwatch-library/hardware/include/core_cmInstr.h (renamed from watch-library/include/core_cmInstr.h)0
-rw-r--r--watch-library/hardware/include/instance/ac.h (renamed from watch-library/include/instance/ac.h)0
-rw-r--r--watch-library/hardware/include/instance/adc.h (renamed from watch-library/include/instance/adc.h)0
-rw-r--r--watch-library/hardware/include/instance/aes.h (renamed from watch-library/include/instance/aes.h)0
-rw-r--r--watch-library/hardware/include/instance/ccl.h (renamed from watch-library/include/instance/ccl.h)0
-rw-r--r--watch-library/hardware/include/instance/dmac.h (renamed from watch-library/include/instance/dmac.h)0
-rw-r--r--watch-library/hardware/include/instance/dsu.h (renamed from watch-library/include/instance/dsu.h)0
-rw-r--r--watch-library/hardware/include/instance/eic.h (renamed from watch-library/include/instance/eic.h)0
-rw-r--r--watch-library/hardware/include/instance/evsys.h (renamed from watch-library/include/instance/evsys.h)0
-rw-r--r--watch-library/hardware/include/instance/freqm.h (renamed from watch-library/include/instance/freqm.h)0
-rw-r--r--watch-library/hardware/include/instance/gclk.h (renamed from watch-library/include/instance/gclk.h)0
-rw-r--r--watch-library/hardware/include/instance/mclk.h (renamed from watch-library/include/instance/mclk.h)0
-rw-r--r--watch-library/hardware/include/instance/mtb.h (renamed from watch-library/include/instance/mtb.h)0
-rw-r--r--watch-library/hardware/include/instance/nvmctrl.h (renamed from watch-library/include/instance/nvmctrl.h)0
-rw-r--r--watch-library/hardware/include/instance/osc32kctrl.h (renamed from watch-library/include/instance/osc32kctrl.h)0
-rw-r--r--watch-library/hardware/include/instance/oscctrl.h (renamed from watch-library/include/instance/oscctrl.h)0
-rw-r--r--watch-library/hardware/include/instance/pac.h (renamed from watch-library/include/instance/pac.h)0
-rw-r--r--watch-library/hardware/include/instance/pm.h (renamed from watch-library/include/instance/pm.h)0
-rw-r--r--watch-library/hardware/include/instance/port.h (renamed from watch-library/include/instance/port.h)0
-rw-r--r--watch-library/hardware/include/instance/ptc.h (renamed from watch-library/include/instance/ptc.h)0
-rw-r--r--watch-library/hardware/include/instance/rstc.h (renamed from watch-library/include/instance/rstc.h)0
-rw-r--r--watch-library/hardware/include/instance/rtc.h (renamed from watch-library/include/instance/rtc.h)0
-rw-r--r--watch-library/hardware/include/instance/sercom0.h (renamed from watch-library/include/instance/sercom0.h)0
-rw-r--r--watch-library/hardware/include/instance/sercom1.h (renamed from watch-library/include/instance/sercom1.h)0
-rw-r--r--watch-library/hardware/include/instance/sercom2.h (renamed from watch-library/include/instance/sercom2.h)0
-rw-r--r--watch-library/hardware/include/instance/sercom3.h (renamed from watch-library/include/instance/sercom3.h)0
-rw-r--r--watch-library/hardware/include/instance/sercom4.h (renamed from watch-library/include/instance/sercom4.h)0
-rw-r--r--watch-library/hardware/include/instance/sercom5.h (renamed from watch-library/include/instance/sercom5.h)0
-rw-r--r--watch-library/hardware/include/instance/slcd.h (renamed from watch-library/include/instance/slcd.h)0
-rw-r--r--watch-library/hardware/include/instance/supc.h (renamed from watch-library/include/instance/supc.h)0
-rw-r--r--watch-library/hardware/include/instance/tc0.h (renamed from watch-library/include/instance/tc0.h)0
-rw-r--r--watch-library/hardware/include/instance/tc1.h (renamed from watch-library/include/instance/tc1.h)0
-rw-r--r--watch-library/hardware/include/instance/tc2.h (renamed from watch-library/include/instance/tc2.h)0
-rw-r--r--watch-library/hardware/include/instance/tc3.h (renamed from watch-library/include/instance/tc3.h)0
-rw-r--r--watch-library/hardware/include/instance/tcc0.h (renamed from watch-library/include/instance/tcc0.h)0
-rw-r--r--watch-library/hardware/include/instance/trng.h (renamed from watch-library/include/instance/trng.h)0
-rw-r--r--watch-library/hardware/include/instance/usb.h (renamed from watch-library/include/instance/usb.h)0
-rw-r--r--watch-library/hardware/include/instance/wdt.h (renamed from watch-library/include/instance/wdt.h)0
-rw-r--r--watch-library/hardware/include/pio/saml22g16a.h (renamed from watch-library/include/pio/saml22g16a.h)0
-rw-r--r--watch-library/hardware/include/pio/saml22g17a.h (renamed from watch-library/include/pio/saml22g17a.h)0
-rw-r--r--watch-library/hardware/include/pio/saml22g18a.h (renamed from watch-library/include/pio/saml22g18a.h)0
-rw-r--r--watch-library/hardware/include/pio/saml22j16a.h (renamed from watch-library/include/pio/saml22j16a.h)0
-rw-r--r--watch-library/hardware/include/pio/saml22j17a.h (renamed from watch-library/include/pio/saml22j17a.h)0
-rw-r--r--watch-library/hardware/include/pio/saml22j18a.h (renamed from watch-library/include/pio/saml22j18a.h)0
-rw-r--r--watch-library/hardware/include/pio/saml22n16a.h (renamed from watch-library/include/pio/saml22n16a.h)0
-rw-r--r--watch-library/hardware/include/pio/saml22n17a.h (renamed from watch-library/include/pio/saml22n17a.h)0
-rw-r--r--watch-library/hardware/include/pio/saml22n18a.h (renamed from watch-library/include/pio/saml22n18a.h)0
-rw-r--r--watch-library/hardware/include/sam.h (renamed from watch-library/include/sam.h)0
-rw-r--r--watch-library/hardware/include/saml22.h (renamed from watch-library/include/saml22.h)0
-rw-r--r--watch-library/hardware/include/saml22g16a.h (renamed from watch-library/include/saml22g16a.h)0
-rw-r--r--watch-library/hardware/include/saml22g17a.h (renamed from watch-library/include/saml22g17a.h)0
-rw-r--r--watch-library/hardware/include/saml22g18a.h (renamed from watch-library/include/saml22g18a.h)0
-rw-r--r--watch-library/hardware/include/saml22j16a.h (renamed from watch-library/include/saml22j16a.h)0
-rw-r--r--watch-library/hardware/include/saml22j17a.h (renamed from watch-library/include/saml22j17a.h)0
-rw-r--r--watch-library/hardware/include/saml22j18a.h (renamed from watch-library/include/saml22j18a.h)0
-rw-r--r--watch-library/hardware/include/saml22n16a.h (renamed from watch-library/include/saml22n16a.h)0
-rw-r--r--watch-library/hardware/include/saml22n17a.h (renamed from watch-library/include/saml22n17a.h)0
-rw-r--r--watch-library/hardware/include/saml22n18a.h (renamed from watch-library/include/saml22n18a.h)0
-rw-r--r--watch-library/hardware/include/system_saml22.h (renamed from watch-library/include/system_saml22.h)0
-rwxr-xr-xwatch-library/hardware/linker/saml22j18.ld (renamed from watch-library/linker/saml22j18.ld)0
-rwxr-xr-xwatch-library/hardware/main.c (renamed from watch-library/main.c)0
-rwxr-xr-xwatch-library/hardware/startup_saml22.c (renamed from watch-library/startup_saml22.c)0
-rw-r--r--watch-library/hardware/watch/tusb_config.h (renamed from watch-library/watch/tusb_config.h)0
-rw-r--r--watch-library/hardware/watch/watch.c (renamed from watch-library/watch/watch.c)0
-rw-r--r--watch-library/hardware/watch/watch_adc.c (renamed from watch-library/watch/watch_adc.c)0
-rw-r--r--watch-library/hardware/watch/watch_buzzer.c (renamed from watch-library/watch/watch_buzzer.c)0
-rw-r--r--watch-library/hardware/watch/watch_deepsleep.c (renamed from watch-library/watch/watch_deepsleep.c)0
-rw-r--r--watch-library/hardware/watch/watch_extint.c (renamed from watch-library/watch/watch_extint.c)0
-rw-r--r--watch-library/hardware/watch/watch_gpio.c (renamed from watch-library/watch/watch_gpio.c)0
-rw-r--r--watch-library/hardware/watch/watch_i2c.c (renamed from watch-library/watch/watch_i2c.c)0
-rw-r--r--watch-library/hardware/watch/watch_led.c (renamed from watch-library/watch/watch_led.c)0
-rw-r--r--watch-library/hardware/watch/watch_private.c (renamed from watch-library/watch/watch_private.c)0
-rw-r--r--watch-library/hardware/watch/watch_rtc.c (renamed from watch-library/watch/watch_rtc.c)0
-rw-r--r--watch-library/hardware/watch/watch_slcd.c101
-rw-r--r--watch-library/hardware/watch/watch_uart.c (renamed from watch-library/watch/watch_uart.c)0
-rw-r--r--watch-library/shared/config/RTE_Components.h (renamed from watch-library/config/RTE_Components.h)0
-rw-r--r--watch-library/shared/config/hpl_dmac_config.h (renamed from watch-library/config/hpl_dmac_config.h)0
-rw-r--r--watch-library/shared/config/hpl_eic_config.h (renamed from watch-library/config/hpl_eic_config.h)0
-rw-r--r--watch-library/shared/config/hpl_gclk_config.h (renamed from watch-library/config/hpl_gclk_config.h)0
-rw-r--r--watch-library/shared/config/hpl_mclk_config.h (renamed from watch-library/config/hpl_mclk_config.h)0
-rwxr-xr-xwatch-library/shared/config/hpl_nvmctrl_config.h (renamed from watch-library/config/hpl_nvmctrl_config.h)0
-rw-r--r--watch-library/shared/config/hpl_osc32kctrl_config.h (renamed from watch-library/config/hpl_osc32kctrl_config.h)0
-rw-r--r--watch-library/shared/config/hpl_oscctrl_config.h (renamed from watch-library/config/hpl_oscctrl_config.h)0
-rw-r--r--watch-library/shared/config/hpl_port_config.h (renamed from watch-library/config/hpl_port_config.h)0
-rw-r--r--watch-library/shared/config/hpl_rtc_config.h (renamed from watch-library/config/hpl_rtc_config.h)0
-rw-r--r--watch-library/shared/config/hpl_sercom_config.h (renamed from watch-library/config/hpl_sercom_config.h)0
-rw-r--r--watch-library/shared/config/hpl_slcd_config.h (renamed from watch-library/config/hpl_slcd_config.h)0
-rw-r--r--watch-library/shared/config/hpl_systick_config.h (renamed from watch-library/config/hpl_systick_config.h)0
-rwxr-xr-xwatch-library/shared/config/hpl_trng_config.h (renamed from watch-library/config/hpl_trng_config.h)0
-rwxr-xr-xwatch-library/shared/config/nv_storage_config.h (renamed from watch-library/config/nv_storage_config.h)0
-rw-r--r--watch-library/shared/config/peripheral_clk_config.h (renamed from watch-library/config/peripheral_clk_config.h)0
-rw-r--r--watch-library/shared/driver/lis2dh.c (renamed from watch-library/driver/lis2dh.c)0
-rw-r--r--watch-library/shared/driver/lis2dh.h (renamed from watch-library/driver/lis2dh.h)0
-rw-r--r--watch-library/shared/driver/lis2dw.c (renamed from watch-library/driver/lis2dw.c)0
-rw-r--r--watch-library/shared/driver/lis2dw.h (renamed from watch-library/driver/lis2dw.h)0
-rw-r--r--watch-library/shared/watch/watch.h (renamed from watch-library/watch/watch.h)0
-rw-r--r--watch-library/shared/watch/watch_adc.h (renamed from watch-library/watch/watch_adc.h)17
-rw-r--r--watch-library/shared/watch/watch_app.h (renamed from watch-library/watch/watch_app.h)0
-rw-r--r--watch-library/shared/watch/watch_buzzer.h (renamed from watch-library/watch/watch_buzzer.h)0
-rw-r--r--watch-library/shared/watch/watch_deepsleep.h (renamed from watch-library/watch/watch_deepsleep.h)0
-rw-r--r--watch-library/shared/watch/watch_extint.h (renamed from watch-library/watch/watch_extint.h)0
-rw-r--r--watch-library/shared/watch/watch_gpio.h (renamed from watch-library/watch/watch_gpio.h)0
-rw-r--r--watch-library/shared/watch/watch_i2c.h (renamed from watch-library/watch/watch_i2c.h)0
-rw-r--r--watch-library/shared/watch/watch_led.h (renamed from watch-library/watch/watch_led.h)0
-rw-r--r--watch-library/shared/watch/watch_private.h (renamed from watch-library/watch/watch_private.h)0
-rw-r--r--watch-library/shared/watch/watch_private_display.c137
-rw-r--r--watch-library/shared/watch/watch_private_display.h146
-rw-r--r--watch-library/shared/watch/watch_rtc.h (renamed from watch-library/watch/watch_rtc.h)0
-rw-r--r--watch-library/shared/watch/watch_slcd.h (renamed from watch-library/watch/watch_slcd.h)0
-rw-r--r--watch-library/shared/watch/watch_uart.h (renamed from watch-library/watch/watch_uart.h)0
-rw-r--r--watch-library/shared/watch/watch_utility.c (renamed from watch-library/watch/watch_utility.c)0
-rw-r--r--watch-library/shared/watch/watch_utility.h (renamed from watch-library/watch/watch_utility.h)0
-rw-r--r--watch-library/simulator/hpl/port/hpl_gpio_base.h87
-rw-r--r--watch-library/simulator/main.c70
-rw-r--r--watch-library/simulator/shell.html368
-rw-r--r--watch-library/simulator/watch/watch.c9
-rw-r--r--watch-library/simulator/watch/watch_adc.c48
-rw-r--r--watch-library/simulator/watch/watch_buzzer.c60
-rw-r--r--watch-library/simulator/watch/watch_deepsleep.c99
-rw-r--r--watch-library/simulator/watch/watch_extint.c191
-rw-r--r--watch-library/simulator/watch/watch_gpio.c47
-rw-r--r--watch-library/simulator/watch/watch_i2c.c51
-rw-r--r--watch-library/simulator/watch/watch_led.c63
-rw-r--r--watch-library/simulator/watch/watch_private.c78
-rw-r--r--watch-library/simulator/watch/watch_rtc.c223
-rw-r--r--watch-library/simulator/watch/watch_slcd.c115
-rw-r--r--watch-library/simulator/watch/watch_uart.c65
-rw-r--r--watch-library/watch/watch_slcd.c318
327 files changed, 2303 insertions, 570 deletions
diff --git a/apps/beats-time/app.c b/apps/beats-time/app.c
index 3a8c2dac..ef27ffef 100644
--- a/apps/beats-time/app.c
+++ b/apps/beats-time/app.c
@@ -3,7 +3,7 @@
#include <math.h>
#include "watch.h"
-const uint8_t UTC_OFFSET = 4; // set to your current UTC offset to see correct beats time
+const int8_t UTC_OFFSET = 4; // set to your current UTC offset to see correct beats time
const uint8_t BEAT_REFRESH_FREQUENCY = 8;
typedef enum ApplicationMode {
@@ -160,7 +160,7 @@ float clock2beats(uint16_t hours, uint16_t minutes, uint16_t seconds, int16_t ut
float beats = seconds + ((float)application_state.subsecond / (float)BEAT_REFRESH_FREQUENCY);
beats += 60 * minutes;
beats += (float)hours * 60 * 60;
- beats += (utc_offset + 1) * 60 * 60; // offset from utc + 1 since beats in in UTC+1
+ beats += (1 - utc_offset) * 60 * 60; // offset from utc + 1 since beats in in UTC+1
beats /= 86.4; // convert to beats
while(beats > 1000) beats -= 1000; // beats %= 1000 but for a float
diff --git a/make.mk b/make.mk
index 1b688ae5..94d0bd82 100644
--- a/make.mk
+++ b/make.mk
@@ -9,17 +9,18 @@ endif
##############################################################################
.PHONY: all directory clean size
-CC = arm-none-eabi-gcc
-OBJCOPY = arm-none-eabi-objcopy
-SIZE = arm-none-eabi-size
-UF2 = python $(TOP)/utils/uf2conv.py
-
ifeq ($(OS), Windows_NT)
MKDIR = gmkdir
else
MKDIR = mkdir
endif
+ifndef EMSCRIPTEN
+CC = arm-none-eabi-gcc
+OBJCOPY = arm-none-eabi-objcopy
+SIZE = arm-none-eabi-size
+UF2 = python $(TOP)/utils/uf2conv.py
+
CFLAGS += -W -Wall -Wextra -Wmissing-prototypes -Wmissing-declarations
CFLAGS += --std=gnu99 -Os
CFLAGS += -fno-diagnostics-show-caret
@@ -30,40 +31,41 @@ CFLAGS += -MD -MP -MT $(BUILD)/$(*F).o -MF $(BUILD)/$(@F).d
LDFLAGS += -mcpu=cortex-m0plus -mthumb
LDFLAGS += -Wl,--gc-sections
-LDFLAGS += -Wl,--script=$(TOP)//watch-library/linker/saml22j18.ld
+LDFLAGS += -Wl,--script=$(TOP)/watch-library/hardware/linker/saml22j18.ld
LIBS += -lm
INCLUDES += \
-I$(TOP)/tinyusb/src \
-I$(TOP)/boards/$(BOARD) \
- -I$(TOP)/watch-library/include \
- -I$(TOP)/watch-library/hal/ \
- -I$(TOP)/watch-library/hal/documentation/ \
- -I$(TOP)/watch-library/hal/include/ \
- -I$(TOP)/watch-library/hal/src/ \
- -I$(TOP)/watch-library/hal/utils/ \
- -I$(TOP)/watch-library/hal/utils/include/ \
- -I$(TOP)/watch-library/hal/utils/src/ \
- -I$(TOP)/watch-library/hpl/ \
- -I$(TOP)/watch-library/hpl/core/ \
- -I$(TOP)/watch-library/hpl/dmac/ \
- -I$(TOP)/watch-library/hpl/eic/ \
- -I$(TOP)/watch-library/hpl/gclk/ \
- -I$(TOP)/watch-library/hpl/mclk/ \
- -I$(TOP)/watch-library/hpl/osc32kctrl/ \
- -I$(TOP)/watch-library/hpl/oscctrl/ \
- -I$(TOP)/watch-library/hpl/pm/ \
- -I$(TOP)/watch-library/hpl/port/ \
- -I$(TOP)/watch-library/hpl/sercom/ \
- -I$(TOP)/watch-library/hpl/slcd/ \
- -I$(TOP)/watch-library/hpl/systick/ \
- -I$(TOP)/watch-library/hri/ \
- -I$(TOP)/watch-library/config/ \
- -I$(TOP)/watch-library/hw/ \
- -I$(TOP)/watch-library/watch/ \
- -I$(TOP)/watch-library/driver/ \
- -I$(TOP)/watch-library
+ -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 \
SRCS += \
$(TOP)/tinyusb/src/tusb.c \
@@ -72,55 +74,92 @@ SRCS += \
$(TOP)/tinyusb/src/device/usbd.c \
$(TOP)/tinyusb/src/device/usbd_control.c \
$(TOP)/tinyusb/src/portable/microchip/samd/dcd_samd.c \
- $(TOP)/watch-library/main.c \
- $(TOP)/watch-library/startup_saml22.c \
- $(TOP)/watch-library/hw/driver_init.c \
- $(TOP)/watch-library/watch/watch_rtc.c \
- $(TOP)/watch-library/watch/watch_slcd.c \
- $(TOP)/watch-library/watch/watch_extint.c \
- $(TOP)/watch-library/watch/watch_led.c \
- $(TOP)/watch-library/watch/watch_buzzer.c \
- $(TOP)/watch-library/watch/watch_adc.c \
- $(TOP)/watch-library/watch/watch_gpio.c \
- $(TOP)/watch-library/watch/watch_i2c.c \
- $(TOP)/watch-library/watch/watch_uart.c \
- $(TOP)/watch-library/watch/watch_deepsleep.c \
- $(TOP)/watch-library/watch/watch_utility.c \
- $(TOP)/watch-library/watch/watch_private.c \
- $(TOP)/watch-library/watch/watch.c \
- $(TOP)/watch-library/hal/src/hal_atomic.c \
- $(TOP)/watch-library/hal/src/hal_delay.c \
- $(TOP)/watch-library/hal/src/hal_ext_irq.c \
- $(TOP)/watch-library/hal/src/hal_gpio.c \
- $(TOP)/watch-library/hal/src/hal_i2c_m_sync.c \
- $(TOP)/watch-library/hal/src/hal_spi_m_sync.c \
- $(TOP)/watch-library/hal/src/hal_init.c \
- $(TOP)/watch-library/hal/src/hal_io.c \
- $(TOP)/watch-library/hal/src/hal_slcd_sync.c \
- $(TOP)/watch-library/hal/src/hal_sleep.c \
- $(TOP)/watch-library/hal/utils/src/utils_assert.c \
- $(TOP)/watch-library/hal/utils/src/utils_event.c \
- $(TOP)/watch-library/hal/utils/src/utils_list.c \
- $(TOP)/watch-library/hal/utils/src/utils_syscalls.c \
- $(TOP)/watch-library/hpl/core/hpl_core_m0plus_base.c \
- $(TOP)/watch-library/hpl/core/hpl_init.c \
- $(TOP)/watch-library/hpl/dmac/hpl_dmac.c \
- $(TOP)/watch-library/hpl/eic/hpl_eic.c \
- $(TOP)/watch-library/hpl/gclk/hpl_gclk.c \
- $(TOP)/watch-library/hpl/mclk/hpl_mclk.c \
- $(TOP)/watch-library/hpl/osc32kctrl/hpl_osc32kctrl.c \
- $(TOP)/watch-library/hpl/oscctrl/hpl_oscctrl.c \
- $(TOP)/watch-library/hpl/pm/hpl_pm.c \
- $(TOP)/watch-library/hpl/sercom/hpl_sercom.c \
- $(TOP)/watch-library/hpl/slcd/hpl_slcd.c \
- $(TOP)/watch-library/hpl/systick/hpl_systick.c \
- $(TOP)/watch-library/driver/lis2dh.c \
- $(TOP)/watch-library/driver/lis2dw.c \
+ $(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 \
+ $(TOP)/watch-library/hardware/watch/watch_uart.c \
+ $(TOP)/watch-library/hardware/watch/watch_deepsleep.c \
+ $(TOP)/watch-library/hardware/watch/watch_private.c \
+ $(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 \
+ $(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/lis2dh.c \
+ $(TOP)/watch-library/shared/driver/lis2dw.c \
+ $(TOP)/watch-library/shared/watch/watch_private_display.c \
+ $(TOP)/watch-library/shared/watch/watch_utility.c \
DEFINES += \
-D__SAML22J18A__ \
-DDONT_USE_CMSIS_INIT
+else
+
+CFLAGS += -W -Wall -Wextra -Wmissing-prototypes -Wmissing-declarations
+CFLAGS += -Wno-format -Wno-unused-parameter
+
+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/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 \
+ $(TOP)/watch-library/simulator/watch/watch_uart.c \
+ $(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/watch/watch_private_display.c \
+ $(TOP)/watch-library/shared/watch/watch_utility.c \
+
+endif
+
ifeq ($(LED), BLUE)
CFLAGS += -DWATCH_SWAP_LED_PINS
endif
diff --git a/movement/README.md b/movement/README.md
index 0e1c3b40..5d5b0e2f 100644
--- a/movement/README.md
+++ b/movement/README.md
@@ -22,13 +22,13 @@ A fifth optional function, `watch_face_wants_background_task`, will be added to
To create a new watch face, you should create a new C header and source file in the watch-faces folder (i.e. for a watch face that displays moon phases: `moon_phase_face.h`, `moon_phase_face.c`), and implement these functions with your own unique prefix (i.e. `moon_phase_face_setup`). Then declare your watch face in your header file as follows:
```c
-static const watch_face_t moon_phase_face = {
- moon_phase_face_setup,
- moon_phase_face_activate,
- moon_phase_face_loop,
- moon_phase_face_resign,
- NULL // or moon_phase_face_wants_background_task, if you implemented this function
-};
+#define moon_phase_face ((const watch_face_t){ \
+ moon_phase_face_setup, \
+ moon_phase_face_activate, \
+ moon_phase_face_loop, \
+ moon_phase_face_resign, \
+ NULL, /* or moon_phase_face_wants_background_task, if you implemented this function */ \
+})
```
This section will go over how each function works. The section headings use the watch_face prefix, but know that you should implement each function with your own prefix as described above.
@@ -96,13 +96,13 @@ void pulsometer_face_activate(movement_settings_t *settings, void *context);
bool pulsometer_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
void pulsometer_face_resign(movement_settings_t *settings, void *context);
-static const watch_face_t pulsometer_face = {
- pulsometer_face_setup,
- pulsometer_face_activate,
- pulsometer_face_loop,
- pulsometer_face_resign,
- NULL
-};
+#define pulsometer_face ((const watch_face_t){ \
+ pulsometer_face_setup, \
+ pulsometer_face_activate, \
+ pulsometer_face_loop, \
+ pulsometer_face_resign, \
+ NULL, \
+})
```
### pulsometer_face.c
diff --git a/movement/lib/TOTP-MCU/TOTP.c b/movement/lib/TOTP-MCU/TOTP.c
index d977d06e..02858611 100644
--- a/movement/lib/TOTP-MCU/TOTP.c
+++ b/movement/lib/TOTP-MCU/TOTP.c
@@ -17,7 +17,7 @@ void setTimezone(uint8_t timezone){
_timeZoneOffset = timezone;
}
-uint32_t TimeStruct2Timestamp(struct tm time){
+static uint32_t TimeStruct2Timestamp(struct tm time){
//time.tm_mon -= 1;
//time.tm_year -= 1900;
return mktime(&(time)) - (_timeZoneOffset * 3600) - 2208988800;
diff --git a/movement/lib/TOTP-MCU/sha1.c b/movement/lib/TOTP-MCU/sha1.c
index 3ac14856..21a24fa5 100644
--- a/movement/lib/TOTP-MCU/sha1.c
+++ b/movement/lib/TOTP-MCU/sha1.c
@@ -34,11 +34,11 @@ void init(void) {
bufferOffset = 0;
}
-uint32_t rol32(uint32_t number, uint8_t bits) {
+static uint32_t rol32(uint32_t number, uint8_t bits) {
return ((number << bits) | (uint32_t)(number >> (32-bits)));
}
-void hashBlock(void) {
+static void hashBlock(void) {
uint8_t i;
uint32_t a,b,c,d,e,t;
@@ -75,7 +75,7 @@ void hashBlock(void) {
state.w[4] += e;
}
-void addUncounted(uint8_t data) {
+static void addUncounted(uint8_t data) {
buffer.b[bufferOffset ^ 3] = data;
bufferOffset++;
if (bufferOffset == BLOCK_LENGTH) {
@@ -97,7 +97,7 @@ void writeArray(uint8_t *buffer, uint8_t size){
}
}
-void pad(void) {
+static void pad(void) {
// Implement SHA-1 padding (fips180-2 ��5.1.1)
// Pad with 0x80 followed by 0x00 until the end of the block
diff --git a/movement/movement.c b/movement/movement.c
index 3dc1c060..d15c349f 100644
--- a/movement/movement.c
+++ b/movement/movement.c
@@ -29,6 +29,10 @@
#include "movement.h"
#include "movement_config.h"
+#if __EMSCRIPTEN__
+#include <emscripten.h>
+#endif
+
movement_state_t movement_state;
void * watch_face_contexts[MOVEMENT_NUM_FACES];
watch_date_time scheduled_tasks[MOVEMENT_NUM_FACES];
@@ -149,7 +153,16 @@ static void _movement_handle_scheduled_tasks(void) {
void movement_request_tick_frequency(uint8_t freq) {
if (freq == 128) return; // Movement uses the 128 Hz tick internally
- RTC->MODE2.INTENCLR.reg = 0xFE; // disable all callbacks except the 128 Hz one
+
+ // disable all callbacks except the 128 Hz one
+#if __EMSCRIPTEN__
+ for (int i = 1; i < 128; i = i << 1) {
+ watch_rtc_disable_periodic_callback(i);
+ }
+#else
+ RTC->MODE2.INTENCLR.reg = 0xFE;
+#endif
+
movement_state.subsecond = 0;
movement_state.tick_frequency = freq;
if (freq) watch_rtc_register_periodic_callback(cb_tick, freq);
@@ -215,6 +228,18 @@ void app_init(void) {
movement_state.light_ticks = -1;
movement_state.alarm_ticks = -1;
_movement_reset_inactivity_countdown();
+
+#if __EMSCRIPTEN__
+ int32_t time_zone_offset = EM_ASM_INT({
+ return -new Date().getTimezoneOffset();
+ });
+ for (int i = 0, count = sizeof(movement_timezone_offsets) / sizeof(movement_timezone_offsets[0]); i < count; i++) {
+ if (movement_timezone_offsets[i] == time_zone_offset) {
+ movement_state.settings.bit.time_zone = i;
+ break;
+ }
+ }
+#endif
}
void app_wake_from_backup(void) {
diff --git a/movement/watch_faces/clock/simple_clock_face.h b/movement/watch_faces/clock/simple_clock_face.h
index 98f997bf..6e8665bf 100644
--- a/movement/watch_faces/clock/simple_clock_face.h
+++ b/movement/watch_faces/clock/simple_clock_face.h
@@ -39,12 +39,12 @@ bool simple_clock_face_loop(movement_event_t event, movement_settings_t *setting
void simple_clock_face_resign(movement_settings_t *settings, void *context);
bool simple_clock_face_wants_background_task(movement_settings_t *settings, void *context);
-static const watch_face_t simple_clock_face = {
- simple_clock_face_setup,
- simple_clock_face_activate,
- simple_clock_face_loop,
- simple_clock_face_resign,
- simple_clock_face_wants_background_task
-};
+#define simple_clock_face ((const watch_face_t){ \
+ simple_clock_face_setup, \
+ simple_clock_face_activate, \
+ simple_clock_face_loop, \
+ simple_clock_face_resign, \
+ simple_clock_face_wants_background_task, \
+})
#endif // SIMPLE_CLOCK_FACE_H_
diff --git a/movement/watch_faces/clock/world_clock_face.h b/movement/watch_faces/clock/world_clock_face.h
index b519bc85..36960f53 100644
--- a/movement/watch_faces/clock/world_clock_face.h
+++ b/movement/watch_faces/clock/world_clock_face.h
@@ -46,12 +46,12 @@ void world_clock_face_resign(movement_settings_t *settings, void *context);
uint8_t world_clock_face_get_weekday(uint16_t day, uint16_t month, uint16_t year);
-static const watch_face_t world_clock_face = {
- world_clock_face_setup,
- world_clock_face_activate,
- world_clock_face_loop,
- world_clock_face_resign,
- NULL
-};
+#define world_clock_face ((const watch_face_t){ \
+ world_clock_face_setup, \
+ world_clock_face_activate, \
+ world_clock_face_loop, \
+ world_clock_face_resign, \
+ NULL, \
+})
#endif // WORLD_CLOCK_FACE_H_
diff --git a/movement/watch_faces/complications/beats_face.c b/movement/watch_faces/complications/beats_face.c
index d1466b33..df31ad1c 100644
--- a/movement/watch_faces/complications/beats_face.c
+++ b/movement/watch_faces/complications/beats_face.c
@@ -45,7 +45,7 @@ bool beats_face_loop(movement_event_t event, movement_settings_t *settings, void
state->next_subsecond_update = (event.subsecond + 1 + (BEAT_REFRESH_FREQUENCY * 2 / 3)) % BEAT_REFRESH_FREQUENCY;
state->last_centibeat_displayed = centibeats;
}
- sprintf(buf, "bt %6ld", centibeats);
+ sprintf(buf, "bt %6lu", centibeats);
watch_display_string(buf, 0);
break;
@@ -53,7 +53,7 @@ bool beats_face_loop(movement_event_t event, movement_settings_t *settings, void
if (!watch_tick_animation_is_running()) watch_start_tick_animation(432);
date_time = watch_rtc_get_date_time();
centibeats = clock2beats(date_time.unit.hour, date_time.unit.minute, date_time.unit.second, event.subsecond, movement_timezone_offsets[settings->bit.time_zone]);
- sprintf(buf, "bt %4ld ", centibeats / 100);
+ sprintf(buf, "bt %4lu ", centibeats / 100);
watch_display_string(buf, 0);
break;
diff --git a/movement/watch_faces/complications/beats_face.h b/movement/watch_faces/complications/beats_face.h
index f11126d1..2bbbc26d 100644
--- a/movement/watch_faces/complications/beats_face.h
+++ b/movement/watch_faces/complications/beats_face.h
@@ -14,12 +14,12 @@ void beats_face_activate(movement_settings_t *settings, void *context);
bool beats_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
void beats_face_resign(movement_settings_t *settings, void *context);
-static const watch_face_t beats_face = {
- beats_face_setup,
- beats_face_activate,
- beats_face_loop,
- beats_face_resign,
- NULL
-};
+#define beats_face ((const watch_face_t){ \
+ beats_face_setup, \
+ beats_face_activate, \
+ beats_face_loop, \
+ beats_face_resign, \
+ NULL, \
+})
#endif // BEATS_FACE_H_ \ No newline at end of file
diff --git a/movement/watch_faces/complications/blinky_face.h b/movement/watch_faces/complications/blinky_face.h
index 14f0e143..e966ab1d 100644
--- a/movement/watch_faces/complications/blinky_face.h
+++ b/movement/watch_faces/complications/blinky_face.h
@@ -38,12 +38,12 @@ void blinky_face_activate(movement_settings_t *settings, void *context);
bool blinky_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
void blinky_face_resign(movement_settings_t *settings, void *context);
-static const watch_face_t blinky_face = {
- blinky_face_setup,
- blinky_face_activate,
- blinky_face_loop,
- blinky_face_resign,
- NULL
-};
+#define blinky_face ((const watch_face_t){ \
+ blinky_face_setup, \
+ blinky_face_activate, \
+ blinky_face_loop, \
+ blinky_face_resign, \
+ NULL, \
+})
-#endif // BLINKY_FACE_H_ \ No newline at end of file
+#endif // BLINKY_FACE_H_
diff --git a/movement/watch_faces/complications/countdown_face.h b/movement/watch_faces/complications/countdown_face.h
index 1a5d2c78..657c6377 100644
--- a/movement/watch_faces/complications/countdown_face.h
+++ b/movement/watch_faces/complications/countdown_face.h
@@ -58,12 +58,12 @@ void countdown_face_activate(movement_settings_t *settings, void *context);
bool countdown_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
void countdown_face_resign(movement_settings_t *settings, void *context);
-static const watch_face_t countdown_face = {
- countdown_face_setup,
- countdown_face_activate,
- countdown_face_loop,
- countdown_face_resign,
- NULL
-};
+#define countdown_face ((const watch_face_t){ \
+ countdown_face_setup, \
+ countdown_face_activate, \
+ countdown_face_loop, \
+ countdown_face_resign, \
+ NULL, \
+})
#endif // COUNTDOWN_FACE_H_
diff --git a/movement/watch_faces/complications/day_one_face.c b/movement/watch_faces/complications/day_one_face.c
index 18d02d4d..99433990 100644
--- a/movement/watch_faces/complications/day_one_face.c
+++ b/movement/watch_faces/complications/day_one_face.c
@@ -37,7 +37,7 @@ static void _day_one_face_update(day_one_state_t state) {
watch_date_time date_time = watch_rtc_get_date_time();
uint32_t julian_date = _day_one_face_juliandaynum(date_time.unit.year + WATCH_RTC_REFERENCE_YEAR, date_time.unit.month, date_time.unit.day);
uint32_t julian_birthdate = _day_one_face_juliandaynum(state.birth_year, state.birth_month, state.birth_day);
- sprintf(buf, "DA %6ld", julian_date - julian_birthdate);
+ sprintf(buf, "DA %6lu", julian_date - julian_birthdate);
watch_display_string(buf, 0);
}
diff --git a/movement/watch_faces/complications/day_one_face.h b/movement/watch_faces/complications/day_one_face.h
index f39c7927..ab8372bf 100644
--- a/movement/watch_faces/complications/day_one_face.h
+++ b/movement/watch_faces/complications/day_one_face.h
@@ -44,12 +44,12 @@ void day_one_face_activate(movement_settings_t *settings, void *context);
bool day_one_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
void day_one_face_resign(movement_settings_t *settings, void *context);
-static const watch_face_t day_one_face = {
- day_one_face_setup,
- day_one_face_activate,
- day_one_face_loop,
- day_one_face_resign,
- NULL
-};
+#define day_one_face ((const watch_face_t){ \
+ day_one_face_setup, \
+ day_one_face_activate, \
+ day_one_face_loop, \
+ day_one_face_resign, \
+ NULL, \
+})
#endif // DAY_ONE_FACE_H_
diff --git a/movement/watch_faces/complications/pulsometer_face.h b/movement/watch_faces/complications/pulsometer_face.h
index 65188604..600201e9 100644
--- a/movement/watch_faces/complications/pulsometer_face.h
+++ b/movement/watch_faces/complications/pulsometer_face.h
@@ -38,12 +38,12 @@ void pulsometer_face_activate(movement_settings_t *settings, void *context);
bool pulsometer_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
void pulsometer_face_resign(movement_settings_t *settings, void *context);
-static const watch_face_t pulsometer_face = {
- pulsometer_face_setup,
- pulsometer_face_activate,
- pulsometer_face_loop,
- pulsometer_face_resign,
- NULL
-};
+#define pulsometer_face ((const watch_face_t){ \
+ pulsometer_face_setup, \
+ pulsometer_face_activate, \
+ pulsometer_face_loop, \
+ pulsometer_face_resign, \
+ NULL, \
+})
-#endif // PULSOMETER_FACE_H_ \ No newline at end of file
+#endif // PULSOMETER_FACE_H_
diff --git a/movement/watch_faces/complications/stopwatch_face.h b/movement/watch_faces/complications/stopwatch_face.h
index ff0c1796..c6e3aadb 100644
--- a/movement/watch_faces/complications/stopwatch_face.h
+++ b/movement/watch_faces/complications/stopwatch_face.h
@@ -15,12 +15,12 @@ void stopwatch_face_activate(movement_settings_t *settings, void *context);
bool stopwatch_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
void stopwatch_face_resign(movement_settings_t *settings, void *context);
-static const watch_face_t stopwatch_face = {
- stopwatch_face_setup,
- stopwatch_face_activate,
- stopwatch_face_loop,
- stopwatch_face_resign,
- NULL
-};
+#define stopwatch_face ((const watch_face_t){ \
+ stopwatch_face_setup, \
+ stopwatch_face_activate, \
+ stopwatch_face_loop, \
+ stopwatch_face_resign, \
+ NULL, \
+})
-#endif // STOPWATCH_FACE_H_ \ No newline at end of file
+#endif // STOPWATCH_FACE_H_
diff --git a/movement/watch_faces/complications/sunrise_sunset_face.h b/movement/watch_faces/complications/sunrise_sunset_face.h
index 196b9db0..826d5e95 100644
--- a/movement/watch_faces/complications/sunrise_sunset_face.h
+++ b/movement/watch_faces/complications/sunrise_sunset_face.h
@@ -52,12 +52,12 @@ void sunrise_sunset_face_activate(movement_settings_t *settings, void *context);
bool sunrise_sunset_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
void sunrise_sunset_face_resign(movement_settings_t *settings, void *context);
-static const watch_face_t sunrise_sunset_face = {
- sunrise_sunset_face_setup,
- sunrise_sunset_face_activate,
- sunrise_sunset_face_loop,
- sunrise_sunset_face_resign,
- NULL
-};
+#define sunrise_sunset_face ((const watch_face_t){ \
+ sunrise_sunset_face_setup, \
+ sunrise_sunset_face_activate, \
+ sunrise_sunset_face_loop, \
+ sunrise_sunset_face_resign, \
+ NULL, \
+})
#endif // SUNRISE_SUNSET_FACE_H_
diff --git a/movement/watch_faces/complications/totp_face.h b/movement/watch_faces/complications/totp_face.h
index 1e2c5c02..dfa4a6d0 100644
--- a/movement/watch_faces/complications/totp_face.h
+++ b/movement/watch_faces/complications/totp_face.h
@@ -15,12 +15,12 @@ void totp_face_activate(movement_settings_t *settings, void *context);
bool totp_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
void totp_face_resign(movement_settings_t *settings, void *context);
-static const watch_face_t totp_face = {
- totp_face_setup,
- totp_face_activate,
- totp_face_loop,
- totp_face_resign,
- NULL
-};
+#define totp_face ((const watch_face_t){ \
+ totp_face_setup, \
+ totp_face_activate, \
+ totp_face_loop, \
+ totp_face_resign, \
+ NULL, \
+})
#endif // TOTP_FACE_H_
diff --git a/movement/watch_faces/demos/character_set_face.h b/movement/watch_faces/demos/character_set_face.h
index a6c8e17d..82627aed 100644
--- a/movement/watch_faces/demos/character_set_face.h
+++ b/movement/watch_faces/demos/character_set_face.h
@@ -32,12 +32,12 @@ void character_set_face_activate(movement_settings_t *settings, void *context);
bool character_set_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
void character_set_face_resign(movement_settings_t *settings, void *context);
-static const watch_face_t character_set_face = {
- character_set_face_setup,
- character_set_face_activate,
- character_set_face_loop,
- character_set_face_resign,
- NULL
-};
+#define character_set_face ((const watch_face_t){ \
+ character_set_face_setup, \
+ character_set_face_activate, \
+ character_set_face_loop, \
+ character_set_face_resign, \
+ NULL, \
+})
-#endif // CHARACTER_SET_FACE_H_ \ No newline at end of file
+#endif // CHARACTER_SET_FACE_H_
diff --git a/movement/watch_faces/demos/demo_face.h b/movement/watch_faces/demos/demo_face.h
index 6eb4298d..026e0d10 100644
--- a/movement/watch_faces/demos/demo_face.h
+++ b/movement/watch_faces/demos/demo_face.h
@@ -32,12 +32,12 @@ void demo_face_activate(movement_settings_t *settings, void *context);
bool demo_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
void demo_face_resign(movement_settings_t *settings, void *context);
-static const watch_face_t demo_face = {
- demo_face_setup,
- demo_face_activate,
- demo_face_loop,
- demo_face_resign,
- NULL
-};
+#define demo_face ((const watch_face_t){ \
+ demo_face_setup, \
+ demo_face_activate, \
+ demo_face_loop, \
+ demo_face_resign, \
+ NULL, \
+})
-#endif // DEMO_FACE_H_ \ No newline at end of file
+#endif // DEMO_FACE_H_
diff --git a/movement/watch_faces/demos/hello_there_face.h b/movement/watch_faces/demos/hello_there_face.h
index c444e016..1140bb20 100644
--- a/movement/watch_faces/demos/hello_there_face.h
+++ b/movement/watch_faces/demos/hello_there_face.h
@@ -37,12 +37,12 @@ void hello_there_face_activate(movement_settings_t *settings, void *context);
bool hello_there_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
void hello_there_face_resign(movement_settings_t *settings, void *context);
-static const watch_face_t hello_there_face = {
- hello_there_face_setup,
- hello_there_face_activate,
- hello_there_face_loop,
- hello_there_face_resign,
- NULL
-};
+#define hello_there_face ((const watch_face_t){ \
+ hello_there_face_setup, \
+ hello_there_face_activate, \
+ hello_there_face_loop, \
+ hello_there_face_resign, \
+ NULL, \
+})
#endif // HELLO_THERE_FACE_H_
diff --git a/movement/watch_faces/demos/lis2dh_logging_face.c b/movement/watch_faces/demos/lis2dh_logging_face.c
index 08b265b6..31d1cad7 100644
--- a/movement/watch_faces/demos/lis2dh_logging_face.c
+++ b/movement/watch_faces/demos/lis2dh_logging_face.c
@@ -36,10 +36,11 @@
// Pressing the alarm button enters the log mode, where the main display shows the number of interrupts detected in each of the last
// 24 hours (the hour is shown in the top right digit and AM/PM indicator, if the clock is set to 12 hour mode)
-static void _lis2dh_logging_face_update_display(movement_settings_t *settings, lis2dh_logger_state_t *logger_state, lis2dh_interrupt_state interrupt_state, watch_date_time date_time) {
+static void _lis2dh_logging_face_update_display(movement_settings_t *settings, lis2dh_logger_state_t *logger_state, lis2dh_interrupt_state interrupt_state) {
char buf[14];
char time_indication_character;
int8_t pos;
+ watch_date_time date_time;
if (logger_state->log_ticks) {
pos = (logger_state->data_points - 1 - logger_state->display_index) % LIS2DH_LOGGING_NUM_DATA_POINTS;
@@ -58,16 +59,16 @@ static void _lis2dh_logging_face_update_display(movement_settings_t *settings, l
}
switch (logger_state->axis_index) {
case 0:
- sprintf(buf, "3A%2d%02d%4ld", date_time.unit.hour, date_time.unit.minute, logger_state->data[pos].x_interrupts + logger_state->data[pos].y_interrupts + logger_state->data[pos].z_interrupts);
+ sprintf(buf, "3A%2d%02d%4lu", date_time.unit.hour, date_time.unit.minute, logger_state->data[pos].x_interrupts + logger_state->data[pos].y_interrupts + logger_state->data[pos].z_interrupts);
break;
case 1:
- sprintf(buf, "XA%2d%02d%4ld", date_time.unit.hour, date_time.unit.minute, logger_state->data[pos].x_interrupts);
+ sprintf(buf, "XA%2d%02d%4lu", date_time.unit.hour, date_time.unit.minute, logger_state->data[pos].x_interrupts);
break;
case 2:
- sprintf(buf, "YA%2d%02d%4ld", date_time.unit.hour, date_time.unit.minute, logger_state->data[pos].y_interrupts);
+ sprintf(buf, "YA%2d%02d%4lu", date_time.unit.hour, date_time.unit.minute, logger_state->data[pos].y_interrupts);
break;
case 3:
- sprintf(buf, "ZA%2d%02d%4ld", date_time.unit.hour, date_time.unit.minute, logger_state->data[pos].z_interrupts);
+ sprintf(buf, "ZA%2d%02d%4lu", date_time.unit.hour, date_time.unit.minute, logger_state->data[pos].z_interrupts);
break;
}
}
@@ -145,7 +146,6 @@ void lis2dh_logging_face_activate(movement_settings_t *settings, void *context)
bool lis2dh_logging_face_loop(movement_event_t event, movement_settings_t *settings, void *context) {
lis2dh_logger_state_t *logger_state = (lis2dh_logger_state_t *)context;
lis2dh_interrupt_state interrupt_state = 0;
- watch_date_time date_time;
switch (event.event_type) {
case EVENT_MODE_BUTTON_UP:
@@ -157,13 +157,13 @@ bool lis2dh_logging_face_loop(movement_event_t event, movement_settings_t *setti
case EVENT_LIGHT_BUTTON_DOWN:
logger_state->axis_index = (logger_state->axis_index + 1) % 4;
logger_state->log_ticks = 255;
- _lis2dh_logging_face_update_display(settings, logger_state, interrupt_state, date_time);
+ _lis2dh_logging_face_update_display(settings, logger_state, interrupt_state);
break;
case EVENT_ALARM_BUTTON_UP:
if (logger_state->log_ticks) logger_state->display_index = (logger_state->display_index + 1) % LIS2DH_LOGGING_NUM_DATA_POINTS;
logger_state->log_ticks = 255;
logger_state->axis_index = 0;
- _lis2dh_logging_face_update_display(settings, logger_state, interrupt_state, date_time);
+ _lis2dh_logging_face_update_display(settings, logger_state, interrupt_state);
break;
case EVENT_ACTIVATE:
case EVENT_TICK:
@@ -182,7 +182,7 @@ bool lis2dh_logging_face_loop(movement_event_t event, movement_settings_t *setti
} else {
watch_clear_indicator(WATCH_INDICATOR_SIGNAL);
}
- _lis2dh_logging_face_update_display(settings, logger_state, interrupt_state, date_time);
+ _lis2dh_logging_face_update_display(settings, logger_state, interrupt_state);
break;
case EVENT_BACKGROUND_TASK:
_lis2dh_logging_face_log_data(logger_state);
diff --git a/movement/watch_faces/demos/lis2dh_logging_face.h b/movement/watch_faces/demos/lis2dh_logging_face.h
index 22ecd2d9..49366542 100644
--- a/movement/watch_faces/demos/lis2dh_logging_face.h
+++ b/movement/watch_faces/demos/lis2dh_logging_face.h
@@ -55,12 +55,12 @@ bool lis2dh_logging_face_loop(movement_event_t event, movement_settings_t *setti
void lis2dh_logging_face_resign(movement_settings_t *settings, void *context);
bool lis2dh_logging_face_wants_background_task(movement_settings_t *settings, void *context);
-static const watch_face_t lis2dh_logging_face = {
- lis2dh_logging_face_setup,
- lis2dh_logging_face_activate,
- lis2dh_logging_face_loop,
- lis2dh_logging_face_resign,
- lis2dh_logging_face_wants_background_task
-};
+#define lis2dh_logging_face ((const watch_face_t){ \
+ lis2dh_logging_face_setup, \
+ lis2dh_logging_face_activate, \
+ lis2dh_logging_face_loop, \
+ lis2dh_logging_face_resign, \
+ lis2dh_logging_face_wants_background_task, \
+})
#endif // LIS2DH_LOGGING_FACE_H_
diff --git a/movement/watch_faces/demos/voltage_face.c b/movement/watch_faces/demos/voltage_face.c
index 4e5fecc1..24346aa3 100644
--- a/movement/watch_faces/demos/voltage_face.c
+++ b/movement/watch_faces/demos/voltage_face.c
@@ -86,6 +86,6 @@ void voltage_face_resign(movement_settings_t *settings, void *context) {
(void) settings;
(void) context;
// make sure to restore the default in the end.
- watch_set_analog_reference_voltage(ADC_REFCTRL_REFSEL_INTVCC2_Val);
+ watch_set_analog_reference_voltage(ADC_REFERENCE_VCC);
watch_disable_adc();
}
diff --git a/movement/watch_faces/demos/voltage_face.h b/movement/watch_faces/demos/voltage_face.h
index 07d9e473..dc5e631b 100644
--- a/movement/watch_faces/demos/voltage_face.h
+++ b/movement/watch_faces/demos/voltage_face.h
@@ -32,12 +32,12 @@ void voltage_face_activate(movement_settings_t *settings, void *context);
bool voltage_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
void voltage_face_resign(movement_settings_t *settings, void *context);
-static const watch_face_t voltage_face = {
- voltage_face_setup,
- voltage_face_activate,
- voltage_face_loop,
- voltage_face_resign,
- NULL
-};
+#define voltage_face ((const watch_face_t){ \
+ voltage_face_setup, \
+ voltage_face_activate, \
+ voltage_face_loop, \
+ voltage_face_resign, \
+ NULL, \
+})
-#endif // VOLTAGE_FACE_H_ \ No newline at end of file
+#endif // VOLTAGE_FACE_H_
diff --git a/movement/watch_faces/settings/preferences_face.h b/movement/watch_faces/settings/preferences_face.h
index 11f9dc43..b178bfd2 100644
--- a/movement/watch_faces/settings/preferences_face.h
+++ b/movement/watch_faces/settings/preferences_face.h
@@ -32,12 +32,12 @@ void preferences_face_activate(movement_settings_t *settings, void *context);
bool preferences_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
void preferences_face_resign(movement_settings_t *settings, void *context);
-static const watch_face_t preferences_face = {
- preferences_face_setup,
- preferences_face_activate,
- preferences_face_loop,
- preferences_face_resign,
- NULL
-};
+#define preferences_face ((const watch_face_t){ \
+ preferences_face_setup, \
+ preferences_face_activate, \
+ preferences_face_loop, \
+ preferences_face_resign, \
+ NULL, \
+})
-#endif // PREFERENCES_FACE_H_ \ No newline at end of file
+#endif // PREFERENCES_FACE_H_
diff --git a/movement/watch_faces/settings/set_time_face.h b/movement/watch_faces/settings/set_time_face.h
index ebc3d8d4..c86b6376 100644
--- a/movement/watch_faces/settings/set_time_face.h
+++ b/movement/watch_faces/settings/set_time_face.h
@@ -32,12 +32,12 @@ void set_time_face_activate(movement_settings_t *settings, void *context);
bool set_time_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
void set_time_face_resign(movement_settings_t *settings, void *context);
-static const watch_face_t set_time_face = {
- set_time_face_setup,
- set_time_face_activate,
- set_time_face_loop,
- set_time_face_resign,
- NULL
-};
+#define set_time_face ((const watch_face_t){ \
+ set_time_face_setup, \
+ set_time_face_activate, \
+ set_time_face_loop, \
+ set_time_face_resign, \
+ NULL, \
+})
#endif // SET_TIME_FACE_H_
diff --git a/movement/watch_faces/thermistor/thermistor_logging_face.h b/movement/watch_faces/thermistor/thermistor_logging_face.h
index effb8822..4ba593ec 100644
--- a/movement/watch_faces/thermistor/thermistor_logging_face.h
+++ b/movement/watch_faces/thermistor/thermistor_logging_face.h
@@ -48,12 +48,12 @@ bool thermistor_logging_face_loop(movement_event_t event, movement_settings_t *s
void thermistor_logging_face_resign(movement_settings_t *settings, void *context);
bool thermistor_logging_face_wants_background_task(movement_settings_t *settings, void *context);
-static const watch_face_t thermistor_logging_face = {
- thermistor_logging_face_setup,
- thermistor_logging_face_activate,
- thermistor_logging_face_loop,
- thermistor_logging_face_resign,
- thermistor_logging_face_wants_background_task
-};
+#define thermistor_logging_face ((const watch_face_t){ \
+ thermistor_logging_face_setup, \
+ thermistor_logging_face_activate, \
+ thermistor_logging_face_loop, \
+ thermistor_logging_face_resign, \
+ thermistor_logging_face_wants_background_task, \
+})
#endif // THERMISTOR_LOGGING_FACE_H_
diff --git a/movement/watch_faces/thermistor/thermistor_readout_face.h b/movement/watch_faces/thermistor/thermistor_readout_face.h
index 5b14fc5b..7361164e 100644
--- a/movement/watch_faces/thermistor/thermistor_readout_face.h
+++ b/movement/watch_faces/thermistor/thermistor_readout_face.h
@@ -32,12 +32,12 @@ void thermistor_readout_face_activate(movement_settings_t *settings, void *conte
bool thermistor_readout_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
void thermistor_readout_face_resign(movement_settings_t *settings, void *context);
-static const watch_face_t thermistor_readout_face = {
- thermistor_readout_face_setup,
- thermistor_readout_face_activate,
- thermistor_readout_face_loop,
- thermistor_readout_face_resign,
- NULL
-};
+#define thermistor_readout_face ((const watch_face_t){ \
+ thermistor_readout_face_setup, \
+ thermistor_readout_face_activate, \
+ thermistor_readout_face_loop, \
+ thermistor_readout_face_resign, \
+ NULL, \
+})
#endif // THERMISTOR_READOUT_FACE_H_
diff --git a/rules.mk b/rules.mk
index f0979f3f..cd42a433 100644
--- a/rules.mk
+++ b/rules.mk
@@ -4,7 +4,17 @@ OBJS = $(addprefix $(BUILD)/, $(notdir %/$(subst .c,.o, $(SRCS))))
SUBMODULES = tinyusb
+ifndef EMSCRIPTEN
all: directory $(SUBMODULES) $(BUILD)/$(BIN).elf $(BUILD)/$(BIN).hex $(BUILD)/$(BIN).bin $(BUILD)/$(BIN).uf2 size
+else
+all: directory $(SUBMODULES) $(BUILD)/$(BIN).html
+endif
+
+$(BUILD)/$(BIN).html: $(OBJS)
+ @echo HTML $@
+ @$(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $@ \
+ -s EXPORTED_FUNCTIONS=_main \
+ --shell-file=$(TOP)/watch-library/simulator/shell.html
$(BUILD)/$(BIN).elf: $(OBJS)
@echo LD $@
diff --git a/watch-library/hal/documentation/ext_irq.rst b/watch-library/hardware/hal/documentation/ext_irq.rst
index 7dcdc7c5..7dcdc7c5 100644
--- a/watch-library/hal/documentation/ext_irq.rst
+++ b/watch-library/hardware/hal/documentation/ext_irq.rst
diff --git a/watch-library/hal/documentation/flash.rst b/watch-library/hardware/hal/documentation/flash.rst
index fcc86e63..fcc86e63 100755
--- a/watch-library/hal/documentation/flash.rst
+++ b/watch-library/hardware/hal/documentation/flash.rst
diff --git a/watch-library/hal/documentation/i2c_master_sync.rst b/watch-library/hardware/hal/documentation/i2c_master_sync.rst
index 77b4f6e9..77b4f6e9 100644
--- a/watch-library/hal/documentation/i2c_master_sync.rst
+++ b/watch-library/hardware/hal/documentation/i2c_master_sync.rst
diff --git a/watch-library/hal/documentation/rand_sync.rst b/watch-library/hardware/hal/documentation/rand_sync.rst
index 19ec1d36..19ec1d36 100755
--- a/watch-library/hal/documentation/rand_sync.rst
+++ b/watch-library/hardware/hal/documentation/rand_sync.rst
diff --git a/watch-library/hal/documentation/slcd_sync.rst b/watch-library/hardware/hal/documentation/slcd_sync.rst
index e18aa9dd..e18aa9dd 100644
--- a/watch-library/hal/documentation/slcd_sync.rst
+++ b/watch-library/hardware/hal/documentation/slcd_sync.rst
diff --git a/watch-library/hal/documentation/spi_master_sync.rst b/watch-library/hardware/hal/documentation/spi_master_sync.rst
index 4fbe45e2..4fbe45e2 100755
--- a/watch-library/hal/documentation/spi_master_sync.rst
+++ b/watch-library/hardware/hal/documentation/spi_master_sync.rst
diff --git a/watch-library/hal/documentation/usart_sync.rst b/watch-library/hardware/hal/documentation/usart_sync.rst
index 15e4b138..15e4b138 100755
--- a/watch-library/hal/documentation/usart_sync.rst
+++ b/watch-library/hardware/hal/documentation/usart_sync.rst
diff --git a/watch-library/hal/include/hal_atomic.h b/watch-library/hardware/hal/include/hal_atomic.h
index 82151fc5..82151fc5 100644
--- a/watch-library/hal/include/hal_atomic.h
+++ b/watch-library/hardware/hal/include/hal_atomic.h
diff --git a/watch-library/hal/include/hal_calendar.h b/watch-library/hardware/hal/include/hal_calendar.h
index e69de29b..e69de29b 100644
--- a/watch-library/hal/include/hal_calendar.h
+++ b/watch-library/hardware/hal/include/hal_calendar.h
diff --git a/watch-library/hal/include/hal_delay.h b/watch-library/hardware/hal/include/hal_delay.h
index 9d4aa5c1..9d4aa5c1 100644
--- a/watch-library/hal/include/hal_delay.h
+++ b/watch-library/hardware/hal/include/hal_delay.h
diff --git a/watch-library/hal/include/hal_ext_irq.h b/watch-library/hardware/hal/include/hal_ext_irq.h
index a7c26005..a7c26005 100644
--- a/watch-library/hal/include/hal_ext_irq.h
+++ b/watch-library/hardware/hal/include/hal_ext_irq.h
diff --git a/watch-library/hal/include/hal_flash.h b/watch-library/hardware/hal/include/hal_flash.h
index 8216afde..8216afde 100755
--- a/watch-library/hal/include/hal_flash.h
+++ b/watch-library/hardware/hal/include/hal_flash.h
diff --git a/watch-library/hal/include/hal_gpio.h b/watch-library/hardware/hal/include/hal_gpio.h
index fbfa2d4a..fbfa2d4a 100644
--- a/watch-library/hal/include/hal_gpio.h
+++ b/watch-library/hardware/hal/include/hal_gpio.h
diff --git a/watch-library/hal/include/hal_i2c_m_sync.h b/watch-library/hardware/hal/include/hal_i2c_m_sync.h
index f7772483..f7772483 100644
--- a/watch-library/hal/include/hal_i2c_m_sync.h
+++ b/watch-library/hardware/hal/include/hal_i2c_m_sync.h
diff --git a/watch-library/hal/include/hal_init.h b/watch-library/hardware/hal/include/hal_init.h
index d7bc6fe2..d7bc6fe2 100644
--- a/watch-library/hal/include/hal_init.h
+++ b/watch-library/hardware/hal/include/hal_init.h
diff --git a/watch-library/hal/include/hal_io.h b/watch-library/hardware/hal/include/hal_io.h
index f50401d7..f50401d7 100644
--- a/watch-library/hal/include/hal_io.h
+++ b/watch-library/hardware/hal/include/hal_io.h
diff --git a/watch-library/hal/include/hal_rand_sync.h b/watch-library/hardware/hal/include/hal_rand_sync.h
index 9f8cc31e..9f8cc31e 100755
--- a/watch-library/hal/include/hal_rand_sync.h
+++ b/watch-library/hardware/hal/include/hal_rand_sync.h
diff --git a/watch-library/hal/include/hal_slcd_sync.h b/watch-library/hardware/hal/include/hal_slcd_sync.h
index 84c4e1f9..84c4e1f9 100644
--- a/watch-library/hal/include/hal_slcd_sync.h
+++ b/watch-library/hardware/hal/include/hal_slcd_sync.h
diff --git a/watch-library/hal/include/hal_sleep.h b/watch-library/hardware/hal/include/hal_sleep.h
index b90ef6a5..b90ef6a5 100644
--- a/watch-library/hal/include/hal_sleep.h
+++ b/watch-library/hardware/hal/include/hal_sleep.h
diff --git a/watch-library/hal/include/hal_spi_m_sync.h b/watch-library/hardware/hal/include/hal_spi_m_sync.h
index 5d040558..5d040558 100755
--- a/watch-library/hal/include/hal_spi_m_sync.h
+++ b/watch-library/hardware/hal/include/hal_spi_m_sync.h
diff --git a/watch-library/hal/include/hal_usart_sync.h b/watch-library/hardware/hal/include/hal_usart_sync.h
index 1ef22fc6..1ef22fc6 100755
--- a/watch-library/hal/include/hal_usart_sync.h
+++ b/watch-library/hardware/hal/include/hal_usart_sync.h
diff --git a/watch-library/hal/include/hpl_calendar.h b/watch-library/hardware/hal/include/hpl_calendar.h
index 0dce40fd..0dce40fd 100644
--- a/watch-library/hal/include/hpl_calendar.h
+++ b/watch-library/hardware/hal/include/hpl_calendar.h
diff --git a/watch-library/hal/include/hpl_core.h b/watch-library/hardware/hal/include/hpl_core.h
index 9324c43e..9324c43e 100644
--- a/watch-library/hal/include/hpl_core.h
+++ b/watch-library/hardware/hal/include/hpl_core.h
diff --git a/watch-library/hal/include/hpl_delay.h b/watch-library/hardware/hal/include/hpl_delay.h
index a0f1ac81..a0f1ac81 100644
--- a/watch-library/hal/include/hpl_delay.h
+++ b/watch-library/hardware/hal/include/hpl_delay.h
diff --git a/watch-library/hal/include/hpl_dma.h b/watch-library/hardware/hal/include/hpl_dma.h
index 1e08434a..1e08434a 100644
--- a/watch-library/hal/include/hpl_dma.h
+++ b/watch-library/hardware/hal/include/hpl_dma.h
diff --git a/watch-library/hal/include/hpl_ext_irq.h b/watch-library/hardware/hal/include/hpl_ext_irq.h
index 3a169b69..3a169b69 100644
--- a/watch-library/hal/include/hpl_ext_irq.h
+++ b/watch-library/hardware/hal/include/hpl_ext_irq.h
diff --git a/watch-library/hal/include/hpl_flash.h b/watch-library/hardware/hal/include/hpl_flash.h
index 3a42c448..3a42c448 100755
--- a/watch-library/hal/include/hpl_flash.h
+++ b/watch-library/hardware/hal/include/hpl_flash.h
diff --git a/watch-library/hal/include/hpl_gpio.h b/watch-library/hardware/hal/include/hpl_gpio.h
index 5cdd387b..5cdd387b 100644
--- a/watch-library/hal/include/hpl_gpio.h
+++ b/watch-library/hardware/hal/include/hpl_gpio.h
diff --git a/watch-library/hal/include/hpl_i2c_m_async.h b/watch-library/hardware/hal/include/hpl_i2c_m_async.h
index 8a9491de..8a9491de 100644
--- a/watch-library/hal/include/hpl_i2c_m_async.h
+++ b/watch-library/hardware/hal/include/hpl_i2c_m_async.h
diff --git a/watch-library/hal/include/hpl_i2c_m_sync.h b/watch-library/hardware/hal/include/hpl_i2c_m_sync.h
index ce173ae2..ce173ae2 100644
--- a/watch-library/hal/include/hpl_i2c_m_sync.h
+++ b/watch-library/hardware/hal/include/hpl_i2c_m_sync.h
diff --git a/watch-library/hal/include/hpl_i2c_s_async.h b/watch-library/hardware/hal/include/hpl_i2c_s_async.h
index 92a5765d..92a5765d 100644
--- a/watch-library/hal/include/hpl_i2c_s_async.h
+++ b/watch-library/hardware/hal/include/hpl_i2c_s_async.h
diff --git a/watch-library/hal/include/hpl_i2c_s_sync.h b/watch-library/hardware/hal/include/hpl_i2c_s_sync.h
index 93b59345..93b59345 100644
--- a/watch-library/hal/include/hpl_i2c_s_sync.h
+++ b/watch-library/hardware/hal/include/hpl_i2c_s_sync.h
diff --git a/watch-library/hal/include/hpl_init.h b/watch-library/hardware/hal/include/hpl_init.h
index 71bf49c9..71bf49c9 100644
--- a/watch-library/hal/include/hpl_init.h
+++ b/watch-library/hardware/hal/include/hpl_init.h
diff --git a/watch-library/hal/include/hpl_irq.h b/watch-library/hardware/hal/include/hpl_irq.h
index 2894944a..2894944a 100644
--- a/watch-library/hal/include/hpl_irq.h
+++ b/watch-library/hardware/hal/include/hpl_irq.h
diff --git a/watch-library/hal/include/hpl_missing_features.h b/watch-library/hardware/hal/include/hpl_missing_features.h
index 7071db29..7071db29 100644
--- a/watch-library/hal/include/hpl_missing_features.h
+++ b/watch-library/hardware/hal/include/hpl_missing_features.h
diff --git a/watch-library/hal/include/hpl_rand_sync.h b/watch-library/hardware/hal/include/hpl_rand_sync.h
index 5fdf1340..5fdf1340 100755
--- a/watch-library/hal/include/hpl_rand_sync.h
+++ b/watch-library/hardware/hal/include/hpl_rand_sync.h
diff --git a/watch-library/hal/include/hpl_reset.h b/watch-library/hardware/hal/include/hpl_reset.h
index 75738b6f..75738b6f 100644
--- a/watch-library/hal/include/hpl_reset.h
+++ b/watch-library/hardware/hal/include/hpl_reset.h
diff --git a/watch-library/hal/include/hpl_slcd.h b/watch-library/hardware/hal/include/hpl_slcd.h
index f3ccbbcd..f3ccbbcd 100644
--- a/watch-library/hal/include/hpl_slcd.h
+++ b/watch-library/hardware/hal/include/hpl_slcd.h
diff --git a/watch-library/hal/include/hpl_slcd_sync.h b/watch-library/hardware/hal/include/hpl_slcd_sync.h
index 2f5a05d7..2f5a05d7 100644
--- a/watch-library/hal/include/hpl_slcd_sync.h
+++ b/watch-library/hardware/hal/include/hpl_slcd_sync.h
diff --git a/watch-library/hal/include/hpl_sleep.h b/watch-library/hardware/hal/include/hpl_sleep.h
index 6731ec30..6731ec30 100644
--- a/watch-library/hal/include/hpl_sleep.h
+++ b/watch-library/hardware/hal/include/hpl_sleep.h
diff --git a/watch-library/hal/include/hpl_spi.h b/watch-library/hardware/hal/include/hpl_spi.h
index a5652e50..a5652e50 100644
--- a/watch-library/hal/include/hpl_spi.h
+++ b/watch-library/hardware/hal/include/hpl_spi.h
diff --git a/watch-library/hal/include/hpl_spi_async.h b/watch-library/hardware/hal/include/hpl_spi_async.h
index 8e5a8485..8e5a8485 100644
--- a/watch-library/hal/include/hpl_spi_async.h
+++ b/watch-library/hardware/hal/include/hpl_spi_async.h
diff --git a/watch-library/hal/include/hpl_spi_dma.h b/watch-library/hardware/hal/include/hpl_spi_dma.h
index 04a30158..04a30158 100755
--- a/watch-library/hal/include/hpl_spi_dma.h
+++ b/watch-library/hardware/hal/include/hpl_spi_dma.h
diff --git a/watch-library/hal/include/hpl_spi_m_async.h b/watch-library/hardware/hal/include/hpl_spi_m_async.h
index 8d3555ed..8d3555ed 100644
--- a/watch-library/hal/include/hpl_spi_m_async.h
+++ b/watch-library/hardware/hal/include/hpl_spi_m_async.h
diff --git a/watch-library/hal/include/hpl_spi_m_dma.h b/watch-library/hardware/hal/include/hpl_spi_m_dma.h
index 2b48300e..2b48300e 100644
--- a/watch-library/hal/include/hpl_spi_m_dma.h
+++ b/watch-library/hardware/hal/include/hpl_spi_m_dma.h
diff --git a/watch-library/hal/include/hpl_spi_m_sync.h b/watch-library/hardware/hal/include/hpl_spi_m_sync.h
index 38df15b4..38df15b4 100644
--- a/watch-library/hal/include/hpl_spi_m_sync.h
+++ b/watch-library/hardware/hal/include/hpl_spi_m_sync.h
diff --git a/watch-library/hal/include/hpl_spi_s_async.h b/watch-library/hardware/hal/include/hpl_spi_s_async.h
index 56472439..56472439 100644
--- a/watch-library/hal/include/hpl_spi_s_async.h
+++ b/watch-library/hardware/hal/include/hpl_spi_s_async.h
diff --git a/watch-library/hal/include/hpl_spi_s_sync.h b/watch-library/hardware/hal/include/hpl_spi_s_sync.h
index ff4c811a..ff4c811a 100644
--- a/watch-library/hal/include/hpl_spi_s_sync.h
+++ b/watch-library/hardware/hal/include/hpl_spi_s_sync.h
diff --git a/watch-library/hal/include/hpl_spi_sync.h b/watch-library/hardware/hal/include/hpl_spi_sync.h
index dc88648f..dc88648f 100644
--- a/watch-library/hal/include/hpl_spi_sync.h
+++ b/watch-library/hardware/hal/include/hpl_spi_sync.h
diff --git a/watch-library/hal/include/hpl_time_measure.h b/watch-library/hardware/hal/include/hpl_time_measure.h
index 5d688df5..5d688df5 100644
--- a/watch-library/hal/include/hpl_time_measure.h
+++ b/watch-library/hardware/hal/include/hpl_time_measure.h
diff --git a/watch-library/hal/include/hpl_timer.h b/watch-library/hardware/hal/include/hpl_timer.h
index 9bdfbb77..9bdfbb77 100644
--- a/watch-library/hal/include/hpl_timer.h
+++ b/watch-library/hardware/hal/include/hpl_timer.h
diff --git a/watch-library/hal/include/hpl_usart.h b/watch-library/hardware/hal/include/hpl_usart.h
index 0e09501d..0e09501d 100644
--- a/watch-library/hal/include/hpl_usart.h
+++ b/watch-library/hardware/hal/include/hpl_usart.h
diff --git a/watch-library/hal/include/hpl_usart_async.h b/watch-library/hardware/hal/include/hpl_usart_async.h
index 3f833d1a..3f833d1a 100644
--- a/watch-library/hal/include/hpl_usart_async.h
+++ b/watch-library/hardware/hal/include/hpl_usart_async.h
diff --git a/watch-library/hal/include/hpl_usart_sync.h b/watch-library/hardware/hal/include/hpl_usart_sync.h
index abc7264f..abc7264f 100644
--- a/watch-library/hal/include/hpl_usart_sync.h
+++ b/watch-library/hardware/hal/include/hpl_usart_sync.h
diff --git a/watch-library/hal/include/hpl_user_area.h b/watch-library/hardware/hal/include/hpl_user_area.h
index 1f14098d..1f14098d 100755
--- a/watch-library/hal/include/hpl_user_area.h
+++ b/watch-library/hardware/hal/include/hpl_user_area.h
diff --git a/watch-library/hal/src/hal_atomic.c b/watch-library/hardware/hal/src/hal_atomic.c
index f56418ee..f56418ee 100644
--- a/watch-library/hal/src/hal_atomic.c
+++ b/watch-library/hardware/hal/src/hal_atomic.c
diff --git a/watch-library/hal/src/hal_calendar.c b/watch-library/hardware/hal/src/hal_calendar.c
index e69de29b..e69de29b 100644
--- a/watch-library/hal/src/hal_calendar.c
+++ b/watch-library/hardware/hal/src/hal_calendar.c
diff --git a/watch-library/hal/src/hal_delay.c b/watch-library/hardware/hal/src/hal_delay.c
index 6f77cc70..6f77cc70 100644
--- a/watch-library/hal/src/hal_delay.c
+++ b/watch-library/hardware/hal/src/hal_delay.c
diff --git a/watch-library/hal/src/hal_ext_irq.c b/watch-library/hardware/hal/src/hal_ext_irq.c
index 2c383b4b..2c383b4b 100644
--- a/watch-library/hal/src/hal_ext_irq.c
+++ b/watch-library/hardware/hal/src/hal_ext_irq.c
diff --git a/watch-library/hal/src/hal_flash.c b/watch-library/hardware/hal/src/hal_flash.c
index b1a58b71..b1a58b71 100755
--- a/watch-library/hal/src/hal_flash.c
+++ b/watch-library/hardware/hal/src/hal_flash.c
diff --git a/watch-library/hal/src/hal_gpio.c b/watch-library/hardware/hal/src/hal_gpio.c
index 00dfea6f..00dfea6f 100644
--- a/watch-library/hal/src/hal_gpio.c
+++ b/watch-library/hardware/hal/src/hal_gpio.c
diff --git a/watch-library/hal/src/hal_i2c_m_sync.c b/watch-library/hardware/hal/src/hal_i2c_m_sync.c
index 9be16be4..9be16be4 100644
--- a/watch-library/hal/src/hal_i2c_m_sync.c
+++ b/watch-library/hardware/hal/src/hal_i2c_m_sync.c
diff --git a/watch-library/hal/src/hal_init.c b/watch-library/hardware/hal/src/hal_init.c
index fb65341f..fb65341f 100644
--- a/watch-library/hal/src/hal_init.c
+++ b/watch-library/hardware/hal/src/hal_init.c
diff --git a/watch-library/hal/src/hal_io.c b/watch-library/hardware/hal/src/hal_io.c
index ae787d42..ae787d42 100644
--- a/watch-library/hal/src/hal_io.c
+++ b/watch-library/hardware/hal/src/hal_io.c
diff --git a/watch-library/hal/src/hal_rand_sync.c b/watch-library/hardware/hal/src/hal_rand_sync.c
index 8b29ed1b..8b29ed1b 100755
--- a/watch-library/hal/src/hal_rand_sync.c
+++ b/watch-library/hardware/hal/src/hal_rand_sync.c
diff --git a/watch-library/hal/src/hal_slcd_sync.c b/watch-library/hardware/hal/src/hal_slcd_sync.c
index 573eb0e2..573eb0e2 100644
--- a/watch-library/hal/src/hal_slcd_sync.c
+++ b/watch-library/hardware/hal/src/hal_slcd_sync.c
diff --git a/watch-library/hal/src/hal_sleep.c b/watch-library/hardware/hal/src/hal_sleep.c
index 89472f15..89472f15 100644
--- a/watch-library/hal/src/hal_sleep.c
+++ b/watch-library/hardware/hal/src/hal_sleep.c
diff --git a/watch-library/hal/src/hal_spi_m_sync.c b/watch-library/hardware/hal/src/hal_spi_m_sync.c
index 1a64296a..1a64296a 100755
--- a/watch-library/hal/src/hal_spi_m_sync.c
+++ b/watch-library/hardware/hal/src/hal_spi_m_sync.c
diff --git a/watch-library/hal/src/hal_usart_sync.c b/watch-library/hardware/hal/src/hal_usart_sync.c
index ab99c1d1..ab99c1d1 100755
--- a/watch-library/hal/src/hal_usart_sync.c
+++ b/watch-library/hardware/hal/src/hal_usart_sync.c
diff --git a/watch-library/hal/utils/include/compiler.h b/watch-library/hardware/hal/utils/include/compiler.h
index f35db3df..010b2637 100644
--- a/watch-library/hal/utils/include/compiler.h
+++ b/watch-library/hardware/hal/utils/include/compiler.h
@@ -52,9 +52,11 @@ extern "C" {
#include <stdint.h>
#include <stdbool.h>
+#ifndef __EMSCRIPTEN__
#ifndef _UNIT_TEST_
#include "parts.h"
#endif
+#endif
#include "err_codes.h"
#ifdef __cplusplus
diff --git a/watch-library/hal/utils/include/err_codes.h b/watch-library/hardware/hal/utils/include/err_codes.h
index a7aff018..a7aff018 100644
--- a/watch-library/hal/utils/include/err_codes.h
+++ b/watch-library/hardware/hal/utils/include/err_codes.h
diff --git a/watch-library/hal/utils/include/events.h b/watch-library/hardware/hal/utils/include/events.h
index 3ee891a7..3ee891a7 100644
--- a/watch-library/hal/utils/include/events.h
+++ b/watch-library/hardware/hal/utils/include/events.h
diff --git a/watch-library/hal/utils/include/parts.h b/watch-library/hardware/hal/utils/include/parts.h
index df30040f..df30040f 100644
--- a/watch-library/hal/utils/include/parts.h
+++ b/watch-library/hardware/hal/utils/include/parts.h
diff --git a/watch-library/hal/utils/include/utils.h b/watch-library/hardware/hal/utils/include/utils.h
index 1cf26996..1cf26996 100644
--- a/watch-library/hal/utils/include/utils.h
+++ b/watch-library/hardware/hal/utils/include/utils.h
diff --git a/watch-library/hal/utils/include/utils_assert.h b/watch-library/hardware/hal/utils/include/utils_assert.h
index c2328d6c..c2328d6c 100644
--- a/watch-library/hal/utils/include/utils_assert.h
+++ b/watch-library/hardware/hal/utils/include/utils_assert.h
diff --git a/watch-library/hal/utils/include/utils_decrement_macro.h b/watch-library/hardware/hal/utils/include/utils_decrement_macro.h
index 2b524699..2b524699 100644
--- a/watch-library/hal/utils/include/utils_decrement_macro.h
+++ b/watch-library/hardware/hal/utils/include/utils_decrement_macro.h
diff --git a/watch-library/hal/utils/include/utils_event.h b/watch-library/hardware/hal/utils/include/utils_event.h
index 13067c4f..13067c4f 100644
--- a/watch-library/hal/utils/include/utils_event.h
+++ b/watch-library/hardware/hal/utils/include/utils_event.h
diff --git a/watch-library/hal/utils/include/utils_increment_macro.h b/watch-library/hardware/hal/utils/include/utils_increment_macro.h
index 464c6cbb..464c6cbb 100644
--- a/watch-library/hal/utils/include/utils_increment_macro.h
+++ b/watch-library/hardware/hal/utils/include/utils_increment_macro.h
diff --git a/watch-library/hal/utils/include/utils_list.h b/watch-library/hardware/hal/utils/include/utils_list.h
index 977e8cca..977e8cca 100644
--- a/watch-library/hal/utils/include/utils_list.h
+++ b/watch-library/hardware/hal/utils/include/utils_list.h
diff --git a/watch-library/hal/utils/include/utils_recursion_macro.h b/watch-library/hardware/hal/utils/include/utils_recursion_macro.h
index 294314c4..294314c4 100644
--- a/watch-library/hal/utils/include/utils_recursion_macro.h
+++ b/watch-library/hardware/hal/utils/include/utils_recursion_macro.h
diff --git a/watch-library/hal/utils/include/utils_repeat_macro.h b/watch-library/hardware/hal/utils/include/utils_repeat_macro.h
index 89e6f52d..89e6f52d 100644
--- a/watch-library/hal/utils/include/utils_repeat_macro.h
+++ b/watch-library/hardware/hal/utils/include/utils_repeat_macro.h
diff --git a/watch-library/hal/utils/src/utils_assert.c b/watch-library/hardware/hal/utils/src/utils_assert.c
index b376c970..b376c970 100644
--- a/watch-library/hal/utils/src/utils_assert.c
+++ b/watch-library/hardware/hal/utils/src/utils_assert.c
diff --git a/watch-library/hal/utils/src/utils_event.c b/watch-library/hardware/hal/utils/src/utils_event.c
index d1af9d0c..d1af9d0c 100644
--- a/watch-library/hal/utils/src/utils_event.c
+++ b/watch-library/hardware/hal/utils/src/utils_event.c
diff --git a/watch-library/hal/utils/src/utils_list.c b/watch-library/hardware/hal/utils/src/utils_list.c
index 4006a019..4006a019 100644
--- a/watch-library/hal/utils/src/utils_list.c
+++ b/watch-library/hardware/hal/utils/src/utils_list.c
diff --git a/watch-library/hal/utils/src/utils_syscalls.c b/watch-library/hardware/hal/utils/src/utils_syscalls.c
index 79e2f1fe..79e2f1fe 100644
--- a/watch-library/hal/utils/src/utils_syscalls.c
+++ b/watch-library/hardware/hal/utils/src/utils_syscalls.c
diff --git a/watch-library/hpl/core/hpl_core_m0plus_base.c b/watch-library/hardware/hpl/core/hpl_core_m0plus_base.c
index cad2a662..cad2a662 100644
--- a/watch-library/hpl/core/hpl_core_m0plus_base.c
+++ b/watch-library/hardware/hpl/core/hpl_core_m0plus_base.c
diff --git a/watch-library/hpl/core/hpl_core_port.h b/watch-library/hardware/hpl/core/hpl_core_port.h
index 33c18dd0..33c18dd0 100644
--- a/watch-library/hpl/core/hpl_core_port.h
+++ b/watch-library/hardware/hpl/core/hpl_core_port.h
diff --git a/watch-library/hpl/core/hpl_init.c b/watch-library/hardware/hpl/core/hpl_init.c
index 900cf420..900cf420 100644
--- a/watch-library/hpl/core/hpl_init.c
+++ b/watch-library/hardware/hpl/core/hpl_init.c
diff --git a/watch-library/hpl/dmac/hpl_dmac.c b/watch-library/hardware/hpl/dmac/hpl_dmac.c
index c12e0254..c12e0254 100644
--- a/watch-library/hpl/dmac/hpl_dmac.c
+++ b/watch-library/hardware/hpl/dmac/hpl_dmac.c
diff --git a/watch-library/hpl/eic/hpl_eic.c b/watch-library/hardware/hpl/eic/hpl_eic.c
index 2bd31615..2bd31615 100644
--- a/watch-library/hpl/eic/hpl_eic.c
+++ b/watch-library/hardware/hpl/eic/hpl_eic.c
diff --git a/watch-library/hpl/gclk/hpl_gclk.c b/watch-library/hardware/hpl/gclk/hpl_gclk.c
index be66ef77..be66ef77 100644
--- a/watch-library/hpl/gclk/hpl_gclk.c
+++ b/watch-library/hardware/hpl/gclk/hpl_gclk.c
diff --git a/watch-library/hpl/gclk/hpl_gclk_base.h b/watch-library/hardware/hpl/gclk/hpl_gclk_base.h
index 3e7d2825..3e7d2825 100644
--- a/watch-library/hpl/gclk/hpl_gclk_base.h
+++ b/watch-library/hardware/hpl/gclk/hpl_gclk_base.h
diff --git a/watch-library/hpl/mclk/hpl_mclk.c b/watch-library/hardware/hpl/mclk/hpl_mclk.c
index 46e7c853..46e7c853 100644
--- a/watch-library/hpl/mclk/hpl_mclk.c
+++ b/watch-library/hardware/hpl/mclk/hpl_mclk.c
diff --git a/watch-library/hpl/nvmctrl/hpl_nvmctrl.c b/watch-library/hardware/hpl/nvmctrl/hpl_nvmctrl.c
index c1d42c5e..c1d42c5e 100755
--- a/watch-library/hpl/nvmctrl/hpl_nvmctrl.c
+++ b/watch-library/hardware/hpl/nvmctrl/hpl_nvmctrl.c
diff --git a/watch-library/hpl/osc32kctrl/hpl_osc32kctrl.c b/watch-library/hardware/hpl/osc32kctrl/hpl_osc32kctrl.c
index b6c624cc..b6c624cc 100644
--- a/watch-library/hpl/osc32kctrl/hpl_osc32kctrl.c
+++ b/watch-library/hardware/hpl/osc32kctrl/hpl_osc32kctrl.c
diff --git a/watch-library/hpl/oscctrl/hpl_oscctrl.c b/watch-library/hardware/hpl/oscctrl/hpl_oscctrl.c
index e11d70d8..e11d70d8 100644
--- a/watch-library/hpl/oscctrl/hpl_oscctrl.c
+++ b/watch-library/hardware/hpl/oscctrl/hpl_oscctrl.c
diff --git a/watch-library/hpl/pm/hpl_pm.c b/watch-library/hardware/hpl/pm/hpl_pm.c
index d6439f1d..d6439f1d 100644
--- a/watch-library/hpl/pm/hpl_pm.c
+++ b/watch-library/hardware/hpl/pm/hpl_pm.c
diff --git a/watch-library/hpl/pm/hpl_pm_base.h b/watch-library/hardware/hpl/pm/hpl_pm_base.h
index 5a50a914..5a50a914 100644
--- a/watch-library/hpl/pm/hpl_pm_base.h
+++ b/watch-library/hardware/hpl/pm/hpl_pm_base.h
diff --git a/watch-library/hpl/port/hpl_gpio_base.h b/watch-library/hardware/hpl/port/hpl_gpio_base.h
index 3cc1981f..3cc1981f 100644
--- a/watch-library/hpl/port/hpl_gpio_base.h
+++ b/watch-library/hardware/hpl/port/hpl_gpio_base.h
diff --git a/watch-library/hpl/sercom/hpl_sercom.c b/watch-library/hardware/hpl/sercom/hpl_sercom.c
index f01476dc..f01476dc 100644
--- a/watch-library/hpl/sercom/hpl_sercom.c
+++ b/watch-library/hardware/hpl/sercom/hpl_sercom.c
diff --git a/watch-library/hpl/slcd/hpl_slcd.c b/watch-library/hardware/hpl/slcd/hpl_slcd.c
index 0f58b1f5..0f58b1f5 100644
--- a/watch-library/hpl/slcd/hpl_slcd.c
+++ b/watch-library/hardware/hpl/slcd/hpl_slcd.c
diff --git a/watch-library/hpl/slcd/hpl_slcd_cm.h b/watch-library/hardware/hpl/slcd/hpl_slcd_cm.h
index 66dbde93..66dbde93 100644
--- a/watch-library/hpl/slcd/hpl_slcd_cm.h
+++ b/watch-library/hardware/hpl/slcd/hpl_slcd_cm.h
diff --git a/watch-library/hpl/systick/hpl_systick.c b/watch-library/hardware/hpl/systick/hpl_systick.c
index c2f3b29e..c2f3b29e 100644
--- a/watch-library/hpl/systick/hpl_systick.c
+++ b/watch-library/hardware/hpl/systick/hpl_systick.c
diff --git a/watch-library/hpl/trng/hpl_trng.c b/watch-library/hardware/hpl/trng/hpl_trng.c
index 43ede044..43ede044 100755
--- a/watch-library/hpl/trng/hpl_trng.c
+++ b/watch-library/hardware/hpl/trng/hpl_trng.c
diff --git a/watch-library/hri/hri_ac_l22.h b/watch-library/hardware/hri/hri_ac_l22.h
index f1e17cef..f1e17cef 100644
--- a/watch-library/hri/hri_ac_l22.h
+++ b/watch-library/hardware/hri/hri_ac_l22.h
diff --git a/watch-library/hri/hri_adc_l22.h b/watch-library/hardware/hri/hri_adc_l22.h
index 53ba6af8..53ba6af8 100644
--- a/watch-library/hri/hri_adc_l22.h
+++ b/watch-library/hardware/hri/hri_adc_l22.h
diff --git a/watch-library/hri/hri_aes_l22.h b/watch-library/hardware/hri/hri_aes_l22.h
index f88f081e..f88f081e 100644
--- a/watch-library/hri/hri_aes_l22.h
+++ b/watch-library/hardware/hri/hri_aes_l22.h
diff --git a/watch-library/hri/hri_ccl_l22.h b/watch-library/hardware/hri/hri_ccl_l22.h
index b510c86a..b510c86a 100644
--- a/watch-library/hri/hri_ccl_l22.h
+++ b/watch-library/hardware/hri/hri_ccl_l22.h
diff --git a/watch-library/hri/hri_dmac_l22.h b/watch-library/hardware/hri/hri_dmac_l22.h
index a20e28ee..a20e28ee 100644
--- a/watch-library/hri/hri_dmac_l22.h
+++ b/watch-library/hardware/hri/hri_dmac_l22.h
diff --git a/watch-library/hri/hri_dsu_l22.h b/watch-library/hardware/hri/hri_dsu_l22.h
index 2e8bbe8b..2e8bbe8b 100644
--- a/watch-library/hri/hri_dsu_l22.h
+++ b/watch-library/hardware/hri/hri_dsu_l22.h
diff --git a/watch-library/hri/hri_eic_l22.h b/watch-library/hardware/hri/hri_eic_l22.h
index 058012bf..058012bf 100644
--- a/watch-library/hri/hri_eic_l22.h
+++ b/watch-library/hardware/hri/hri_eic_l22.h
diff --git a/watch-library/hri/hri_evsys_l22.h b/watch-library/hardware/hri/hri_evsys_l22.h
index a2964f94..a2964f94 100644
--- a/watch-library/hri/hri_evsys_l22.h
+++ b/watch-library/hardware/hri/hri_evsys_l22.h
diff --git a/watch-library/hri/hri_freqm_l22.h b/watch-library/hardware/hri/hri_freqm_l22.h
index e221bbfd..e221bbfd 100644
--- a/watch-library/hri/hri_freqm_l22.h
+++ b/watch-library/hardware/hri/hri_freqm_l22.h
diff --git a/watch-library/hri/hri_gclk_l22.h b/watch-library/hardware/hri/hri_gclk_l22.h
index 2ae6d491..2ae6d491 100644
--- a/watch-library/hri/hri_gclk_l22.h
+++ b/watch-library/hardware/hri/hri_gclk_l22.h
diff --git a/watch-library/hri/hri_l22.h b/watch-library/hardware/hri/hri_l22.h
index d99268c1..d99268c1 100644
--- a/watch-library/hri/hri_l22.h
+++ b/watch-library/hardware/hri/hri_l22.h
diff --git a/watch-library/hri/hri_mclk_l22.h b/watch-library/hardware/hri/hri_mclk_l22.h
index b03c0064..b03c0064 100644
--- a/watch-library/hri/hri_mclk_l22.h
+++ b/watch-library/hardware/hri/hri_mclk_l22.h
diff --git a/watch-library/hri/hri_mtb_l22.h b/watch-library/hardware/hri/hri_mtb_l22.h
index f8cb66d5..f8cb66d5 100644
--- a/watch-library/hri/hri_mtb_l22.h
+++ b/watch-library/hardware/hri/hri_mtb_l22.h
diff --git a/watch-library/hri/hri_nvic_l22.h b/watch-library/hardware/hri/hri_nvic_l22.h
index 5596c99a..5596c99a 100644
--- a/watch-library/hri/hri_nvic_l22.h
+++ b/watch-library/hardware/hri/hri_nvic_l22.h
diff --git a/watch-library/hri/hri_nvmctrl_l22.h b/watch-library/hardware/hri/hri_nvmctrl_l22.h
index 07629fba..07629fba 100644
--- a/watch-library/hri/hri_nvmctrl_l22.h
+++ b/watch-library/hardware/hri/hri_nvmctrl_l22.h
diff --git a/watch-library/hri/hri_osc32kctrl_l22.h b/watch-library/hardware/hri/hri_osc32kctrl_l22.h
index 44bb32ba..44bb32ba 100644
--- a/watch-library/hri/hri_osc32kctrl_l22.h
+++ b/watch-library/hardware/hri/hri_osc32kctrl_l22.h
diff --git a/watch-library/hri/hri_oscctrl_l22.h b/watch-library/hardware/hri/hri_oscctrl_l22.h
index d1bc4b60..d1bc4b60 100644
--- a/watch-library/hri/hri_oscctrl_l22.h
+++ b/watch-library/hardware/hri/hri_oscctrl_l22.h
diff --git a/watch-library/hri/hri_pac_l22.h b/watch-library/hardware/hri/hri_pac_l22.h
index 488c7079..488c7079 100644
--- a/watch-library/hri/hri_pac_l22.h
+++ b/watch-library/hardware/hri/hri_pac_l22.h
diff --git a/watch-library/hri/hri_pm_l22.h b/watch-library/hardware/hri/hri_pm_l22.h
index d56d3cf7..d56d3cf7 100644
--- a/watch-library/hri/hri_pm_l22.h
+++ b/watch-library/hardware/hri/hri_pm_l22.h
diff --git a/watch-library/hri/hri_port_l22.h b/watch-library/hardware/hri/hri_port_l22.h
index ee99c2e8..ee99c2e8 100644
--- a/watch-library/hri/hri_port_l22.h
+++ b/watch-library/hardware/hri/hri_port_l22.h
diff --git a/watch-library/hri/hri_rstc_l22.h b/watch-library/hardware/hri/hri_rstc_l22.h
index 853744e2..853744e2 100644
--- a/watch-library/hri/hri_rstc_l22.h
+++ b/watch-library/hardware/hri/hri_rstc_l22.h
diff --git a/watch-library/hri/hri_rtc_l22.h b/watch-library/hardware/hri/hri_rtc_l22.h
index 0b46f010..0b46f010 100644
--- a/watch-library/hri/hri_rtc_l22.h
+++ b/watch-library/hardware/hri/hri_rtc_l22.h
diff --git a/watch-library/hri/hri_sercom_l22.h b/watch-library/hardware/hri/hri_sercom_l22.h
index 6d97ca8a..6d97ca8a 100644
--- a/watch-library/hri/hri_sercom_l22.h
+++ b/watch-library/hardware/hri/hri_sercom_l22.h
diff --git a/watch-library/hri/hri_slcd_l22.h b/watch-library/hardware/hri/hri_slcd_l22.h
index 89fde269..89fde269 100644
--- a/watch-library/hri/hri_slcd_l22.h
+++ b/watch-library/hardware/hri/hri_slcd_l22.h
diff --git a/watch-library/hri/hri_supc_l22.h b/watch-library/hardware/hri/hri_supc_l22.h
index 9488ef0b..9488ef0b 100644
--- a/watch-library/hri/hri_supc_l22.h
+++ b/watch-library/hardware/hri/hri_supc_l22.h
diff --git a/watch-library/hri/hri_systemcontrol_l22.h b/watch-library/hardware/hri/hri_systemcontrol_l22.h
index 9553d51a..9553d51a 100644
--- a/watch-library/hri/hri_systemcontrol_l22.h
+++ b/watch-library/hardware/hri/hri_systemcontrol_l22.h
diff --git a/watch-library/hri/hri_systick_l22.h b/watch-library/hardware/hri/hri_systick_l22.h
index aa09233f..aa09233f 100644
--- a/watch-library/hri/hri_systick_l22.h
+++ b/watch-library/hardware/hri/hri_systick_l22.h
diff --git a/watch-library/hri/hri_tc_l22.h b/watch-library/hardware/hri/hri_tc_l22.h
index 8fab128c..8fab128c 100644
--- a/watch-library/hri/hri_tc_l22.h
+++ b/watch-library/hardware/hri/hri_tc_l22.h
diff --git a/watch-library/hri/hri_tcc_l22.h b/watch-library/hardware/hri/hri_tcc_l22.h
index c10442af..c10442af 100644
--- a/watch-library/hri/hri_tcc_l22.h
+++ b/watch-library/hardware/hri/hri_tcc_l22.h
diff --git a/watch-library/hri/hri_trng_l22.h b/watch-library/hardware/hri/hri_trng_l22.h
index 8aad3aca..8aad3aca 100644
--- a/watch-library/hri/hri_trng_l22.h
+++ b/watch-library/hardware/hri/hri_trng_l22.h
diff --git a/watch-library/hri/hri_usb_l22.h b/watch-library/hardware/hri/hri_usb_l22.h
index 57a9419d..57a9419d 100644
--- a/watch-library/hri/hri_usb_l22.h
+++ b/watch-library/hardware/hri/hri_usb_l22.h
diff --git a/watch-library/hri/hri_wdt_l22.h b/watch-library/hardware/hri/hri_wdt_l22.h
index 4794b254..4794b254 100644
--- a/watch-library/hri/hri_wdt_l22.h
+++ b/watch-library/hardware/hri/hri_wdt_l22.h
diff --git a/watch-library/hw/driver_init.c b/watch-library/hardware/hw/driver_init.c
index 09723bec..09723bec 100644
--- a/watch-library/hw/driver_init.c
+++ b/watch-library/hardware/hw/driver_init.c
diff --git a/watch-library/hw/driver_init.h b/watch-library/hardware/hw/driver_init.h
index d1c33218..d1c33218 100644
--- a/watch-library/hw/driver_init.h
+++ b/watch-library/hardware/hw/driver_init.h
diff --git a/watch-library/include/component-version.h b/watch-library/hardware/include/component-version.h
index a84744e9..a84744e9 100644
--- a/watch-library/include/component-version.h
+++ b/watch-library/hardware/include/component-version.h
diff --git a/watch-library/include/component/ac.h b/watch-library/hardware/include/component/ac.h
index e1df65fa..e1df65fa 100644
--- a/watch-library/include/component/ac.h
+++ b/watch-library/hardware/include/component/ac.h
diff --git a/watch-library/include/component/adc.h b/watch-library/hardware/include/component/adc.h
index f51dc639..f51dc639 100644
--- a/watch-library/include/component/adc.h
+++ b/watch-library/hardware/include/component/adc.h
diff --git a/watch-library/include/component/aes.h b/watch-library/hardware/include/component/aes.h
index 439ce987..439ce987 100644
--- a/watch-library/include/component/aes.h
+++ b/watch-library/hardware/include/component/aes.h
diff --git a/watch-library/include/component/ccl.h b/watch-library/hardware/include/component/ccl.h
index ce10ebc6..ce10ebc6 100644
--- a/watch-library/include/component/ccl.h
+++ b/watch-library/hardware/include/component/ccl.h
diff --git a/watch-library/include/component/dmac.h b/watch-library/hardware/include/component/dmac.h
index 85b2ce02..85b2ce02 100644
--- a/watch-library/include/component/dmac.h
+++ b/watch-library/hardware/include/component/dmac.h
diff --git a/watch-library/include/component/dsu.h b/watch-library/hardware/include/component/dsu.h
index e4b1b75e..e4b1b75e 100644
--- a/watch-library/include/component/dsu.h
+++ b/watch-library/hardware/include/component/dsu.h
diff --git a/watch-library/include/component/eic.h b/watch-library/hardware/include/component/eic.h
index f432495d..f432495d 100644
--- a/watch-library/include/component/eic.h
+++ b/watch-library/hardware/include/component/eic.h
diff --git a/watch-library/include/component/evsys.h b/watch-library/hardware/include/component/evsys.h
index 4329ecad..4329ecad 100644
--- a/watch-library/include/component/evsys.h
+++ b/watch-library/hardware/include/component/evsys.h
diff --git a/watch-library/include/component/freqm.h b/watch-library/hardware/include/component/freqm.h
index 9147ba32..9147ba32 100644
--- a/watch-library/include/component/freqm.h
+++ b/watch-library/hardware/include/component/freqm.h
diff --git a/watch-library/include/component/gclk.h b/watch-library/hardware/include/component/gclk.h
index 41da1846..41da1846 100644
--- a/watch-library/include/component/gclk.h
+++ b/watch-library/hardware/include/component/gclk.h
diff --git a/watch-library/include/component/mclk.h b/watch-library/hardware/include/component/mclk.h
index 7a79abc1..7a79abc1 100644
--- a/watch-library/include/component/mclk.h
+++ b/watch-library/hardware/include/component/mclk.h
diff --git a/watch-library/include/component/mtb.h b/watch-library/hardware/include/component/mtb.h
index 71765c1e..71765c1e 100644
--- a/watch-library/include/component/mtb.h
+++ b/watch-library/hardware/include/component/mtb.h
diff --git a/watch-library/include/component/nvmctrl.h b/watch-library/hardware/include/component/nvmctrl.h
index 18dc6f32..18dc6f32 100644
--- a/watch-library/include/component/nvmctrl.h
+++ b/watch-library/hardware/include/component/nvmctrl.h
diff --git a/watch-library/include/component/osc32kctrl.h b/watch-library/hardware/include/component/osc32kctrl.h
index cc4ee9a1..cc4ee9a1 100644
--- a/watch-library/include/component/osc32kctrl.h
+++ b/watch-library/hardware/include/component/osc32kctrl.h
diff --git a/watch-library/include/component/oscctrl.h b/watch-library/hardware/include/component/oscctrl.h
index cf8daad0..cf8daad0 100644
--- a/watch-library/include/component/oscctrl.h
+++ b/watch-library/hardware/include/component/oscctrl.h
diff --git a/watch-library/include/component/pac.h b/watch-library/hardware/include/component/pac.h
index 7c084d23..7c084d23 100644
--- a/watch-library/include/component/pac.h
+++ b/watch-library/hardware/include/component/pac.h
diff --git a/watch-library/include/component/pm.h b/watch-library/hardware/include/component/pm.h
index 6320208c..6320208c 100644
--- a/watch-library/include/component/pm.h
+++ b/watch-library/hardware/include/component/pm.h
diff --git a/watch-library/include/component/port.h b/watch-library/hardware/include/component/port.h
index 2ec5713f..2ec5713f 100644
--- a/watch-library/include/component/port.h
+++ b/watch-library/hardware/include/component/port.h
diff --git a/watch-library/include/component/rstc.h b/watch-library/hardware/include/component/rstc.h
index c6e639f7..c6e639f7 100644
--- a/watch-library/include/component/rstc.h
+++ b/watch-library/hardware/include/component/rstc.h
diff --git a/watch-library/include/component/rtc.h b/watch-library/hardware/include/component/rtc.h
index cba38a78..cba38a78 100644
--- a/watch-library/include/component/rtc.h
+++ b/watch-library/hardware/include/component/rtc.h
diff --git a/watch-library/include/component/sercom.h b/watch-library/hardware/include/component/sercom.h
index 3f052044..3f052044 100644
--- a/watch-library/include/component/sercom.h
+++ b/watch-library/hardware/include/component/sercom.h
diff --git a/watch-library/include/component/slcd.h b/watch-library/hardware/include/component/slcd.h
index 01a409ee..01a409ee 100644
--- a/watch-library/include/component/slcd.h
+++ b/watch-library/hardware/include/component/slcd.h
diff --git a/watch-library/include/component/supc.h b/watch-library/hardware/include/component/supc.h
index 1c8c80cb..1c8c80cb 100644
--- a/watch-library/include/component/supc.h
+++ b/watch-library/hardware/include/component/supc.h
diff --git a/watch-library/include/component/tc.h b/watch-library/hardware/include/component/tc.h
index 4748ce29..4748ce29 100644
--- a/watch-library/include/component/tc.h
+++ b/watch-library/hardware/include/component/tc.h
diff --git a/watch-library/include/component/tcc.h b/watch-library/hardware/include/component/tcc.h
index 6f5161d1..6f5161d1 100644
--- a/watch-library/include/component/tcc.h
+++ b/watch-library/hardware/include/component/tcc.h
diff --git a/watch-library/include/component/trng.h b/watch-library/hardware/include/component/trng.h
index 5d29e892..5d29e892 100644
--- a/watch-library/include/component/trng.h
+++ b/watch-library/hardware/include/component/trng.h
diff --git a/watch-library/include/component/usb.h b/watch-library/hardware/include/component/usb.h
index 315256cd..315256cd 100644
--- a/watch-library/include/component/usb.h
+++ b/watch-library/hardware/include/component/usb.h
diff --git a/watch-library/include/component/wdt.h b/watch-library/hardware/include/component/wdt.h
index bc40154e..bc40154e 100644
--- a/watch-library/include/component/wdt.h
+++ b/watch-library/hardware/include/component/wdt.h
diff --git a/watch-library/include/core_cm0plus.h b/watch-library/hardware/include/core_cm0plus.h
index 4d7facfa..4d7facfa 100755
--- a/watch-library/include/core_cm0plus.h
+++ b/watch-library/hardware/include/core_cm0plus.h
diff --git a/watch-library/include/core_cmFunc.h b/watch-library/hardware/include/core_cmFunc.h
index a1bd88c2..a1bd88c2 100755
--- a/watch-library/include/core_cmFunc.h
+++ b/watch-library/hardware/include/core_cmFunc.h
diff --git a/watch-library/include/core_cmInstr.h b/watch-library/hardware/include/core_cmInstr.h
index cfdea144..cfdea144 100755
--- a/watch-library/include/core_cmInstr.h
+++ b/watch-library/hardware/include/core_cmInstr.h
diff --git a/watch-library/include/instance/ac.h b/watch-library/hardware/include/instance/ac.h
index d2bf7fb9..d2bf7fb9 100644
--- a/watch-library/include/instance/ac.h
+++ b/watch-library/hardware/include/instance/ac.h
diff --git a/watch-library/include/instance/adc.h b/watch-library/hardware/include/instance/adc.h
index 593cf070..593cf070 100644
--- a/watch-library/include/instance/adc.h
+++ b/watch-library/hardware/include/instance/adc.h
diff --git a/watch-library/include/instance/aes.h b/watch-library/hardware/include/instance/aes.h
index 1d39e171..1d39e171 100644
--- a/watch-library/include/instance/aes.h
+++ b/watch-library/hardware/include/instance/aes.h
diff --git a/watch-library/include/instance/ccl.h b/watch-library/hardware/include/instance/ccl.h
index b1e6e8e5..b1e6e8e5 100644
--- a/watch-library/include/instance/ccl.h
+++ b/watch-library/hardware/include/instance/ccl.h
diff --git a/watch-library/include/instance/dmac.h b/watch-library/hardware/include/instance/dmac.h
index 2b7580d2..2b7580d2 100644
--- a/watch-library/include/instance/dmac.h
+++ b/watch-library/hardware/include/instance/dmac.h
diff --git a/watch-library/include/instance/dsu.h b/watch-library/hardware/include/instance/dsu.h
index 8c13d4f1..8c13d4f1 100644
--- a/watch-library/include/instance/dsu.h
+++ b/watch-library/hardware/include/instance/dsu.h
diff --git a/watch-library/include/instance/eic.h b/watch-library/hardware/include/instance/eic.h
index 31a5a31f..31a5a31f 100644
--- a/watch-library/include/instance/eic.h
+++ b/watch-library/hardware/include/instance/eic.h
diff --git a/watch-library/include/instance/evsys.h b/watch-library/hardware/include/instance/evsys.h
index a78277ac..a78277ac 100644
--- a/watch-library/include/instance/evsys.h
+++ b/watch-library/hardware/include/instance/evsys.h
diff --git a/watch-library/include/instance/freqm.h b/watch-library/hardware/include/instance/freqm.h
index 4c2e2102..4c2e2102 100644
--- a/watch-library/include/instance/freqm.h
+++ b/watch-library/hardware/include/instance/freqm.h
diff --git a/watch-library/include/instance/gclk.h b/watch-library/hardware/include/instance/gclk.h
index 869d77c6..869d77c6 100644
--- a/watch-library/include/instance/gclk.h
+++ b/watch-library/hardware/include/instance/gclk.h
diff --git a/watch-library/include/instance/mclk.h b/watch-library/hardware/include/instance/mclk.h
index 32af4f13..32af4f13 100644
--- a/watch-library/include/instance/mclk.h
+++ b/watch-library/hardware/include/instance/mclk.h
diff --git a/watch-library/include/instance/mtb.h b/watch-library/hardware/include/instance/mtb.h
index 02e67161..02e67161 100644
--- a/watch-library/include/instance/mtb.h
+++ b/watch-library/hardware/include/instance/mtb.h
diff --git a/watch-library/include/instance/nvmctrl.h b/watch-library/hardware/include/instance/nvmctrl.h
index 89adf7ee..89adf7ee 100644
--- a/watch-library/include/instance/nvmctrl.h
+++ b/watch-library/hardware/include/instance/nvmctrl.h
diff --git a/watch-library/include/instance/osc32kctrl.h b/watch-library/hardware/include/instance/osc32kctrl.h
index 6edc7597..6edc7597 100644
--- a/watch-library/include/instance/osc32kctrl.h
+++ b/watch-library/hardware/include/instance/osc32kctrl.h
diff --git a/watch-library/include/instance/oscctrl.h b/watch-library/hardware/include/instance/oscctrl.h
index bd390207..bd390207 100644
--- a/watch-library/include/instance/oscctrl.h
+++ b/watch-library/hardware/include/instance/oscctrl.h
diff --git a/watch-library/include/instance/pac.h b/watch-library/hardware/include/instance/pac.h
index cc3d94d5..cc3d94d5 100644
--- a/watch-library/include/instance/pac.h
+++ b/watch-library/hardware/include/instance/pac.h
diff --git a/watch-library/include/instance/pm.h b/watch-library/hardware/include/instance/pm.h
index 6ca464f2..6ca464f2 100644
--- a/watch-library/include/instance/pm.h
+++ b/watch-library/hardware/include/instance/pm.h
diff --git a/watch-library/include/instance/port.h b/watch-library/hardware/include/instance/port.h
index 6ec1564d..6ec1564d 100644
--- a/watch-library/include/instance/port.h
+++ b/watch-library/hardware/include/instance/port.h
diff --git a/watch-library/include/instance/ptc.h b/watch-library/hardware/include/instance/ptc.h
index 03c6b30d..03c6b30d 100644
--- a/watch-library/include/instance/ptc.h
+++ b/watch-library/hardware/include/instance/ptc.h
diff --git a/watch-library/include/instance/rstc.h b/watch-library/hardware/include/instance/rstc.h
index e6186fd4..e6186fd4 100644
--- a/watch-library/include/instance/rstc.h
+++ b/watch-library/hardware/include/instance/rstc.h
diff --git a/watch-library/include/instance/rtc.h b/watch-library/hardware/include/instance/rtc.h
index 5c6bf72d..5c6bf72d 100644
--- a/watch-library/include/instance/rtc.h
+++ b/watch-library/hardware/include/instance/rtc.h
diff --git a/watch-library/include/instance/sercom0.h b/watch-library/hardware/include/instance/sercom0.h
index 7160d497..7160d497 100644
--- a/watch-library/include/instance/sercom0.h
+++ b/watch-library/hardware/include/instance/sercom0.h
diff --git a/watch-library/include/instance/sercom1.h b/watch-library/hardware/include/instance/sercom1.h
index 1c0176ef..1c0176ef 100644
--- a/watch-library/include/instance/sercom1.h
+++ b/watch-library/hardware/include/instance/sercom1.h
diff --git a/watch-library/include/instance/sercom2.h b/watch-library/hardware/include/instance/sercom2.h
index 6c8458cc..6c8458cc 100644
--- a/watch-library/include/instance/sercom2.h
+++ b/watch-library/hardware/include/instance/sercom2.h
diff --git a/watch-library/include/instance/sercom3.h b/watch-library/hardware/include/instance/sercom3.h
index f7256e22..f7256e22 100644
--- a/watch-library/include/instance/sercom3.h
+++ b/watch-library/hardware/include/instance/sercom3.h
diff --git a/watch-library/include/instance/sercom4.h b/watch-library/hardware/include/instance/sercom4.h
index d5f5d736..d5f5d736 100644
--- a/watch-library/include/instance/sercom4.h
+++ b/watch-library/hardware/include/instance/sercom4.h
diff --git a/watch-library/include/instance/sercom5.h b/watch-library/hardware/include/instance/sercom5.h
index 93214cf3..93214cf3 100644
--- a/watch-library/include/instance/sercom5.h
+++ b/watch-library/hardware/include/instance/sercom5.h
diff --git a/watch-library/include/instance/slcd.h b/watch-library/hardware/include/instance/slcd.h
index c4785831..c4785831 100644
--- a/watch-library/include/instance/slcd.h
+++ b/watch-library/hardware/include/instance/slcd.h
diff --git a/watch-library/include/instance/supc.h b/watch-library/hardware/include/instance/supc.h
index 0800c5f3..0800c5f3 100644
--- a/watch-library/include/instance/supc.h
+++ b/watch-library/hardware/include/instance/supc.h
diff --git a/watch-library/include/instance/tc0.h b/watch-library/hardware/include/instance/tc0.h
index a50b87e9..a50b87e9 100644
--- a/watch-library/include/instance/tc0.h
+++ b/watch-library/hardware/include/instance/tc0.h
diff --git a/watch-library/include/instance/tc1.h b/watch-library/hardware/include/instance/tc1.h
index 9acada8a..9acada8a 100644
--- a/watch-library/include/instance/tc1.h
+++ b/watch-library/hardware/include/instance/tc1.h
diff --git a/watch-library/include/instance/tc2.h b/watch-library/hardware/include/instance/tc2.h
index 13b8fb2a..13b8fb2a 100644
--- a/watch-library/include/instance/tc2.h
+++ b/watch-library/hardware/include/instance/tc2.h
diff --git a/watch-library/include/instance/tc3.h b/watch-library/hardware/include/instance/tc3.h
index 7555903a..7555903a 100644
--- a/watch-library/include/instance/tc3.h
+++ b/watch-library/hardware/include/instance/tc3.h
diff --git a/watch-library/include/instance/tcc0.h b/watch-library/hardware/include/instance/tcc0.h
index e5567d45..e5567d45 100644
--- a/watch-library/include/instance/tcc0.h
+++ b/watch-library/hardware/include/instance/tcc0.h
diff --git a/watch-library/include/instance/trng.h b/watch-library/hardware/include/instance/trng.h
index 0f80f00a..0f80f00a 100644
--- a/watch-library/include/instance/trng.h
+++ b/watch-library/hardware/include/instance/trng.h
diff --git a/watch-library/include/instance/usb.h b/watch-library/hardware/include/instance/usb.h
index 9060d62e..9060d62e 100644
--- a/watch-library/include/instance/usb.h
+++ b/watch-library/hardware/include/instance/usb.h
diff --git a/watch-library/include/instance/wdt.h b/watch-library/hardware/include/instance/wdt.h
index 2bb1d1ba..2bb1d1ba 100644
--- a/watch-library/include/instance/wdt.h
+++ b/watch-library/hardware/include/instance/wdt.h
diff --git a/watch-library/include/pio/saml22g16a.h b/watch-library/hardware/include/pio/saml22g16a.h
index 2c4d2ee5..2c4d2ee5 100644
--- a/watch-library/include/pio/saml22g16a.h
+++ b/watch-library/hardware/include/pio/saml22g16a.h
diff --git a/watch-library/include/pio/saml22g17a.h b/watch-library/hardware/include/pio/saml22g17a.h
index 582cf91f..582cf91f 100644
--- a/watch-library/include/pio/saml22g17a.h
+++ b/watch-library/hardware/include/pio/saml22g17a.h
diff --git a/watch-library/include/pio/saml22g18a.h b/watch-library/hardware/include/pio/saml22g18a.h
index 3570da86..3570da86 100644
--- a/watch-library/include/pio/saml22g18a.h
+++ b/watch-library/hardware/include/pio/saml22g18a.h
diff --git a/watch-library/include/pio/saml22j16a.h b/watch-library/hardware/include/pio/saml22j16a.h
index 055a2b55..055a2b55 100644
--- a/watch-library/include/pio/saml22j16a.h
+++ b/watch-library/hardware/include/pio/saml22j16a.h
diff --git a/watch-library/include/pio/saml22j17a.h b/watch-library/hardware/include/pio/saml22j17a.h
index 9dae1d93..9dae1d93 100644
--- a/watch-library/include/pio/saml22j17a.h
+++ b/watch-library/hardware/include/pio/saml22j17a.h
diff --git a/watch-library/include/pio/saml22j18a.h b/watch-library/hardware/include/pio/saml22j18a.h
index d2c8c3c7..d2c8c3c7 100644
--- a/watch-library/include/pio/saml22j18a.h
+++ b/watch-library/hardware/include/pio/saml22j18a.h
diff --git a/watch-library/include/pio/saml22n16a.h b/watch-library/hardware/include/pio/saml22n16a.h
index bd4c515f..bd4c515f 100644
--- a/watch-library/include/pio/saml22n16a.h
+++ b/watch-library/hardware/include/pio/saml22n16a.h
diff --git a/watch-library/include/pio/saml22n17a.h b/watch-library/hardware/include/pio/saml22n17a.h
index b7c98cd0..b7c98cd0 100644
--- a/watch-library/include/pio/saml22n17a.h
+++ b/watch-library/hardware/include/pio/saml22n17a.h
diff --git a/watch-library/include/pio/saml22n18a.h b/watch-library/hardware/include/pio/saml22n18a.h
index ad683b1d..ad683b1d 100644
--- a/watch-library/include/pio/saml22n18a.h
+++ b/watch-library/hardware/include/pio/saml22n18a.h
diff --git a/watch-library/include/sam.h b/watch-library/hardware/include/sam.h
index c5702205..c5702205 100644
--- a/watch-library/include/sam.h
+++ b/watch-library/hardware/include/sam.h
diff --git a/watch-library/include/saml22.h b/watch-library/hardware/include/saml22.h
index d1a84287..d1a84287 100644
--- a/watch-library/include/saml22.h
+++ b/watch-library/hardware/include/saml22.h
diff --git a/watch-library/include/saml22g16a.h b/watch-library/hardware/include/saml22g16a.h
index d2690bd4..d2690bd4 100644
--- a/watch-library/include/saml22g16a.h
+++ b/watch-library/hardware/include/saml22g16a.h
diff --git a/watch-library/include/saml22g17a.h b/watch-library/hardware/include/saml22g17a.h
index d3932fc0..d3932fc0 100644
--- a/watch-library/include/saml22g17a.h
+++ b/watch-library/hardware/include/saml22g17a.h
diff --git a/watch-library/include/saml22g18a.h b/watch-library/hardware/include/saml22g18a.h
index 588a3f1e..588a3f1e 100644
--- a/watch-library/include/saml22g18a.h
+++ b/watch-library/hardware/include/saml22g18a.h
diff --git a/watch-library/include/saml22j16a.h b/watch-library/hardware/include/saml22j16a.h
index 35d65a1c..35d65a1c 100644
--- a/watch-library/include/saml22j16a.h
+++ b/watch-library/hardware/include/saml22j16a.h
diff --git a/watch-library/include/saml22j17a.h b/watch-library/hardware/include/saml22j17a.h
index a1c95952..a1c95952 100644
--- a/watch-library/include/saml22j17a.h
+++ b/watch-library/hardware/include/saml22j17a.h
diff --git a/watch-library/include/saml22j18a.h b/watch-library/hardware/include/saml22j18a.h
index 8286db88..8286db88 100644
--- a/watch-library/include/saml22j18a.h
+++ b/watch-library/hardware/include/saml22j18a.h
diff --git a/watch-library/include/saml22n16a.h b/watch-library/hardware/include/saml22n16a.h
index 34ea155d..34ea155d 100644
--- a/watch-library/include/saml22n16a.h
+++ b/watch-library/hardware/include/saml22n16a.h
diff --git a/watch-library/include/saml22n17a.h b/watch-library/hardware/include/saml22n17a.h
index 7b3cd85a..7b3cd85a 100644
--- a/watch-library/include/saml22n17a.h
+++ b/watch-library/hardware/include/saml22n17a.h
diff --git a/watch-library/include/saml22n18a.h b/watch-library/hardware/include/saml22n18a.h
index de160b83..de160b83 100644
--- a/watch-library/include/saml22n18a.h
+++ b/watch-library/hardware/include/saml22n18a.h
diff --git a/watch-library/include/system_saml22.h b/watch-library/hardware/include/system_saml22.h
index e41bb831..e41bb831 100644
--- a/watch-library/include/system_saml22.h
+++ b/watch-library/hardware/include/system_saml22.h
diff --git a/watch-library/linker/saml22j18.ld b/watch-library/hardware/linker/saml22j18.ld
index a9801509..a9801509 100755
--- a/watch-library/linker/saml22j18.ld
+++ b/watch-library/hardware/linker/saml22j18.ld
diff --git a/watch-library/main.c b/watch-library/hardware/main.c
index 1fe751ef..1fe751ef 100755
--- a/watch-library/main.c
+++ b/watch-library/hardware/main.c
diff --git a/watch-library/startup_saml22.c b/watch-library/hardware/startup_saml22.c
index f4982564..f4982564 100755
--- a/watch-library/startup_saml22.c
+++ b/watch-library/hardware/startup_saml22.c
diff --git a/watch-library/watch/tusb_config.h b/watch-library/hardware/watch/tusb_config.h
index a22b2b99..a22b2b99 100644
--- a/watch-library/watch/tusb_config.h
+++ b/watch-library/hardware/watch/tusb_config.h
diff --git a/watch-library/watch/watch.c b/watch-library/hardware/watch/watch.c
index 791fd974..791fd974 100644
--- a/watch-library/watch/watch.c
+++ b/watch-library/hardware/watch/watch.c
diff --git a/watch-library/watch/watch_adc.c b/watch-library/hardware/watch/watch_adc.c
index 5ba7abdf..5ba7abdf 100644
--- a/watch-library/watch/watch_adc.c
+++ b/watch-library/hardware/watch/watch_adc.c
diff --git a/watch-library/watch/watch_buzzer.c b/watch-library/hardware/watch/watch_buzzer.c
index a275b00d..a275b00d 100644
--- a/watch-library/watch/watch_buzzer.c
+++ b/watch-library/hardware/watch/watch_buzzer.c
diff --git a/watch-library/watch/watch_deepsleep.c b/watch-library/hardware/watch/watch_deepsleep.c
index 1813ff24..1813ff24 100644
--- a/watch-library/watch/watch_deepsleep.c
+++ b/watch-library/hardware/watch/watch_deepsleep.c
diff --git a/watch-library/watch/watch_extint.c b/watch-library/hardware/watch/watch_extint.c
index 5924b646..5924b646 100644
--- a/watch-library/watch/watch_extint.c
+++ b/watch-library/hardware/watch/watch_extint.c
diff --git a/watch-library/watch/watch_gpio.c b/watch-library/hardware/watch/watch_gpio.c
index b37d009f..b37d009f 100644
--- a/watch-library/watch/watch_gpio.c
+++ b/watch-library/hardware/watch/watch_gpio.c
diff --git a/watch-library/watch/watch_i2c.c b/watch-library/hardware/watch/watch_i2c.c
index ff20afc6..ff20afc6 100644
--- a/watch-library/watch/watch_i2c.c
+++ b/watch-library/hardware/watch/watch_i2c.c
diff --git a/watch-library/watch/watch_led.c b/watch-library/hardware/watch/watch_led.c
index 52174b54..52174b54 100644
--- a/watch-library/watch/watch_led.c
+++ b/watch-library/hardware/watch/watch_led.c
diff --git a/watch-library/watch/watch_private.c b/watch-library/hardware/watch/watch_private.c
index ae2589e7..ae2589e7 100644
--- a/watch-library/watch/watch_private.c
+++ b/watch-library/hardware/watch/watch_private.c
diff --git a/watch-library/watch/watch_rtc.c b/watch-library/hardware/watch/watch_rtc.c
index 14a968c4..14a968c4 100644
--- a/watch-library/watch/watch_rtc.c
+++ b/watch-library/hardware/watch/watch_rtc.c
diff --git a/watch-library/hardware/watch/watch_slcd.c b/watch-library/hardware/watch/watch_slcd.c
new file mode 100644
index 00000000..c3bacd0d
--- /dev/null
+++ b/watch-library/hardware/watch/watch_slcd.c
@@ -0,0 +1,101 @@
+/*
+ * MIT License
+ *
+ * Copyright (c) 2020 Joey Castillo
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include "watch_slcd.h"
+#include "watch_private_display.h"
+#include "hpl_slcd_config.h"
+
+ //////////////////////////////////////////////////////////////////////////////////////////
+// Segmented Display
+
+static void _sync_slcd(void) {
+ while (SLCD->SYNCBUSY.reg);
+}
+
+void watch_enable_display(void) {
+ SEGMENT_LCD_0_init();
+ slcd_sync_enable(&SEGMENT_LCD_0);
+}
+
+inline void watch_set_pixel(uint8_t com, uint8_t seg) {
+ slcd_sync_seg_on(&SEGMENT_LCD_0, SLCD_SEGID(com, seg));
+}
+
+inline void watch_clear_pixel(uint8_t com, uint8_t seg) {
+ slcd_sync_seg_off(&SEGMENT_LCD_0, SLCD_SEGID(com, seg));
+}
+
+void watch_clear_display(void) {
+ SLCD->SDATAL0.reg = 0;
+ SLCD->SDATAL1.reg = 0;
+ SLCD->SDATAL2.reg = 0;
+}
+
+void watch_start_character_blink(char character, uint32_t duration) {
+ SLCD->CTRLD.bit.FC0EN = 0;
+ _sync_slcd();
+
+ if (duration <= SLCD_FC_BYPASS_MAX_MS) {
+ SLCD->FC0.reg = SLCD_FC0_PB | ((duration / (1000 / SLCD_FRAME_FREQUENCY)) - 1);
+ } else {
+ SLCD->FC0.reg = (((duration / (1000 / SLCD_FRAME_FREQUENCY)) / 8 - 1));
+ }
+ SLCD->CTRLD.bit.FC0EN = 1;
+
+ watch_display_character(character, 7);
+ watch_clear_pixel(2, 10); // clear segment B of position 7 since it can't blink
+
+ SLCD->CTRLD.bit.BLINK = 0;
+ SLCD->CTRLA.bit.ENABLE = 0;
+ _sync_slcd();
+
+ SLCD->BCFG.bit.BSS0 = 0x07;
+ SLCD->BCFG.bit.BSS1 = 0x07;
+
+ SLCD->CTRLD.bit.BLINK = 1;
+ _sync_slcd();
+ SLCD->CTRLA.bit.ENABLE = 1;
+ _sync_slcd();
+}
+
+void watch_stop_blink(void) {
+ SLCD->CTRLD.bit.FC0EN = 0;
+ SLCD->CTRLD.bit.BLINK = 0;
+}
+
+void watch_start_tick_animation(uint32_t duration) {
+ watch_display_character(' ', 8);
+ const uint32_t segs[] = { SLCD_SEGID(0, 2)};
+ slcd_sync_start_animation(&SEGMENT_LCD_0, segs, 1, duration);
+}
+
+bool watch_tick_animation_is_running(void) {
+ return hri_slcd_get_CTRLD_CSREN_bit(SLCD);
+}
+
+void watch_stop_tick_animation(void) {
+ const uint32_t segs[] = { SLCD_SEGID(0, 2)};
+ slcd_sync_stop_animation(&SEGMENT_LCD_0, segs, 1);
+ watch_display_character(' ', 8);
+}
diff --git a/watch-library/watch/watch_uart.c b/watch-library/hardware/watch/watch_uart.c
index 64b63bee..64b63bee 100644
--- a/watch-library/watch/watch_uart.c
+++ b/watch-library/hardware/watch/watch_uart.c
diff --git a/watch-library/config/RTE_Components.h b/watch-library/shared/config/RTE_Components.h
index 3ba6b1ba..3ba6b1ba 100644
--- a/watch-library/config/RTE_Components.h
+++ b/watch-library/shared/config/RTE_Components.h
diff --git a/watch-library/config/hpl_dmac_config.h b/watch-library/shared/config/hpl_dmac_config.h
index 36adb88b..36adb88b 100644
--- a/watch-library/config/hpl_dmac_config.h
+++ b/watch-library/shared/config/hpl_dmac_config.h
diff --git a/watch-library/config/hpl_eic_config.h b/watch-library/shared/config/hpl_eic_config.h
index be54c2e1..be54c2e1 100644
--- a/watch-library/config/hpl_eic_config.h
+++ b/watch-library/shared/config/hpl_eic_config.h
diff --git a/watch-library/config/hpl_gclk_config.h b/watch-library/shared/config/hpl_gclk_config.h
index ee7aace3..ee7aace3 100644
--- a/watch-library/config/hpl_gclk_config.h
+++ b/watch-library/shared/config/hpl_gclk_config.h
diff --git a/watch-library/config/hpl_mclk_config.h b/watch-library/shared/config/hpl_mclk_config.h
index 3358edcf..3358edcf 100644
--- a/watch-library/config/hpl_mclk_config.h
+++ b/watch-library/shared/config/hpl_mclk_config.h
diff --git a/watch-library/config/hpl_nvmctrl_config.h b/watch-library/shared/config/hpl_nvmctrl_config.h
index 76d49bac..76d49bac 100755
--- a/watch-library/config/hpl_nvmctrl_config.h
+++ b/watch-library/shared/config/hpl_nvmctrl_config.h
diff --git a/watch-library/config/hpl_osc32kctrl_config.h b/watch-library/shared/config/hpl_osc32kctrl_config.h
index 540f1c60..540f1c60 100644
--- a/watch-library/config/hpl_osc32kctrl_config.h
+++ b/watch-library/shared/config/hpl_osc32kctrl_config.h
diff --git a/watch-library/config/hpl_oscctrl_config.h b/watch-library/shared/config/hpl_oscctrl_config.h
index ba2d42e6..ba2d42e6 100644
--- a/watch-library/config/hpl_oscctrl_config.h
+++ b/watch-library/shared/config/hpl_oscctrl_config.h
diff --git a/watch-library/config/hpl_port_config.h b/watch-library/shared/config/hpl_port_config.h
index 1efce33e..1efce33e 100644
--- a/watch-library/config/hpl_port_config.h
+++ b/watch-library/shared/config/hpl_port_config.h
diff --git a/watch-library/config/hpl_rtc_config.h b/watch-library/shared/config/hpl_rtc_config.h
index 9085ca37..9085ca37 100644
--- a/watch-library/config/hpl_rtc_config.h
+++ b/watch-library/shared/config/hpl_rtc_config.h
diff --git a/watch-library/config/hpl_sercom_config.h b/watch-library/shared/config/hpl_sercom_config.h
index 6df4b08e..6df4b08e 100644
--- a/watch-library/config/hpl_sercom_config.h
+++ b/watch-library/shared/config/hpl_sercom_config.h
diff --git a/watch-library/config/hpl_slcd_config.h b/watch-library/shared/config/hpl_slcd_config.h
index d78e3391..d78e3391 100644
--- a/watch-library/config/hpl_slcd_config.h
+++ b/watch-library/shared/config/hpl_slcd_config.h
diff --git a/watch-library/config/hpl_systick_config.h b/watch-library/shared/config/hpl_systick_config.h
index a7f2f362..a7f2f362 100644
--- a/watch-library/config/hpl_systick_config.h
+++ b/watch-library/shared/config/hpl_systick_config.h
diff --git a/watch-library/config/hpl_trng_config.h b/watch-library/shared/config/hpl_trng_config.h
index ba901498..ba901498 100755
--- a/watch-library/config/hpl_trng_config.h
+++ b/watch-library/shared/config/hpl_trng_config.h
diff --git a/watch-library/config/nv_storage_config.h b/watch-library/shared/config/nv_storage_config.h
index 4888d1bd..4888d1bd 100755
--- a/watch-library/config/nv_storage_config.h
+++ b/watch-library/shared/config/nv_storage_config.h
diff --git a/watch-library/config/peripheral_clk_config.h b/watch-library/shared/config/peripheral_clk_config.h
index 523b036c..523b036c 100644
--- a/watch-library/config/peripheral_clk_config.h
+++ b/watch-library/shared/config/peripheral_clk_config.h
diff --git a/watch-library/driver/lis2dh.c b/watch-library/shared/driver/lis2dh.c
index 20702bf5..20702bf5 100644
--- a/watch-library/driver/lis2dh.c
+++ b/watch-library/shared/driver/lis2dh.c
diff --git a/watch-library/driver/lis2dh.h b/watch-library/shared/driver/lis2dh.h
index 68831519..68831519 100644
--- a/watch-library/driver/lis2dh.h
+++ b/watch-library/shared/driver/lis2dh.h
diff --git a/watch-library/driver/lis2dw.c b/watch-library/shared/driver/lis2dw.c
index 6e1ac56d..6e1ac56d 100644
--- a/watch-library/driver/lis2dw.c
+++ b/watch-library/shared/driver/lis2dw.c
diff --git a/watch-library/driver/lis2dw.h b/watch-library/shared/driver/lis2dw.h
index 22b4484f..22b4484f 100644
--- a/watch-library/driver/lis2dw.h
+++ b/watch-library/shared/driver/lis2dw.h
diff --git a/watch-library/watch/watch.h b/watch-library/shared/watch/watch.h
index 064f90ec..064f90ec 100644
--- a/watch-library/watch/watch.h
+++ b/watch-library/shared/watch/watch.h
diff --git a/watch-library/watch/watch_adc.h b/watch-library/shared/watch/watch_adc.h
index aa7c801a..d4c8586d 100644
--- a/watch-library/watch/watch_adc.h
+++ b/watch-library/shared/watch/watch_adc.h
@@ -27,6 +27,23 @@
#include "watch.h"
+// matches adc.h
+#ifndef ADC_REFCTRL_REFSEL_INTREF_Val
+#define ADC_REFCTRL_REFSEL_INTREF_Val 0x0
+#endif
+
+#ifndef ADC_REFCTRL_REFSEL_INTVCC0_Val
+#define ADC_REFCTRL_REFSEL_INTVCC0_Val 0x1
+#endif
+
+#ifndef ADC_REFCTRL_REFSEL_INTVCC1_Val
+#define ADC_REFCTRL_REFSEL_INTVCC1_Val 0x2
+#endif
+
+#ifndef ADC_REFCTRL_REFSEL_INTVCC2_Val
+#define ADC_REFCTRL_REFSEL_INTVCC2_Val 0x5
+#endif
+
/** @addtogroup adc Analog Input
* @brief This section covers functions related to the SAM L22's analog-to-digital converter,
* as well as configuring and reading values from the five analog-capable pins on the
diff --git a/watch-library/watch/watch_app.h b/watch-library/shared/watch/watch_app.h
index 4fa29df8..4fa29df8 100644
--- a/watch-library/watch/watch_app.h
+++ b/watch-library/shared/watch/watch_app.h
diff --git a/watch-library/watch/watch_buzzer.h b/watch-library/shared/watch/watch_buzzer.h
index 1b5d197c..1b5d197c 100644
--- a/watch-library/watch/watch_buzzer.h
+++ b/watch-library/shared/watch/watch_buzzer.h
diff --git a/watch-library/watch/watch_deepsleep.h b/watch-library/shared/watch/watch_deepsleep.h
index 56d75478..56d75478 100644
--- a/watch-library/watch/watch_deepsleep.h
+++ b/watch-library/shared/watch/watch_deepsleep.h
diff --git a/watch-library/watch/watch_extint.h b/watch-library/shared/watch/watch_extint.h
index 452461b3..452461b3 100644
--- a/watch-library/watch/watch_extint.h
+++ b/watch-library/shared/watch/watch_extint.h
diff --git a/watch-library/watch/watch_gpio.h b/watch-library/shared/watch/watch_gpio.h
index fc43642c..fc43642c 100644
--- a/watch-library/watch/watch_gpio.h
+++ b/watch-library/shared/watch/watch_gpio.h
diff --git a/watch-library/watch/watch_i2c.h b/watch-library/shared/watch/watch_i2c.h
index fbcc1a92..fbcc1a92 100644
--- a/watch-library/watch/watch_i2c.h
+++ b/watch-library/shared/watch/watch_i2c.h
diff --git a/watch-library/watch/watch_led.h b/watch-library/shared/watch/watch_led.h
index 9e9f5640..9e9f5640 100644
--- a/watch-library/watch/watch_led.h
+++ b/watch-library/shared/watch/watch_led.h
diff --git a/watch-library/watch/watch_private.h b/watch-library/shared/watch/watch_private.h
index 7bb91d1f..7bb91d1f 100644
--- a/watch-library/watch/watch_private.h
+++ b/watch-library/shared/watch/watch_private.h
diff --git a/watch-library/shared/watch/watch_private_display.c b/watch-library/shared/watch/watch_private_display.c
new file mode 100644
index 00000000..87e3f1ae
--- /dev/null
+++ b/watch-library/shared/watch/watch_private_display.c
@@ -0,0 +1,137 @@
+/*
+ * MIT License
+ *
+ * Copyright (c) 2020 Joey Castillo
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include "watch_slcd.h"
+#include "watch_private_display.h"
+
+static const uint32_t IndicatorSegments[] = {
+ SLCD_SEGID(0, 17), // WATCH_INDICATOR_SIGNAL
+ SLCD_SEGID(0, 16), // WATCH_INDICATOR_BELL
+ SLCD_SEGID(2, 17), // WATCH_INDICATOR_PM
+ SLCD_SEGID(2, 16), // WATCH_INDICATOR_24H
+ SLCD_SEGID(1, 10), // WATCH_INDICATOR_LAP
+};
+
+void watch_display_character(uint8_t character, uint8_t position) {
+ // special cases for positions 4 and 6
+ if (position == 4 || position == 6) {
+ if (character == '7') character = '&'; // "lowercase" 7
+ else if (character == 'A') character = 'a'; // A needs to be lowercase
+ else if (character == 'o') character = 'O'; // O needs to be uppercase
+ else if (character == 'L') character = '!'; // L needs to be in top half
+ else if (character == 'M' || character == 'm' || character == 'N') character = 'n'; // M and uppercase N need to be lowercase n
+ else if (character == 'c') character = 'C'; // C needs to be uppercase
+ else if (character == 'J') character = 'j'; // same
+ else if (character == 'v' || character == 'V' || character == 'U' || character == 'W' || character == 'w') character = 'u'; // bottom segment duplicated, so show in top half
+ } else {
+ if (character == 'u') character = 'v'; // we can use the bottom segment; move to lower half
+ else if (character == 'j') character = 'J'; // same but just display a normal J
+ }
+ if (position > 1) {
+ if (character == 'T') character = 't'; // uppercase T only works in positions 0 and 1
+ }
+ if (position == 1) {
+ if (character == 'o') character = 'O'; // O needs to be uppercase
+ if (character == 'i') character = 'l'; // I needs to be uppercase (use an l, it looks the same)
+ if (character == 'n') character = 'N'; // N needs to be uppercase
+ if (character == 'r') character = 'R'; // R needs to be uppercase
+ if (character == 'd') character = 'D'; // D needs to be uppercase
+ if (character == 'v' || character == 'V' || character == 'u') character = 'U'; // side segments shared, make uppercase
+ if (character == 'b') character = 'B'; // B needs to be uppercase
+ if (character == 'c') character = 'C'; // C needs to be uppercase
+ } else {
+ if (character == 'R') character = 'r'; // R needs to be lowercase almost everywhere
+ }
+ if (position == 0) {
+ watch_clear_pixel(0, 15); // clear funky ninth segment
+ } else {
+ if (character == 'I') character = 'l'; // uppercase I only works in position 0
+ }
+
+ uint64_t segmap = Segment_Map[position];
+ uint64_t segdata = Character_Set[character - 0x20];
+
+ for (int i = 0; i < 8; i++) {
+ uint8_t com = (segmap & 0xFF) >> 6;
+ if (com > 2) {
+ // COM3 means no segment exists; skip it.
+ segmap = segmap >> 8;
+ segdata = segdata >> 1;
+ continue;
+ }
+ uint8_t seg = segmap & 0x3F;
+ watch_clear_pixel(com, seg);
+ if (segdata & 1) watch_set_pixel(com, seg);
+ segmap = segmap >> 8;
+ segdata = segdata >> 1;
+ }
+
+ if (character == 'T' && position == 1) watch_set_pixel(1, 12); // add descender
+ else if (position == 0 && (character == 'B' || character == 'D')) watch_set_pixel(0, 15); // add funky ninth segment
+ else if (position == 1 && (character == 'B' || character == 'D' || character == '@')) watch_set_pixel(0, 12); // add funky ninth segment
+}
+
+void watch_display_string(char *string, uint8_t position) {
+ size_t i = 0;
+ while(string[i] != 0) {
+ watch_display_character(string[i], position + i);
+ i++;
+ if (position + i >= Num_Chars) break;
+ }
+ // uncomment this line to see screen output on terminal, i.e.
+ // FR 29
+ // 11 50 23
+ // note that for partial displays (positon > 0) it will only show the characters that were updated.
+ // printf("________\n %c%c %c%c\n%c%c %c%c %c%c\n--------\n", (position > 0) ? ' ' : string[0], (position > 1) ? ' ' : string[1 - position], (position > 2) ? ' ' : string[2 - position], (position > 3) ? ' ' : string[3 - position], (position > 4) ? ' ' : string[4 - position], (position > 5) ? ' ' : string[5 - position], (position > 6) ? ' ' : string[6 - position], (position > 7) ? ' ' : string[7 - position], (position > 8) ? ' ' : string[8 - position], (position > 9) ? ' ' : string[9 - position]);
+}
+
+void watch_set_colon(void) {
+ watch_set_pixel(1, 16);
+}
+
+void watch_clear_colon(void) {
+ watch_clear_pixel(1, 16);
+}
+
+void watch_set_indicator(WatchIndicatorSegment indicator) {
+ uint32_t value = IndicatorSegments[indicator];
+ uint8_t com = SLCD_COMNUM(value);
+ uint8_t seg = SLCD_SEGNUM(value);
+ watch_set_pixel(com, seg);
+}
+
+void watch_clear_indicator(WatchIndicatorSegment indicator) {
+ uint32_t value = IndicatorSegments[indicator];
+ uint8_t com = SLCD_COMNUM(value);
+ uint8_t seg = SLCD_SEGNUM(value);
+ watch_clear_pixel(com, seg);
+}
+
+void watch_clear_all_indicators(void) {
+ watch_clear_pixel(2, 17);
+ watch_clear_pixel(2, 16);
+ watch_clear_pixel(0, 17);
+ watch_clear_pixel(0, 16);
+ watch_clear_pixel(1, 10);
+}
diff --git a/watch-library/shared/watch/watch_private_display.h b/watch-library/shared/watch/watch_private_display.h
new file mode 100644
index 00000000..08597848
--- /dev/null
+++ b/watch-library/shared/watch/watch_private_display.h
@@ -0,0 +1,146 @@
+/*
+ * MIT License
+ *
+ * Copyright (c) 2020 Joey Castillo
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+#ifndef _WATCH_PRIVATE_DISPLAY_H_INCLUDED
+#define _WATCH_PRIVATE_DISPLAY_H_INCLUDED
+
+#include "hpl_slcd_config.h"
+#include "driver_init.h"
+
+static const uint8_t Character_Set[] =
+{
+ 0b00000000, //
+ 0b01100000, // ! (L in the top half for positions 4 and 6)
+ 0b00100010, // "
+ 0b01100011, // # (degree symbol, hash mark doesn't fit)
+ 0b00000000, // $ (unused)
+ 0b00000000, // % (unused)
+ 0b01000100, // & ("lowercase 7" for positions 4 and 6)
+ 0b00100000, // '
+ 0b00111001, // (
+ 0b00001111, // )
+ 0b00000000, // * (unused)
+ 0b11000000, // + (only works in position 0)
+ 0b00000100, // ,
+ 0b01000000, // -
+ 0b01000000, // . (same as -, semantically most useful)
+ 0b00010010, // /
+ 0b00111111, // 0
+ 0b00000110, // 1
+ 0b01011011, // 2
+ 0b01001111, // 3
+ 0b01100110, // 4
+ 0b01101101, // 5
+ 0b01111101, // 6
+ 0b00000111, // 7
+ 0b01111111, // 8
+ 0b01101111, // 9
+ 0b00000000, // : (unused)
+ 0b00000000, // ; (unused)
+ 0b01011000, // <
+ 0b01001000, // =
+ 0b01001100, // >
+ 0b01010011, // ?
+ 0b11111111, // @ (all segments on)
+ 0b01110111, // A
+ 0b01111111, // B
+ 0b00111001, // C
+ 0b00111111, // D
+ 0b01111001, // E
+ 0b01110001, // F
+ 0b00111101, // G
+ 0b01110110, // H
+ 0b10001001, // I (only works in position 0)
+ 0b00001110, // J
+ 0b01110101, // K
+ 0b00111000, // L
+ 0b10110111, // M (only works in position 0)
+ 0b00110111, // N
+ 0b00111111, // O
+ 0b01110011, // P
+ 0b01100111, // Q
+ 0b11110111, // R (only works in position 1)
+ 0b01101101, // S
+ 0b10000001, // T (only works in position 0; set (1, 12) to make it work in position 1)
+ 0b00111110, // U
+ 0b00111110, // V
+ 0b10111110, // W (only works in position 0)
+ 0b01111110, // X
+ 0b01101110, // Y
+ 0b00011011, // Z
+ 0b00111001, // [
+ 0b00100100, // backslash
+ 0b00001111, // ]
+ 0b00100011, // ^
+ 0b00001000, // _
+ 0b00000010, // `
+ 0b01011111, // a
+ 0b01111100, // b
+ 0b01011000, // c
+ 0b01011110, // d
+ 0b01111011, // e
+ 0b01110001, // f
+ 0b01101111, // g
+ 0b01110100, // h
+ 0b00010000, // i
+ 0b01000010, // j (appears as superscript to work in more positions)
+ 0b01110101, // k
+ 0b00110000, // l
+ 0b10110111, // m (only works in position 0)
+ 0b01010100, // n
+ 0b01011100, // o
+ 0b01110011, // p
+ 0b01100111, // q
+ 0b01010000, // r
+ 0b01101101, // s
+ 0b01111000, // t
+ 0b01100010, // u (appears in (u)pper half to work in more positions)
+ 0b00011100, // v (looks like u but in the lower half)
+ 0b10111110, // w (only works in position 0)
+ 0b01111110, // x
+ 0b01101110, // y
+ 0b00011011, // z
+ 0b00111001, // {
+ 0b00110000, // |
+ 0b00001111, // }
+ 0b00000001, // ~
+};
+
+static const uint64_t Segment_Map[] = {
+ 0x4e4f0e8e8f8d4d0d, // Position 0, mode
+ 0xc8c4c4c8b4b4b0b, // Position 1, mode (Segments B and C shared, as are segments E and F)
+ 0xc049c00a49890949, // Position 2, day of month (Segments A, D, G shared; missing segment F)
+ 0xc048088886874707, // Position 3, day of month
+ 0xc053921252139352, // Position 4, clock hours (Segments A and D shared)
+ 0xc054511415559594, // Position 5, clock hours
+ 0xc057965616179716, // Position 6, clock minutes (Segments A and D shared)
+ 0xc041804000018a81, // Position 7, clock minutes
+ 0xc043420203048382, // Position 8, clock seconds
+ 0xc045440506468584, // Position 9, clock seconds
+};
+
+static const uint8_t Num_Chars = 10;
+
+void watch_display_character(uint8_t character, uint8_t position);
+
+#endif
diff --git a/watch-library/watch/watch_rtc.h b/watch-library/shared/watch/watch_rtc.h
index 6dac63f5..6dac63f5 100644
--- a/watch-library/watch/watch_rtc.h
+++ b/watch-library/shared/watch/watch_rtc.h
diff --git a/watch-library/watch/watch_slcd.h b/watch-library/shared/watch/watch_slcd.h
index 3f550bb0..3f550bb0 100644
--- a/watch-library/watch/watch_slcd.h
+++ b/watch-library/shared/watch/watch_slcd.h
diff --git a/watch-library/watch/watch_uart.h b/watch-library/shared/watch/watch_uart.h
index 3e98bd35..3e98bd35 100644
--- a/watch-library/watch/watch_uart.h
+++ b/watch-library/shared/watch/watch_uart.h
diff --git a/watch-library/watch/watch_utility.c b/watch-library/shared/watch/watch_utility.c
index 835076d9..835076d9 100644
--- a/watch-library/watch/watch_utility.c
+++ b/watch-library/shared/watch/watch_utility.c
diff --git a/watch-library/watch/watch_utility.h b/watch-library/shared/watch/watch_utility.h
index 66af6ed5..66af6ed5 100644
--- a/watch-library/watch/watch_utility.h
+++ b/watch-library/shared/watch/watch_utility.h
diff --git a/watch-library/simulator/hpl/port/hpl_gpio_base.h b/watch-library/simulator/hpl/port/hpl_gpio_base.h
new file mode 100644
index 00000000..c8fd6e0e
--- /dev/null
+++ b/watch-library/simulator/hpl/port/hpl_gpio_base.h
@@ -0,0 +1,87 @@
+
+/**
+ * \file
+ *
+ * \brief SAM PORT.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+#include <compiler.h>
+#include <hpl_gpio.h>
+#include <utils_assert.h>
+#include <hpl_port_config.h>
+
+/**
+ * \brief Set direction on port with mask
+ */
+static inline void _gpio_set_direction(const enum gpio_port port, const uint32_t mask,
+ const enum gpio_direction direction)
+{
+}
+
+/**
+ * \brief Set output level on port with mask
+ */
+static inline void _gpio_set_level(const enum gpio_port port, const uint32_t mask, const bool level)
+{
+}
+
+/**
+ * \brief Change output level to the opposite with mask
+ */
+static inline void _gpio_toggle_level(const enum gpio_port port, const uint32_t mask)
+{
+}
+
+/**
+ * \brief Get input levels on all port pins
+ */
+static inline uint32_t _gpio_get_level(const enum gpio_port port)
+{
+ uint32_t tmp = 0;
+ return tmp;
+}
+
+/**
+ * \brief Set pin pull mode
+ */
+static inline void _gpio_set_pin_pull_mode(const enum gpio_port port, const uint8_t pin,
+ const enum gpio_pull_mode pull_mode)
+{
+}
+
+/**
+ * \brief Set gpio pin function
+ */
+static inline void _gpio_set_pin_function(const uint32_t gpio, const uint32_t function)
+{
+}
+
+static inline void _port_event_init()
+{
+}
diff --git a/watch-library/simulator/main.c b/watch-library/simulator/main.c
new file mode 100644
index 00000000..5596bf82
--- /dev/null
+++ b/watch-library/simulator/main.c
@@ -0,0 +1,70 @@
+/*
+ * MIT License
+ *
+ * Copyright (c) 2022 Joey Castillo
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <stdio.h>
+#include "watch.h"
+
+#include <emscripten.h>
+#include <emscripten/html5.h>
+
+static bool sleeping = true;
+
+static EM_BOOL main_loop(double time, void *userData) {
+ if (sleeping) {
+ sleeping = false;
+ app_wake_from_standby();
+ }
+
+ bool can_sleep = app_loop();
+
+ if (can_sleep) {
+ app_prepare_for_standby();
+ sleeping = true;
+ return EM_FALSE;
+ }
+
+ return EM_TRUE;
+}
+
+// make compiler happy
+void resume_main_loop(void);
+
+EMSCRIPTEN_KEEPALIVE
+void resume_main_loop(void) {
+ if (sleeping) {
+ emscripten_request_animation_frame_loop(main_loop, NULL);
+ }
+}
+
+int main(void) {
+ printf("Hello, world!\n");
+
+ app_init();
+ _watch_init();
+ app_setup();
+
+ resume_main_loop();
+
+ return 0;
+}
diff --git a/watch-library/simulator/shell.html b/watch-library/simulator/shell.html
new file mode 100644
index 00000000..1a4de984
--- /dev/null
+++ b/watch-library/simulator/shell.html
@@ -0,0 +1,368 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <!--
+ Original F-91W SVG by Alexis Philip
+ https://github.com/alexisphilip/Casio-F-91W
+
+ MIT License
+
+ Copyright (c) 2020 Alexis Philip
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+ -->
+ <title>Sensor Watch Emulator</title>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1"/>
+ <style>
+ body { font-family: Helvetica, Arial, sans-serif; background-color: #808080; margin: 0; padding: 0; }
+ a { color: #001d5c; }
+ textarea { margin: 0; padding: 0; border: 0; font-size: medium; font-family: monospace; }
+ .highlight { fill: #fff !important; }
+ </style>
+</head>
+<body>
+
+<div style="max-width: 800px; margin: 0 auto; display: flex; flex-direction: column; align-items: center;">
+ <h1 style="text-align: center;">Sensor Watch Emulator</h1>
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 1271 1311" width="320">
+ <defs>
+ <radialGradient id="Dégradé_sans_nom_3" data-name="Dégradé sans nom 3" cx="635" cy="687" fx="260.1751499985994" r="374.83" gradientUnits="userSpaceOnUse">
+ <stop offset="0.28" stop-color="lime"/>
+ <stop offset="0.46" stop-color="#00b200" stop-opacity="0.7"/>
+ <stop offset="0.65" stop-color="#006700" stop-opacity="0.4"/>
+ <stop offset="0.82" stop-color="#002f00" stop-opacity="0.19"/>
+ <stop offset="0.94" stop-color="#000d00" stop-opacity="0.05"/>
+ <stop offset="1" stop-opacity="0"/>
+ </radialGradient>
+ </defs>
+ <g id="Calque">
+ <g id="Contours">
+ <path id="btn3" d="M1226,777h39.08a5.92,5.92,0,0,1,5.92,5.92v58.16a5.92,5.92,0,0,1-5.92,5.92H1226a0,0,0,0,1,0,0V777A0,0,0,0,1,1226,777Z" style="fill: #999"/>
+ <path id="btn2" d="M2593.5,686h39.08a5.92,5.92,0,0,1,5.92,5.92v58.16a5.92,5.92,0,0,1-5.92,5.92H2593.5a0,0,0,0,1,0,0V686A0,0,0,0,1,2593.5,686Z" transform="translate(2638.5 1533) rotate(180)" style="fill: #999"/>
+ <path id="btn1" d="M2593.5,386h39.08a5.92,5.92,0,0,1,5.92,5.92v58.16a5.92,5.92,0,0,1-5.92,5.92H2593.5a0,0,0,0,1,0,0V386A0,0,0,0,1,2593.5,386Z" transform="translate(2638.5 933) rotate(180)" style="fill: #999"/>
+ <path id="Contour_1" data-name="Contour 1" d="M2855-91h752c16,0,17,13,17,13l35,112c5,14,6,13,6,13l122,206a23,23,0,0,0,6,7l25,24a31.37,31.37,0,0,1,9,17l13,187c0,16-8,19-8,19l-29,24c2,46,0,84,0,84l28,21c6,5,6,15,6,15l-13,187c-1,12-7,16-7,16l-32,30a39.08,39.08,0,0,0-4,5l-121,206h0a107.12,107.12,0,0,0-6,12l-37,101a19.32,19.32,0,0,1-17,12H2868c-21,0-24-12-24-12l-37-99a123.46,123.46,0,0,0-8-18L2679,888c-4-6-12-12-12-12l-22-21c-9-9-8-19-8-19l-15-182c-1-10,4-14,4-14l30-27V532l-28-24a24.69,24.69,0,0,1-7-16l13-190c1-11,7-15,7-15l34-33c6-5,7-9,7-9L2792,52c7-10,9-18,9-18l36-111C2840-91,2855-91,2855-91Z" transform="translate(-2593.5 91)" style="fill: #333"/>
+ <path id="Contour_2" data-name="Contour 2" d="M2799,1060c18.5,26.5,37,27,37,27,455.44,18.42,790,0,790,0s24,0,41-29l86-154s16.5-20.5,20-55c30-295.67,1-557,1-557s1-17-13-47L3672,87c-14-23-37-22-37-22-389.5-13.5-809,0-809,0-29,1-37,24-37,24l-87,153a119.3,119.3,0,0,0-17,48c-24.58,335.84,3,569,3,569,4.5,16.5,17.86,37.6,17.86,37.6Z" transform="translate(-2593.5 91)" style="fill: #3d3d3d"/>
+ <g id="Contour_centre" data-name="Contour centre">
+ <path d="M3712.11,308.15C3711,283,3693,258,3693,258l-43-69c-20-34-60-35-60-35-360-13-725,1-725,1-33.26,1.17-49,25-49,25l-53,84c-15,25-17,46-17,46-22,287-1,518-1,518,3,30,21,56,21,56l42,72c23,37,60,40,60,40,392,15,716.5.5,716.5.5C3633,992,3653,953,3653,953l43-73s10-13.87,13.5-43.5C3739,587,3712.11,308.15,3712.11,308.15ZM3570,728.32A34.68,34.68,0,0,1,3535.32,763H2921.68A34.68,34.68,0,0,1,2887,728.32V463.68A34.68,34.68,0,0,1,2921.68,429h613.64A34.68,34.68,0,0,1,3570,463.68Z" transform="translate(-2593.5 91)" style="fill: #333"/>
+ </g>
+ <path id="Contour_bleu" data-name="Contour bleu" d="M2886.5,193.5c-30.78,1.07-51,26-51,26a719.08,719.08,0,0,0-43,69,107.83,107.83,0,0,0-12,45c-20.17,253.56,2,489,2,489,1.06,24.61,18,53,18,53,17,32,39,58,39,58,16,23,47,25,47,25,373.59,13.91,680,1,680,1,37,0,59-36,59-36,17-25.68,35-58,35-58a94.2,94.2,0,0,0,12-38c20.17-223.6,1-496,1-496-1-27-15-49-15-49-15.92-30-37-63-37-63-14-23-50-26-50-26C3207.46,179.59,2886.5,193.5,2886.5,193.5Z" transform="translate(-2593.5 91)" style="fill: none;stroke: #0e57a9;stroke-miterlimit: 10;stroke-width: 16px"/>
+ <path id="Contour_blanc" data-name="Contour blanc" d="M2894.5,217.5c-29,1-41,22-41,22-23,32-40,68-40,68a103.23,103.23,0,0,0-6,31c-19,237,2,476,2,476,1,23,13,43,13,43,15,30,37,58,37,58,10,14,34,16,34,16,352,13,667,1,667,1,29-1,41-21,41-21,16-24,31-49,31-49,14-24,15-43,15-43,19-209,1-478,1-478-1-27-10-43-10-43-15-28-37-60-37-60-10-16-30-19-30-19C3228.5,206.5,2894.5,217.5,2894.5,217.5Z" transform="translate(-2593.5 91)" style="fill: none;stroke: #fff;stroke-miterlimit: 10;stroke-width: 3px"/>
+ <g id="Contour_ecran" data-name="Contour ecran">
+ <path d="M3539,416A45.1,45.1,0,0,1,3584,461.05V733A45.1,45.1,0,0,1,3539,778h-620.9A45.1,45.1,0,0,1,2873,733V461.05A45.1,45.1,0,0,1,2918.05,416H3539m0-3h-620.9A48,48,0,0,0,2870,461.05V733a48,48,0,0,0,48.05,48H3539A48,48,0,0,0,3587,733V461.05A48,48,0,0,0,3539,413Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ </g>
+ <g id="Ecran">
+ <rect x="293.5" y="520" width="683" height="334" rx="34.68" style="fill: #777b7a"/>
+ </g>
+ <g id="light" style="opacity: 0">
+ <rect x="293.5" y="520" width="683" height="334" rx="34.68" style="fill: url(#Dégradé_sans_nom_3)"/>
+ </g>
+ </g>
+ <g id="Textes">
+ <g>
+ <path d="M3379.84,864.39h20.51q7.28,0,10.5,1.71c2.16,1.12,3.23,3.2,3.23,6.24v1a4.21,4.21,0,0,1-.12,1,6.3,6.3,0,0,1-.67,2.12,4.16,4.16,0,0,1-1.87,1.72,7.5,7.5,0,0,1-1.67.62c-.62.15-1.24.28-1.87.38l-.73.1c-.23,0-.47.07-.73.09v.12a10.14,10.14,0,0,1,5.45,1.46,4.14,4.14,0,0,1,1.71,3.53V890h-8.17v-4.65l.06-.57a2.67,2.67,0,0,0-1.8-2.61,12.68,12.68,0,0,0-4.59-.69h-11.39V890h-7.85Zm19.24,13c2.49,0,4.23-.26,5.22-.87a3.29,3.29,0,0,0,1.49-3.05,6,6,0,0,0-.85-3.55c-.57-.78-2.36-1.17-5.35-1.17h-11.9v8.64Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ <path d="M3426.36,875.15h19.81v3.57h-19.81V886h21v4h-28.87V864.39h28.68v4.08h-20.83Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ <path d="M3476.68,871.88a3,3,0,0,0-1.51-3,12.78,12.78,0,0,0-5.26-.77h-2.21c-.38,0-.8,0-1.24,0s-.88,0-1.3,0a19.65,19.65,0,0,0-2,.17,8.6,8.6,0,0,0-1.77.4,2.55,2.55,0,0,0-1.14.79,3.36,3.36,0,0,0-.57,1.07,3,3,0,0,1,0,.43,1.94,1.94,0,0,0,0,.4,2.76,2.76,0,0,0,1.24,2.63,10.64,10.64,0,0,0,4.52.83,6,6,0,0,1,.61,0l.6,0,1.61,0c.53,0,1,0,1.55,0a62.72,62.72,0,0,1,11,1.06q4.76.95,4.75,6.07a8.23,8.23,0,0,1-1.71,5.37c-1.14,1.4-3.78,2.22-7.91,2.48l-2,.06c-.65,0-1.29,0-1.93.06s-1.34,0-2,0h-2a58,58,0,0,1-11.87-1q-4.59-1-4.59-6.3v-.25a.54.54,0,0,1,.06-.25v-.5l7.66,0a5.67,5.67,0,0,0,.79,3.08c.53.85,2,1.29,4.34,1.31,1,0,2,0,3,0h3a16.05,16.05,0,0,0,5.45-.67q1.71-.68,1.71-3,0-2.54-2.19-3a28.79,28.79,0,0,0-5.6-.5h-1.26c-.43,0-.87,0-1.33,0l-.67,0q-.35,0-.66-.06a45.92,45.92,0,0,1-10.48-1.36q-3.77-1.1-3.77-6.17a5.83,5.83,0,0,1,2.28-4.95q2.28-1.72,7.79-2c1.1-.05,2.2-.09,3.32-.11s2.23,0,3.33,0a66.79,66.79,0,0,1,11.33.84c3.2.57,4.81,2.49,4.81,5.76v1Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ <path d="M3498,890h-8.1V864.39h8.1Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ <path d="M3527.89,871.88a3,3,0,0,0-1.52-3,12.69,12.69,0,0,0-5.25-.77h-2.21c-.38,0-.8,0-1.24,0s-.88,0-1.3,0a19.65,19.65,0,0,0-2,.17,8.6,8.6,0,0,0-1.77.4,2.55,2.55,0,0,0-1.14.79,3.36,3.36,0,0,0-.57,1.07,3,3,0,0,1,0,.43,2.91,2.91,0,0,0,0,.4,2.76,2.76,0,0,0,1.24,2.63,10.64,10.64,0,0,0,4.52.83,5.82,5.82,0,0,1,.6,0l.61,0,1.61,0c.53,0,1,0,1.55,0a62.72,62.72,0,0,1,11,1.06q4.76.95,4.75,6.07a8.23,8.23,0,0,1-1.71,5.37c-1.14,1.4-3.78,2.22-7.91,2.48l-2,.06c-.65,0-1.29,0-1.93.06s-1.34,0-2,0h-2a58,58,0,0,1-11.86-1q-4.59-1-4.59-6.3v-.25a.54.54,0,0,1,.06-.25v-.5l7.66,0a5.67,5.67,0,0,0,.79,3.08c.53.85,2,1.29,4.34,1.31,1,0,2,0,3,0h3a16.05,16.05,0,0,0,5.45-.67q1.71-.68,1.71-3,0-2.54-2.19-3a28.79,28.79,0,0,0-5.6-.5h-1.27c-.42,0-.86,0-1.33,0l-.66,0q-.35,0-.66-.06a45.92,45.92,0,0,1-10.48-1.36q-3.77-1.1-3.77-6.17a5.83,5.83,0,0,1,2.28-4.95q2.28-1.72,7.79-2c1.09-.05,2.2-.09,3.32-.11s2.23,0,3.32,0a66.63,66.63,0,0,1,11.33.84q4.82.86,4.82,5.76v1Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ <path d="M3557.9,890h-8.17V868.73h-12.22v-4.34h32.79v4.34h-12.4Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ </g>
+ <g id="WR">
+ <path id="R" d="M3300,854h-43a3.55,3.55,0,0,0-3,2l-20,37s-1,2,2,2h8a4.94,4.94,0,0,0,3-1l6-9a4.33,4.33,0,0,1,4-2h22a6.19,6.19,0,0,1,4,2l6,8a4.33,4.33,0,0,0,4,2h8s3,0,2-2l-5-6s-6-5,1-7l7.38-3.69a8.49,8.49,0,0,0,4.07-4.36C3312.86,866.12,3316,854,3300,854Zm-5,18a6.19,6.19,0,0,1-4,2h-27c-6,0-4-3-4-3l1-2,2-4a6.46,6.46,0,0,1,5-3h23C3299,862,3298.2,868.8,3295,872Z" transform="translate(-2593.5 91)" style="fill: #771217"/>
+ <path id="W" d="M3156,854s2,0,3,3l9,26c2,3,4,0,4,0l13-27h0a3.55,3.55,0,0,1,3-2h8a3.7,3.7,0,0,1,3,2l9,25h0c2,4,4,0,4,0l14-25h0c1-2,2-2,2-2h9c3,0,1,3,1,3l-20,36h0a6.19,6.19,0,0,1-4,2h-8c-3,0-4-3-4-3l-8-24c-3-6-5,0-5,0l-12,25a3.55,3.55,0,0,1-3,2h-10c-2,0-3-3-3-3l-15-35c-1-3,1-3,1-3h9" transform="translate(-2593.5 91)" style="fill: #771217"/>
+ </g>
+ <g id="WATER">
+ <g>
+ <path d="M2994.68,890h-8.17V868.73h-12.22v-4.34h32.79v4.34h-12.4Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ <path d="M3016.83,875.15h19.81v3.57h-19.81V886h21v4H3009V864.39h28.68v4.08h-20.83Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ <path d="M3043.54,864.39h20.51q7.27,0,10.51,1.71t3.23,6.24v1a4.22,4.22,0,0,1-.13,1,6.51,6.51,0,0,1-.66,2.12,4.21,4.21,0,0,1-1.87,1.72,7.78,7.78,0,0,1-1.68.62c-.61.15-1.23.28-1.87.38l-.72.1c-.24,0-.48.07-.73.09v.12a10.1,10.1,0,0,1,5.44,1.46,4.14,4.14,0,0,1,1.71,3.53V890h-8.17v-4.65l.07-.57a2.7,2.7,0,0,0-1.81-2.61,12.68,12.68,0,0,0-4.59-.69h-11.39V890h-7.85Zm19.24,13c2.49,0,4.23-.26,5.23-.87a3.28,3.28,0,0,0,1.48-3.05,6,6,0,0,0-.85-3.55q-.85-1.17-5.35-1.17h-11.9v8.64Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ </g>
+ <path d="M2951,885.1,2948.4,890H2940L2954,864.39h11.9L2980.24,890H2972l-2.73-4.91Zm9.12-16.94-7.22,13.29h14.56Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ <path d="M2934,890h-9.79l-7-19.55h-.16L2909.8,890h-9.63L2891,864.39h6.74l7.31,21.59h.21l8.05-21.59h7.74l8,21.59,7.63-21.59h6.79Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ </g>
+ <g id="ALARM_ON" data-name="ALARM ON">
+ <g>
+ <path d="M3465.8,817.11v1.58h-19v-3.12c0-1.75.54-2.89,1.63-3.43s3.65-1,7.7-1.25c3.25-.23,5.21-.53,5.88-.92s1-1.4,1-3c0-1.43-.38-2.35-1.13-2.77s-2.4-.64-4.94-.64q-4.74,0-6,.51c-.83.35-1.25,1.17-1.25,2.49l0,1.23h-2.92l0-.86c0-2,.67-3.3,2-4s4-1,8-1q5.32,0,7.16,1.07c1.23.71,1.84,2.1,1.84,4.16s-.57,3.31-1.71,4-3.62,1.12-7.43,1.35c-3.35.21-5.34.51-6,.88s-1,1.42-1,3.16v.56Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ <path d="M3486.12,802.13v11.16h3.94v1.58h-3.94v3.82h-3v-3.82h-14.76v-2.2l13.14-10.54Zm-3,11.16v-10h-.06l-12.25,10Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ <path d="M3513.9,802.13v16.56h-3V811h-15.42v7.68h-3V802.13h3v7.3h15.42v-7.3Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ <path d="M3517.32,818.69V802.13h12.56q4.24,0,6,1.06a3.92,3.92,0,0,1,1.73,3.66,4.35,4.35,0,0,1-.94,3.2,6.32,6.32,0,0,1-3.61,1.17v0q4.18.19,4.19,3.21v4.23h-3v-3.81q0-2.89-4-2.9h-10v6.71Zm3-8.29h8.59a11.06,11.06,0,0,0,4.64-.65,2.5,2.5,0,0,0,1.24-2.44c0-1.49-.31-2.47-.92-2.92s-1.92-.68-3.93-.68h-9.62Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ </g>
+ <path id="_" data-name="/" d="M3421.46,808h19.33a1.24,1.24,0,0,1,1.24,1.24v.72a1.19,1.19,0,0,1-1.19,1.19H3422a1.83,1.83,0,0,1-1.83-1.83v0a1.32,1.32,0,0,1,1.32-1.32Z" transform="translate(-1763.06 3280.53) rotate(-55.74)" style="fill: #fff"/>
+ <g>
+ <path d="M3366.82,801q7.47,0,9.35,1.37c1.25.92,1.87,3.2,1.87,6.86q0,5.89-1.79,7.28t-9.43,1.39q-7.59,0-9.42-1.37t-1.82-7.09v-1.16l0-1.57c0-2.19.78-3.7,2.36-4.5S3362.5,801,3366.82,801Zm0,1.58q-6.26,0-7.32.87t-1.06,6c0,3.42.35,5.43,1.06,6s3.15.87,7.32.87,6.63-.29,7.34-.87,1.06-2.59,1.06-6v-1.08l0-1.56q0-2.75-1.47-3.48C3372.74,802.79,3370.43,802.54,3366.8,802.54Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ <path d="M3384.42,802.71v5.78h12.84v1.58h-12.84v7.62h-3V801.13h16.17v1.58Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ <path d="M3403.75,802.71v5.78h12.85v1.58h-12.85v7.62h-3V801.13h16.16v1.58Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ </g>
+ <rect id="_." data-name="." x="3341.2" y="806.08" width="6.87" height="6.72" rx="3.36" transform="matrix(0, -1, 1, 0, -58.3, 4245.08)" style="fill: #fff"/>
+ <g>
+ <path d="M3294.82,801q7.47,0,9.35,1.37c1.25.92,1.87,3.2,1.87,6.86q0,5.89-1.79,7.28t-9.43,1.39q-7.59,0-9.42-1.37t-1.82-7.09v-1.16l0-1.57c0-2.19.78-3.7,2.36-4.5S3290.5,801,3294.82,801Zm0,1.58q-6.26,0-7.32.87t-1.06,6c0,3.42.35,5.43,1.06,6s3.15.87,7.32.87,6.63-.29,7.34-.87,1.06-2.59,1.06-6v-1.08l0-1.56q0-2.75-1.47-3.48C3300.74,802.79,3298.43,802.54,3294.8,802.54Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ <path d="M3332,801.13v16.56h-4.88l-11-11.27-1.8-1.86-.89-.92-.88-.92h-.08l0,.62,0,.63v13.72h-3V801.13h4.87L3324,811l2.51,2.6,1.25,1.29,1.24,1.29h.08l0-.61,0-.64v-13.8Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ </g>
+ <g>
+ <path d="M3153.39,814.18H3140l-2,3.51h-3.15l9.66-16.56h4.17l9.85,16.56h-3.11Zm-.87-1.4-5.86-10.12-5.77,10.12Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ <path d="M3164.22,801.13V816h13.56v1.74h-16.53V801.13Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ <path d="M3196.64,814.18h-13.35l-2,3.51h-3.15l9.66-16.56h4.17l9.85,16.56h-3.11Zm-.87-1.4-5.86-10.12-5.77,10.12Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ <path d="M3204.5,817.69V801.13h12.55c2.84,0,4.83.35,6,1.06a3.92,3.92,0,0,1,1.74,3.66,4.35,4.35,0,0,1-1,3.2,6.29,6.29,0,0,1-3.61,1.17v0c2.8.13,4.19,1.2,4.19,3.21v4.23h-3v-3.81q0-2.89-4-2.9h-10v6.71Zm3-8.29h8.6a11,11,0,0,0,4.63-.65,2.48,2.48,0,0,0,1.24-2.44c0-1.49-.31-2.47-.92-2.92s-1.92-.68-3.93-.68h-9.62Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ <path d="M3258.08,801.13v16.56h-3V803.45l0-.5,0-.5h-.08l-.23.39-.24.38-.5.77-9,13.7h-3l-9-13.54-.52-.76-.23-.39a4.09,4.09,0,0,1-.23-.38h-.08l0,.45,0,.46v14.16h-3V801.13h5.15l7,10.71,1.13,1.74.55.86.55.86h.07l.54-.86c.27-.41.46-.7.54-.86l1.14-1.73,7-10.72Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ </g>
+ </g>
+ <g>
+ <path d="M2948.12,801.13v16.56h-3V803.45l0-.5,0-.5h-.08l-.23.39-.23.38-.5.77-9,13.7h-3l-9-13.54-.52-.76-.24-.39a4.09,4.09,0,0,1-.23-.38h-.07l0,.45,0,.46v14.16h-3V801.13h5.16l7,10.71,1.12,1.74.56.86.54.86h.08l.54-.86c.27-.41.45-.7.54-.86l1.14-1.73,7-10.72Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ <path d="M2962.76,801q7.47,0,9.35,1.37c1.25.92,1.87,3.2,1.87,6.86q0,5.89-1.8,7.28c-1.19.93-4.34,1.39-9.42,1.39s-8.2-.46-9.42-1.37-1.82-3.28-1.82-7.09v-1.16l0-1.57c0-2.19.79-3.7,2.37-4.5S2958.44,801,2962.76,801Zm0,1.58q-6.25,0-7.32.87t-1.07,6c0,3.42.36,5.43,1.07,6s3.15.87,7.32.87,6.63-.29,7.34-.87,1.06-2.59,1.06-6v-1.08l0-1.56q0-2.75-1.47-3.48T2962.74,802.54Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ <path d="M2977.38,817.69V801.13h12.21q5.65,0,7.67,1.57t2,6q0,5.38-1.79,7.19t-7.14,1.81Zm3-1.58H2989q4.74,0,6.1-1.19t1.38-5.3q0-4.51-1.19-5.71t-5.69-1.2h-9.19Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ <path d="M3005.14,802.71v5.64h13.38v1.58h-13.38v6.18h14v1.58h-16.94V801.13h16.94v1.58Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ </g>
+ <g>
+ <path d="M2920.16,374.13V389h13.55v1.74h-16.53V374.13Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ <path d="M2939.34,374.13v16.56h-3V374.13Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ <path d="M2953.82,382.45h11.3a16.4,16.4,0,0,1,.08,1.81q0,4.47-1.75,5.54c-1.16.7-4.2,1.06-9.12,1.06q-7,0-9-1.26c-1.32-.83-2-2.71-2-5.63l0-2.44,0-1.47q0-3.68,2.21-4.88t8.92-1.22q6.72,0,8.67.8t1.95,3.54v.64h-2.91v-.42c0-1.35-.44-2.18-1.33-2.5s-3.18-.48-6.9-.48q-5.16,0-6.45.77c-.87.51-1.3,1.8-1.3,3.85l0,2.2,0,2.36c0,2.09.48,3.37,1.44,3.85s3.52.71,7.68.71q4.77,0,5.9-.68c.75-.45,1.13-1.64,1.13-3.55a7.07,7.07,0,0,0-.15-1h-8.39Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ <path d="M2990.27,374.13v16.56h-3V383h-15.42v7.68h-3V374.13h3v7.3h15.42v-7.3Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ <path d="M3004.47,375.87v14.82h-3V375.87h-8.6v-1.74H3013v1.74Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ </g>
+ <g>
+ <path d="M3293.74,382.93H3299a5.92,5.92,0,0,0,0,.61c0,.19,0,.36,0,.53a5.24,5.24,0,0,0,0,.56c0,.19,0,.38,0,.57,0,3.19-1,5.24-2.84,6.18a16.29,16.29,0,0,1-7.2,1.39h-3.74c-3.95,0-6.55-.93-7.81-2.81s-1.89-4.56-1.89-8c0-.32,0-.65,0-1s0-.67,0-1,0-.33,0-.49a3.93,3.93,0,0,1,0-.49c0-.48,0-1,0-1.48s0-1,0-1.47c0-4.54,1.06-7.43,3.16-8.67s5.26-1.86,9.49-1.86l1.8,0c.2,0,.39,0,.57,0h.57a16,16,0,0,1,3.63.56,5,5,0,0,1,2.84,2.11,5.62,5.62,0,0,1,1,2.29,15.86,15.86,0,0,1,.28,2.45,3,3,0,0,0,0,.42c0,.15,0,.29,0,.43a3.85,3.85,0,0,0,0,.48c0,.17,0,.33,0,.49l-5.33,0a1.86,1.86,0,0,1-.11-.57c0-.21,0-.43-.06-.64v-.29a6.07,6.07,0,0,0-.44-2.08c-.27-.64-1.13-1-2.59-1.08a9.39,9.39,0,0,0-1.19-.08H3287a6.91,6.91,0,0,1-.8,0c-.28,0-.56,0-.84,0a12.86,12.86,0,0,0-1.79.3,2.94,2.94,0,0,0-1.36.71,3.18,3.18,0,0,0-.74,1.18,5.22,5.22,0,0,0-.27,1.35,5,5,0,0,0-.06.56,5.25,5.25,0,0,0,0,.56l-.06,1.28c0,.41,0,.84,0,1.27,0,.87,0,1.74,0,2.61l.06,2.62c0,2.7.51,4.36,1.43,5s2.72.95,5.38.95a15,15,0,0,0,4.09-.49c1.17-.32,1.75-1.4,1.75-3.24v-.85a1.87,1.87,0,0,1,0-.42v-.47Z" transform="translate(-2593.5 91)" style="fill: #b6a66e"/>
+ <path d="M3327.84,392.61h-5.38V381.07H3309.4v11.54h-5.33v-27h5.33v11h13.06v-11h5.38Z" transform="translate(-2593.5 91)" style="fill: #b6a66e"/>
+ <path d="M3334.47,365.6h13.61c3.22,0,5.55.63,7,1.8s2.15,3.37,2.15,6.58v1a6.23,6.23,0,0,1-.09,1.06,8.92,8.92,0,0,1-.44,2.22,3.92,3.92,0,0,1-1.24,1.83,4.56,4.56,0,0,1-1.11.65,11.18,11.18,0,0,1-1.24.4l-.48.1a3.86,3.86,0,0,1-.49.1v.12a5.1,5.1,0,0,1,3.62,1.54,5.63,5.63,0,0,1,1.13,3.73v5.87h-5.42v-4.9l0-.61a3.06,3.06,0,0,0-1.19-2.75,5.62,5.62,0,0,0-3.05-.73h-7.56v9h-5.21Zm12.77,13.65a4.92,4.92,0,0,0,3.47-.91,4.4,4.4,0,0,0,1-3.22,9.58,9.58,0,0,0-.56-3.75c-.38-.82-1.56-1.24-3.55-1.24h-7.9v9.12Z" transform="translate(-2593.5 91)" style="fill: #b6a66e"/>
+ <path d="M3362.32,379.45q0-6.72,1.57-10.37t9.64-3.64a27.5,27.5,0,0,1,8.64,1.24q3.75,1.24,4,7c.05.59.09,1.18.1,1.78s0,1.2,0,1.82v1.77c0,5-.56,8.56-1.7,10.65s-4.71,3.13-10.73,3.13c-4.23,0-7.22-.68-9-2.06s-2.64-4.23-2.64-8.55v-.73a5.79,5.79,0,0,1,0-.72v-1.34Zm5.46-.12v2.43c0,.4,0,.8,0,1.19s0,.79.06,1.2c.17,2,.74,3.25,1.7,3.68a10.76,10.76,0,0,0,4.27.65,11.26,11.26,0,0,0,5.29-.91c1.06-.61,1.64-2.17,1.72-4.68.06-1.1.09-2.21.09-3.3v-3.26q0-3.76-.95-5.14t-4.93-1.38c-3.62,0-5.72.49-6.33,1.48s-.9,2.88-.9,5.69v.36c0,.3,0,.62,0,1v1Z" transform="translate(-2593.5 91)" style="fill: #b6a66e"/>
+ <path d="M3417.51,392.61h-8.91L3396.76,370h-.17l.17,22.6h-5.21v-27h8.86l11.85,22.6h.16l-.16-22.6h5.25Z" transform="translate(-2593.5 91)" style="fill: #b6a66e"/>
+ <path d="M3423.34,379.45q0-6.72,1.58-10.37t9.64-3.64a27.44,27.44,0,0,1,8.63,1.24q3.76,1.24,4,7c.06.59.09,1.18.11,1.78s0,1.2,0,1.82v1.77c0,5-.57,8.56-1.7,10.65s-4.71,3.13-10.73,3.13c-4.23,0-7.23-.68-9-2.06s-2.65-4.23-2.65-8.55v-.73c0-.24,0-.48,0-.72v-1.34Zm5.46-.12v2.43c0,.4,0,.8,0,1.19s0,.79.06,1.2c.17,2,.73,3.25,1.7,3.68a10.73,10.73,0,0,0,4.26.65,11.3,11.3,0,0,0,5.3-.91q1.59-.92,1.72-4.68c.05-1.1.08-2.21.08-3.3v-3.26q0-3.76-.94-5.14t-4.94-1.38q-5.42,0-6.32,1.48t-.9,5.69v.36c0,.3,0,.62,0,1v1Z" transform="translate(-2593.5 91)" style="fill: #b6a66e"/>
+ <path d="M3476.1,378.27V379l.08,4.3a16.39,16.39,0,0,1-1.07,6.21c-.72,1.74-2.53,2.78-5.44,3.1-.92.08-1.85.14-2.77.16s-1.85,0-2.77,0q-6.35,0-9.39-1.92t-3-8.65v-.95a9.08,9.08,0,0,1,0-.91v-4.27c0-.39,0-.79,0-1.2a17.71,17.71,0,0,1,.4-3.3,7.74,7.74,0,0,1,1.36-3,6.22,6.22,0,0,1,3.21-2.37,16.27,16.27,0,0,1,4.06-.75c.42,0,.83,0,1.24,0h1.19l2.48,0q5.3,0,7.79,1.43c1.67.94,2.53,3.25,2.59,6.95l-5.38,0a4.7,4.7,0,0,0-.74-2.8,3.35,3.35,0,0,0-2.7-1.09c-.51,0-1-.05-1.52-.06l-1.51,0q-5.16,0-6.09,1.44t-1,6.25v1.34l0,3.48q0,4.22,1.4,5.21t5.53,1c2.57,0,4.34-.29,5.29-.87s1.43-2.14,1.43-4.68v-.4a.41.41,0,0,1,0-.18v-.19h-7.05v-3.89Z" transform="translate(-2593.5 91)" style="fill: #b6a66e"/>
+ <path d="M3481.43,365.6H3495q4.83,0,7,1.8t2.14,6.58v1a7.45,7.45,0,0,1-.08,1.06,9.92,9.92,0,0,1-.44,2.22,3.92,3.92,0,0,1-1.24,1.83,4.75,4.75,0,0,1-1.11.65,11.18,11.18,0,0,1-1.24.4l-.49.1a3.39,3.39,0,0,1-.48.1v.12a5.07,5.07,0,0,1,3.61,1.54,5.58,5.58,0,0,1,1.14,3.73v5.87h-5.42v-4.9l0-.61a3.09,3.09,0,0,0-1.2-2.75,5.59,5.59,0,0,0-3-.73h-7.56v9h-5.21Zm12.77,13.65a4.89,4.89,0,0,0,3.46-.91,4.35,4.35,0,0,0,1-3.22,9.36,9.36,0,0,0-.57-3.75c-.37-.82-1.56-1.24-3.55-1.24h-7.89v9.12Z" transform="translate(-2593.5 91)" style="fill: #b6a66e"/>
+ <path d="M3514.82,387.43l-1.72,5.18h-5.59l9.33-27h7.89l9.49,27h-5.46l-1.8-5.18Zm6-17.86-4.79,14h9.66Z" transform="translate(-2593.5 91)" style="fill: #b6a66e"/>
+ <path d="M3538.3,365.6h11.21c3.75,0,6.53.56,8.32,1.6s2.69,3.58,2.69,7.63c0,.35,0,.72,0,1.1s0,.75-.06,1.13a10.62,10.62,0,0,1-.52,2.75,5.16,5.16,0,0,1-1.58,2.31,5.76,5.76,0,0,1-2.83,1.44,17.41,17.41,0,0,1-3.26.3,2.12,2.12,0,0,1-.44,0h-8.3v8.71h-5.2Zm11.3,13.81a9.77,9.77,0,0,0,4.22-.59c.82-.42,1.24-1.71,1.24-3.87,0-2-.28-3.32-.84-4s-1.92-1-4.08-1h-6.64v9.4Z" transform="translate(-2593.5 91)" style="fill: #b6a66e"/>
+ <path d="M3589.41,392.61H3584V381.07H3571v11.54h-5.33v-27H3571v11H3584v-11h5.38Z" transform="translate(-2593.5 91)" style="fill: #b6a66e"/>
+ </g>
+ <g>
+ <path d="M3118.05,387.43l-1.72,5.18h-5.59l9.33-27H3128l9.5,27H3132l-1.81-5.18Zm6-17.86-4.79,14H3129Z" transform="translate(-2593.5 91)" style="fill: #b6a66e"/>
+ <path d="M3147.41,388.08h13v4.53H3142v-27h5.46Z" transform="translate(-2593.5 91)" style="fill: #b6a66e"/>
+ <path d="M3169.92,387.43l-1.72,5.18h-5.59l9.33-27h7.89l9.49,27h-5.46l-1.8-5.18Zm6-17.86-4.79,14h9.66Z" transform="translate(-2593.5 91)" style="fill: #b6a66e"/>
+ <path d="M3193.78,365.6h13.6q4.83,0,7,1.8c1.42,1.18,2.14,3.37,2.14,6.58v1a6.23,6.23,0,0,1-.09,1.06,8.92,8.92,0,0,1-.44,2.22,3.92,3.92,0,0,1-1.24,1.83,4.38,4.38,0,0,1-1.11.65,11.18,11.18,0,0,1-1.24.4l-.48.1a4.1,4.1,0,0,1-.48.1v.12A5.09,5.09,0,0,1,3215,383a5.63,5.63,0,0,1,1.13,3.73v5.87h-5.42v-4.9l.05-.61a3.09,3.09,0,0,0-1.2-2.75,5.62,5.62,0,0,0-3.05-.73H3199v9h-5.2Zm12.76,13.65a4.9,4.9,0,0,0,3.47-.91,4.35,4.35,0,0,0,1-3.22,9.36,9.36,0,0,0-.57-3.75c-.38-.82-1.56-1.24-3.55-1.24H3199v9.12Z" transform="translate(-2593.5 91)" style="fill: #b6a66e"/>
+ <path d="M3252.42,392.61h-4.78l.15-22.76-8,22.76h-4.4L3227.21,370l.23,22.64h-4.78v-27h7.88l6.88,20h.16l6.81-20h8Z" transform="translate(-2593.5 91)" style="fill: #b6a66e"/>
+ </g>
+ <g id="F-91W">
+ <path id="W-2" data-name="W" d="M3464,256h10c3,0,3,2,3,2v10c0,2,2,0,2,0l6-10a3.55,3.55,0,0,1,3-2h7c3,0,3,2,3,2l1,11c1,2,2,0,2,0l7-12a3.1,3.1,0,0,1,2-1h10c3,0,2,2,2,2l-17,29c-2,2-3,2-3,2h-11a2,2,0,0,1-2-2V276c0-3-2,0-2,0l-7,11a3.55,3.55,0,0,1-3,2h-10a2.94,2.94,0,0,1-3-3l-2-28A2,2,0,0,1,3464,256Z" transform="translate(-2593.5 91)" style="fill: #b6a66e"/>
+ <path id="_1" data-name="1" d="M3453,257l-5,30h0a3.55,3.55,0,0,1-3,2h-9a2,2,0,0,1-2-2l2-15c0-1-2-1-2-1h-3a1,1,0,0,1-1-1l1-8c8-1,10-6,10-6h10c2,0,2,1,2,1" transform="translate(-2593.5 91)" style="fill: #b6a66e"/>
+ <path id="_9" data-name="9" d="M3403,256s-11-1-18,5c0,0-9,9,7,17h-10s-3,6,9,10c0,0,9.57,2.73,19.1-.84a16.52,16.52,0,0,0,8.92-8C3422.69,271.92,3425.86,258.86,3403,256Zm-3,27c-6,0-5-5-5-5h10C3405,283,3400,283,3400,283Zm2-12c-5,0-5-4-5-4,0-4,5-4,5-4,5,0,5,4,5,4C3407,271,3402,271,3402,271Z" transform="translate(-2593.5 91)" style="fill: #b6a66e"/>
+ <path id="_-" data-name="-" d="M3354,269h16a2,2,0,0,1,2,2l-1,5h0c0,1-3,1-3,1h-15a2,2,0,0,1-2-2l1-5C3352,269,3354,269,3354,269Z" transform="translate(-2593.5 91)" style="fill: #b6a66e"/>
+ <path id="F" d="M3313,256h30a2,2,0,0,1,2,2l-1,4c-1,2-2,2-2,2h-17a2,2,0,0,0-2,2h0a2,2,0,0,0,2,2h12c3,0,2,2,2,2l-1,5a3.1,3.1,0,0,1-2,1h-13a2,2,0,0,0-2,2l-2,9c-1,2-2,2-2,2h-10c-3,0-2-3-2-3l5-28c0-2,3-2,3-2" transform="translate(-2593.5 91)" style="fill: #b6a66e"/>
+ </g>
+ <g>
+ <path d="M2980,275.39h10.59a8.2,8.2,0,0,0,0,.89,7.28,7.28,0,0,1,0,.78,7.7,7.7,0,0,0,.05.83c0,.28,0,.56,0,.83q0,7-5.72,9.08a43.49,43.49,0,0,1-14.52,2.06H2963q-11.94,0-15.75-4.14t-3.81-11.82c0-.47,0-1,0-1.46s0-1,0-1.45a5.79,5.79,0,0,0,0-.72,5.74,5.74,0,0,1,0-.71c0-.72,0-1.44,0-2.18s0-1.45,0-2.17q0-10,6.35-12.74t19.14-2.74l3.65-.06a11.17,11.17,0,0,0,1.14.06h1.14a43.37,43.37,0,0,1,7.33.84,10.33,10.33,0,0,1,5.71,3.09,7.38,7.38,0,0,1,2,3.37,17.45,17.45,0,0,1,.55,3.6,4.56,4.56,0,0,0,0,.62c0,.22,0,.43,0,.63a5.63,5.63,0,0,0,0,.71,5.79,5.79,0,0,1,0,.72l-10.75-.06a2.36,2.36,0,0,1-.21-.84c0-.31-.07-.63-.13-1V261a6.72,6.72,0,0,0-.89-3.06c-.54-.93-2.27-1.46-5.21-1.58a23.86,23.86,0,0,0-2.41-.12h-4.28c-.51,0-1,.06-1.61.06s-1.13,0-1.69.06a31.62,31.62,0,0,0-3.6.44,7.09,7.09,0,0,0-2.75,1,4.84,4.84,0,0,0-1.48,1.75,5.52,5.52,0,0,0-.56,2c-.05.28-.09.56-.12.83a7.69,7.69,0,0,0,0,.83c-.06.63-.1,1.26-.13,1.87s0,1.24,0,1.88c0,1.27,0,2.55,0,3.84s.07,2.57.13,3.84q.07,6,2.87,7.35t10.84,1.4a41.54,41.54,0,0,0,8.26-.72c2.34-.47,3.52-2.06,3.52-4.76V276.7a2.16,2.16,0,0,1-.09-.62v-.69Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ <path d="M3006.88,282l-3.47,7.62h-11.27l18.8-39.71h15.92L3046,289.62h-11l-3.64-7.62Zm12.19-26.25-9.65,20.59h19.48Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ <path d="M3082.25,261.52q0-3.45-2-4.64c-1.36-.8-3.7-1.19-7-1.19h-3c-.51,0-1.06.05-1.65.05s-1.17,0-1.74.06a24.68,24.68,0,0,0-2.7.27,10.42,10.42,0,0,0-2.38.62,3.57,3.57,0,0,0-1.52,1.23,5.89,5.89,0,0,0-.76,1.65,4.94,4.94,0,0,1,0,.68c0,.21,0,.42,0,.62,0,2,.55,3.34,1.65,4.07s3.12,1.16,6.06,1.28c.28,0,.55,0,.8,0s.53,0,.81,0l2.16.09,2.07,0a73,73,0,0,1,14.65,1.64q6.36,1.47,6.36,9.4a14.18,14.18,0,0,1-2.29,8.33q-2.28,3.25-10.59,3.85l-2.66.09c-.88,0-1.74.05-2.59.09s-1.79.06-2.67.06h-2.66a67.51,67.51,0,0,1-15.88-1.53q-6.15-1.51-6.14-9.76v-.39a1,1,0,0,1,.08-.39V277l10.25-.06a9.9,9.9,0,0,0,1.06,4.78c.7,1.32,2.64,2,5.8,2,1.35,0,2.71.06,4.06.06h4.07c3.33,0,5.76-.34,7.28-1s2.29-2.26,2.29-4.69q0-3.94-2.92-4.66a34.1,34.1,0,0,0-7.5-.78h-1.69c-.57,0-1.16,0-1.78-.06l-.89,0c-.31,0-.61-.05-.89-.09a53.19,53.19,0,0,1-14-2.11q-5-1.69-5-9.55c0-3.34,1-5.9,3-7.68s5.5-2.82,10.41-3.1c1.47-.08,2.95-.14,4.45-.18s3-.06,4.45-.06a77.06,77.06,0,0,1,15.15,1.31q6.43,1.32,6.44,8.93v1.49Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ <path d="M3112.14,289.62H3101.3V249.91h10.84Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ <path d="M3120.44,270.27q0-9.88,3.18-15.24t19.43-5.36a74.62,74.62,0,0,1,17.41,1.83q7.58,1.81,8.17,10.32.16,1.31.21,2.61c0,.87,0,1.76,0,2.67v2.62q0,11.05-3.43,15.65T3143.82,290q-12.8,0-18.13-3t-5.33-12.56v-1.07a7.59,7.59,0,0,1,.08-1.07v-2Zm11-.18v3.57c0,.6,0,1.19,0,1.76s.07,1.16.13,1.76c.34,3,1.48,4.78,3.43,5.41a29.18,29.18,0,0,0,8.6,1q7.44,0,10.67-1.34t3.47-6.88c.11-1.63.17-3.24.17-4.85v-4.79q0-5.54-1.91-7.56c-1.27-1.35-4.58-2-10-2q-10.92,0-12.74,2.18c-1.22,1.44-1.82,4.23-1.82,8.36v.54a10.15,10.15,0,0,0-.09,1.39v1.52Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ </g>
+ </g>
+ <g id="Détails">
+ <path d="M3515,909.56v6.83a4,4,0,0,1-.68,2.53c-.45.58-1.38.89-2.8.93h-1.29a11.16,11.16,0,0,1-3.67-.48c-.88-.31-1.32-1.28-1.32-2.89v-7h2.26v6.93c0,.74.18,1.22.54,1.43a3.63,3.63,0,0,0,1.7.3h.78a4.15,4.15,0,0,0,1.68-.24c.39-.17.58-.6.58-1.3v-7.11Z" transform="translate(-2593.5 91)" style="fill: #fff"/>
+ <g id="Flèches">
+ <path id="Flèche_B_D" data-name="Flèche B D" d="M3594,810l-34,5a2,2,0,0,1-2-2v-9a2,2,0,0,1,2-2l34,6c5,1,0,2,0,2" transform="translate(-2593.5 91)" style="fill: #771217"/>
+ <path id="Flèche_B_G" data-name="Flèche B G" d="M2865,810l34,5a2,2,0,0,0,2-2v-9a2,2,0,0,0-2-2l-34,6c-5,1,0,2,0,2" transform="translate(-2593.5 91)" style="fill: #771217"/>
+ <path id="Flèche_H_G" data-name="Flèche H G" d="M2863,383l34,5a2,2,0,0,0,2-2v-9a2,2,0,0,0-2-2l-34,6c-5,1,0,2,0,2" transform="translate(-2593.5 91)" style="fill: #771217"/>
+ </g>
+ <g id="Bares_bleu" data-name="Bares bleu">
+ <path id="Bar_down_M" data-name="Bar down M" d="M3118,837h215c15,0,16,16,16,16v31c0,6-7,12-7,12l-13,13c-6,7-18,7-18,7H3143c-13,0-18-7-18-7l-13.72-13.61C3105,889,3105,885,3105,885V853C3105,837,3118,837,3118,837Z" transform="translate(-2593.5 91)" style="fill: none;stroke: #0e57a9;stroke-miterlimit: 10;stroke-width: 8px"/>
+ <path id="Bar_down_R" data-name="Bar down R" d="M3619,838c3.21,0,2,3,2,3l-8,10a5,5,0,0,1-3,1H3364a2,2,0,0,1-2-2V840a2,2,0,0,1,2-2Z" transform="translate(-2593.5 91)" style="fill: #0e57a9"/>
+ <path id="Bar_down_L" data-name="Bar down L" d="M2835,838c-3.21,0-2,3-2,3l8,10a5,5,0,0,0,3,1H3090a2,2,0,0,0,2-2V840a2,2,0,0,0-2-2Z" transform="translate(-2593.5 91)" style="fill: #0e57a9"/>
+ <path id="Bar_up" data-name="Bar up" d="M3621,336l-4-8a3.55,3.55,0,0,0-3-2H2840a4.33,4.33,0,0,0-4,2l-3,8c-1,3,2.5,3,2.5,3H3619C3623,339,3621,336,3621,336Z" transform="translate(-2593.5 91)" style="fill: #0e57a9"/>
+ </g>
+ </g>
+ <g id="displays">
+ <g id="dots">
+ <rect data-com="1" data-seg="16" id="dot_down" x="535.5" y="705" width="19" height="19" rx="9.5" style="fill: #304246"/>
+ <rect data-com="1" data-seg="16" id="dot_up" x="531.5" y="776" width="19" height="19" rx="9.5" style="fill: #304246"/>
+ </g>
+ <g id="hours">
+ <g id="hour_2">
+ <path data-com="1" data-seg="18" id="hour_2_A" d="M2979,580h-49c-4,0-5,1-5,1l-2,1a2.19,2.19,0,0,0-1,3l13,13a6.19,6.19,0,0,0,4,2h28c4,0,5-3,5-3l9-14C2983,580,2979,580,2979,580Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="2" data-seg="19" id="hour_2_B" d="M2971.57,641.22a3.55,3.55,0,0,0,1.94,3l9.88,6.19s3,1.06,5-.9L2991,646a4.38,4.38,0,0,0,1-3l2-50a4.38,4.38,0,0,0-1-3l-4-5c-2-3-4,0-4,0l-11,17a4.62,4.62,0,0,0-1,3l-1.43,36.22" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="0" data-seg="19" id="hour_2_C" d="M2990,669l-4,52a16.85,16.85,0,0,1-4,8l-2,3c-4,5-6,1-6,1l-7-16a9.79,9.79,0,0,1-1-7l2-40a4.33,4.33,0,0,1,2-4l10-6c5-3,7,1,7,1l2,4A10,10,0,0,1,2990,669Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="1" data-seg="18" id="hour_2_D" d="M2961,718h-27a12.68,12.68,0,0,0-6,2l-14,8c-4,2-2,4-2,4l6,4a10,10,0,0,0,4,1h46c3,0,2-3,2-3l-6-14a3.55,3.55,0,0,0-3-2" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="0" data-seg="18" id="hour_2_E" d="M2930,669l-2,43a3.7,3.7,0,0,1-2,3l-14,8c-4,2-4-1-4-1l2-54c0-3,1-4,1-4l2-3c2-2,5-1,5-1l10,6a3.55,3.55,0,0,1,2,3" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="2" data-seg="18" id="hour_2_F" d="M2933,640a6.93,6.93,0,0,1-3,4l-10,7c-8,4-8-5-8-5l3-48a21.8,21.8,0,0,1,1-6l2-3a2.77,2.77,0,0,1,4,0l11,12a7.81,7.81,0,0,1,2,5Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="1" data-seg="19" id="hour_2_G" d="M2923,654l11.5-6.5a7.65,7.65,0,0,1,5-1l26.5.5c3,0,4,1,4,1l8,6c3,2,0,3,0,3l-11,6h0a13.38,13.38,0,0,1-5,1h-24a13.83,13.83,0,0,1-7-2l-8-5C2921,655,2923,654,2923,654Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ </g>
+ <g id="hour_1">
+ <path data-com="2" data-seg="20" id="hour_1_A" d="M3092,580h-49c-4,0-5,1-5,1l-2,1a2.19,2.19,0,0,0-1,3l13,13a6.19,6.19,0,0,0,4,2h28c4,0,5-3,5-3l9-14C3096,580,3092,580,3092,580Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="2" data-seg="21" id="hour_1_B" d="M3084.57,641.22a3.55,3.55,0,0,0,1.94,3l9.88,6.19s3,1.06,5-.9L3104,646a4.38,4.38,0,0,0,1-3l2-50a4.38,4.38,0,0,0-1-3l-4-5c-2-3-4,0-4,0l-11,17a4.62,4.62,0,0,0-1,3l-1.43,36.22" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="1" data-seg="21" id="hour_1_C" d="M3103,669l-4,52a16.85,16.85,0,0,1-4,8l-2,3c-4,5-6,1-6,1l-7-16a9.79,9.79,0,0,1-1-7l2-40a4.33,4.33,0,0,1,2-4l10-6c5-3,7,1,7,1l2,4A10,10,0,0,1,3103,669Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="0" data-seg="21" id="hour_1_D" d="M3074,718h-27a12.68,12.68,0,0,0-6,2l-14,8c-4,2-2,4-2,4l6,4a10,10,0,0,0,4,1h46c3,0,2-3,2-3l-6-14a3.55,3.55,0,0,0-3-2" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="0" data-seg="20" id="hour_1_E" d="M3043,669l-2,43a3.7,3.7,0,0,1-2,3l-14,8c-4,2-4-1-4-1l2-54c0-3,1-4,1-4l2-3c2-2,5-1,5-1l10,6a3.55,3.55,0,0,1,2,3" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="1" data-seg="17" id="hour_1_F" d="M3046,640a6.93,6.93,0,0,1-3,4l-10,7c-8,4-8-5-8-5l3-48a21.8,21.8,0,0,1,1-6l2-3a2.77,2.77,0,0,1,4,0l11,12a7.81,7.81,0,0,1,2,5Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="1" data-seg="20" id="hour_1_G" d="M3036,654l11.5-6.5a7.65,7.65,0,0,1,5-1l26.5.5c3,0,4,1,4,1l8,6c3,2,0,3,0,3l-11,6h0a13.38,13.38,0,0,1-5,1h-24a13.83,13.83,0,0,1-7-2l-8-5C3034,655,3036,654,3036,654Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ </g>
+ </g>
+ <g id="minutes">
+ <g id="minute_2">
+ <path data-com="0" data-seg="22" id="minute_2_A" d="M3239,580h-49c-4,0-5,1-5,1l-2,1a2.19,2.19,0,0,0-1,3l13,13a6.19,6.19,0,0,0,4,2h28c4,0,5-3,5-3l9-14C3243,580,3239,580,3239,580Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="2" data-seg="23" id="minute_2_B" d="M3231.57,641.22a3.55,3.55,0,0,0,1.94,3l9.88,6.19s3,1.06,5-.9L3251,646a4.38,4.38,0,0,0,1-3l2-50a4.38,4.38,0,0,0-1-3l-4-5c-2-3-4,0-4,0l-11,17a4.62,4.62,0,0,0-1,3l-1.43,36.22" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="0" data-seg="23" id="minute_2_C" d="M3250,669l-4,52a16.85,16.85,0,0,1-4,8l-2,3c-4,5-6,1-6,1l-7-16a9.79,9.79,0,0,1-1-7l2-40a4.33,4.33,0,0,1,2-4l10-6c5-3,7,1,7,1l2,4A10,10,0,0,1,3250,669Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="0" data-seg="22" id="minute_2_D" d="M3221,718h-27a12.68,12.68,0,0,0-6,2l-14,8c-4,2-2,4-2,4l6,4a10,10,0,0,0,4,1h46c3,0,2-3,2-3l-6-14a3.55,3.55,0,0,0-3-2" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="1" data-seg="22" id="minute_2_E" d="M3190,669l-2,43a3.7,3.7,0,0,1-2,3l-14,8c-4,2-4-1-4-1l2-54c0-3,1-4,1-4l2-3c2-2,5-1,5-1l10,6a3.55,3.55,0,0,1,2,3" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="2" data-seg="22" id="minute_2_F" d="M3193,640a6.93,6.93,0,0,1-3,4l-10,7c-8,4-8-5-8-5l3-48a21.8,21.8,0,0,1,1-6l2-3a2.77,2.77,0,0,1,4,0l11,12a7.81,7.81,0,0,1,2,5Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="1" data-seg="23" id="minute_2_G" d="M3183,654l11.5-6.5a7.65,7.65,0,0,1,5-1l26.5.5c3,0,4,1,4,1l8,6c3,2,0,3,0,3l-11,6h0a13.38,13.38,0,0,1-5,1h-24a13.83,13.83,0,0,1-7-2l-8-5C3181,655,3183,654,3183,654Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ </g>
+ <g id="minute_1">
+ <path data-com="2" data-seg="1" id="minute_1_A" d="M3352,580h-49c-4,0-5,1-5,1l-2,1a2.19,2.19,0,0,0-1,3l13,13a6.19,6.19,0,0,0,4,2h28c4,0,5-3,5-3l9-14C3356,580,3352,580,3352,580Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="2" data-seg="10" id="minute_1_B" d="M3344.57,641.22a3.55,3.55,0,0,0,1.94,3l9.88,6.19s3,1.06,5-.9L3364,646a4.38,4.38,0,0,0,1-3l2-50a4.38,4.38,0,0,0-1-3l-4-5c-2-3-4,0-4,0l-11,17a4.62,4.62,0,0,0-1,3l-1.43,36.22" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="0" data-seg="1" id="minute_1_C" d="M3363,669l-4,52a16.85,16.85,0,0,1-4,8l-2,3c-4,5-6,1-6,1l-7-16a9.79,9.79,0,0,1-1-7l2-40a4.33,4.33,0,0,1,2-4l10-6c5-3,7,1,7,1l2,4A10,10,0,0,1,3363,669Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="0" data-seg="0" id="minute_1_D" d="M3334,718h-27a12.68,12.68,0,0,0-6,2l-14,8c-4,2-2,4-2,4l6,4a10,10,0,0,0,4,1h46c3,0,2-3,2-3l-6-14a3.55,3.55,0,0,0-3-2" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="1" data-seg="0" id="minute_1_E" d="M3303,669l-2,43a3.7,3.7,0,0,1-2,3l-14,8c-4,2-4-1-4-1l2-54c0-3,1-4,1-4l2-3c2-2,5-1,5-1l10,6a3.55,3.55,0,0,1,2,3" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="2" data-seg="0" id="minute_1_F" d="M3306,640a6.93,6.93,0,0,1-3,4l-10,7c-8,4-8-5-8-5l3-48a21.8,21.8,0,0,1,1-6l2-3a2.77,2.77,0,0,1,4,0l11,12a7.81,7.81,0,0,1,2,5Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="1" data-seg="1" id="minute_1_G" d="M3296,654l11.5-6.5a7.65,7.65,0,0,1,5-1l26.5.5c3,0,4,1,4,1l8,6c3,2,0,3,0,3l-11,6h0a13.38,13.38,0,0,1-5,1h-24a13.83,13.83,0,0,1-7-2l-8-5C3294,655,3296,654,3296,654Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ </g>
+ </g>
+ <g id="seconds">
+ <g id="second_2">
+ <path data-com="2" data-seg="2" id="second_2_A" d="M3446.93,619h-37.46c-3,0-3.82.76-3.82.76l-1.53.77a1.68,1.68,0,0,0-.76,2.29l9.94,9.94a4.73,4.73,0,0,0,3,1.53h21.41a3.82,3.82,0,0,0,3.82-2.3l6.88-10.7C3450,619,3446.93,619,3446.93,619Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="2" data-seg="3" id="second_2_B" d="M3441.25,665.8a2.72,2.72,0,0,0,1.48,2.32l7.56,4.73a4,4,0,0,0,3.83-.69l2-2.71a3.38,3.38,0,0,0,.76-2.3l1.53-38.21a3.38,3.38,0,0,0-.76-2.3l-3.06-3.82c-1.53-2.29-3.06,0-3.06,0l-8.4,13a3.5,3.5,0,0,0-.77,2.29l-1.09,27.69" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="0" data-seg="4" id="second_2_C" d="M3455.33,687l-3,39.74a13,13,0,0,1-3.06,6.12l-1.53,2.29c-3.06,3.82-4.58.76-4.58.76l-5.35-12.23a7.5,7.5,0,0,1-.77-5.35l1.53-30.57a3.32,3.32,0,0,1,1.53-3.06l7.64-4.58c3.82-2.3,5.35.76,5.35.76l1.53,3.06A7.67,7.67,0,0,1,3455.33,687Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="0" data-seg="3" id="second_2_D" d="M3433.17,724.48h-20.64A9.66,9.66,0,0,0,3408,726l-10.7,6.11c-3.06,1.53-1.53,3.06-1.53,3.06l4.58,3.06a7.67,7.67,0,0,0,3.06.76h35.16c2.29,0,1.53-2.29,1.53-2.29l-4.59-10.7a2.71,2.71,0,0,0-2.29-1.53" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="0" data-seg="2" id="second_2_E" d="M3409.47,687,3408,719.89a2.82,2.82,0,0,1-1.53,2.29l-10.7,6.12c-3.06,1.53-3.06-.76-3.06-.76l1.53-41.28c0-2.29.76-3.06.76-3.06l1.53-2.29a4,4,0,0,1,3.82-.76l7.65,4.58a2.73,2.73,0,0,1,1.52,2.3" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="1" data-seg="2" id="second_2_F" d="M3411.77,664.86a5.34,5.34,0,0,1-2.3,3.06l-7.64,5.35c-6.11,3.05-6.11-3.82-6.11-3.82l2.29-36.69a16.73,16.73,0,0,1,.76-4.59l1.53-2.29a2.12,2.12,0,0,1,3.06,0l8.41,9.17a6,6,0,0,1,1.53,3.82Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="1" data-seg="3" id="second_2_G" d="M3404.12,675.56l8.79-5a5.9,5.9,0,0,1,3.83-.76l20.25.38c2.29,0,3.06.76,3.06.76l6.11,4.59c2.3,1.53,0,2.29,0,2.29l-8.4,4.59h0a10.32,10.32,0,0,1-3.83.76h-18.34a10.6,10.6,0,0,1-5.35-1.52l-6.12-3.83C3402.6,676.32,3404.12,675.56,3404.12,675.56Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ </g>
+ <g id="second_1">
+ <path data-com="2" data-seg="4" id="second_1_A" d="M3528.54,619h-37.46c-3,0-3.82.76-3.82.76l-1.53.77a1.67,1.67,0,0,0-.76,2.29l9.93,9.94a4.74,4.74,0,0,0,3.06,1.53h21.4a3.81,3.81,0,0,0,3.82-2.3l6.88-10.7C3531.59,619,3528.54,619,3528.54,619Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="2" data-seg="5" id="second_1_B" d="M3522.85,665.8a2.74,2.74,0,0,0,1.49,2.32l7.55,4.73a4,4,0,0,0,3.84-.69l2-2.71a3.38,3.38,0,0,0,.76-2.3l1.53-38.21a3.38,3.38,0,0,0-.76-2.3l-3.06-3.82c-1.53-2.29-3.06,0-3.06,0l-8.41,13a3.52,3.52,0,0,0-.76,2.29l-1.1,27.69" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="1" data-seg="6" id="second_1_C" d="M3536.94,687l-3.05,39.74a13,13,0,0,1-3.06,6.12l-1.53,2.29c-3.06,3.82-4.59.76-4.59.76l-5.35-12.23a7.46,7.46,0,0,1-.76-5.35l1.53-30.57a3.32,3.32,0,0,1,1.53-3.06l7.64-4.58c3.82-2.3,5.35.76,5.35.76l1.53,3.06A7.67,7.67,0,0,1,3536.94,687Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="0" data-seg="6" id="second_1_D" d="M3514.78,724.48h-20.64a9.72,9.72,0,0,0-4.59,1.53l-10.7,6.11c-3,1.53-1.53,3.06-1.53,3.06l4.59,3.06a7.67,7.67,0,0,0,3.06.76h35.16c2.29,0,1.53-2.29,1.53-2.29l-4.59-10.7a2.71,2.71,0,0,0-2.29-1.53" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="0" data-seg="5" id="second_1_E" d="M3491.08,687l-1.53,32.86a2.82,2.82,0,0,1-1.52,2.29l-10.71,6.12c-3.05,1.53-3.05-.76-3.05-.76l1.53-41.28c0-2.29.76-3.06.76-3.06l1.53-2.29a4,4,0,0,1,3.82-.76l7.64,4.58a2.73,2.73,0,0,1,1.53,2.3" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="1" data-seg="4" id="second_1_F" d="M3493.38,664.86a5.34,5.34,0,0,1-2.3,3.06l-7.64,5.35c-6.12,3.05-6.12-3.82-6.12-3.82l2.3-36.69a16.73,16.73,0,0,1,.76-4.59l1.53-2.29a2.12,2.12,0,0,1,3.06,0l8.41,9.17a6,6,0,0,1,1.52,3.82Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="1" data-seg="5" id="second_1_G" d="M3485.73,675.56l8.79-5a5.87,5.87,0,0,1,3.82-.76l20.26.38c2.29,0,3.06.76,3.06.76l6.11,4.59c2.29,1.53,0,2.29,0,2.29l-8.41,4.59h0a10.28,10.28,0,0,1-3.82.76H3497.2a10.6,10.6,0,0,1-5.35-1.52l-6.12-3.83C3484.2,676.32,3485.73,675.56,3485.73,675.56Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ </g>
+ </g>
+ <g id="days">
+ <g id="day_2">
+ <path data-com="1" data-seg="9" id="day_2_A" d="M3454.41,467h-31.34c-2.56,0-3.2.53-3.2.53l-1.28.53a1.05,1.05,0,0,0-.64,1.58l8.32,6.88a4.42,4.42,0,0,0,2.56,1.05h17.9c2.56,0,3.2-1.58,3.2-1.58l5.76-7.4C3457,467,3454.41,467,3454.41,467Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="0" data-seg="9" id="day_2_B" d="M3449.65,499.37a1.84,1.84,0,0,0,1.25,1.6l6.32,3.27a4,4,0,0,0,3.21-.47l1.65-1.88a2.11,2.11,0,0,0,.64-1.58l1.28-26.44a2.11,2.11,0,0,0-.64-1.58l-2.56-2.65a1.56,1.56,0,0,0-2.56,0l-7,9a2.21,2.21,0,0,0-.64,1.59l-.92,19.15" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="2" data-seg="9" id="day_2_C" d="M3461.44,514.05l-2.56,27.49a8.64,8.64,0,0,1-2.55,4.23l-1.28,1.59c-2.56,2.64-3.84.53-3.84.53l-4.48-8.46a4.37,4.37,0,0,1-.64-3.7l1.28-21.15a2.28,2.28,0,0,1,1.28-2.12l6.4-3.17c3.19-1.58,4.47.53,4.47.53l1.28,2.12A4.48,4.48,0,0,1,3461.44,514.05Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="1" data-seg="9" id="day_2_D" d="M3442.9,540h-17.27a9.28,9.28,0,0,0-3.84,1l-8.95,4.23c-2.56,1.06-1.28,2.12-1.28,2.12l3.84,2.11a7.43,7.43,0,0,0,2.55.53h29.42c1.92,0,1.28-1.59,1.28-1.59l-3.84-7.4a2.39,2.39,0,0,0-1.91-1" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="0" data-seg="10" id="day_2_E" d="M3423.07,514.05l-1.28,22.73c0,1.06-1.28,1.59-1.28,1.59l-9,4.23c-2.56,1.06-2.56-.53-2.56-.53l1.28-28.55a2.74,2.74,0,0,1,.64-2.11l1.28-1.59a3.92,3.92,0,0,1,3.2-.53l6.39,3.17a1.85,1.85,0,0,1,1.28,1.59" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="1" data-seg="9" id="day_2_G" d="M3418.59,506.12l7.36-3.44a5.79,5.79,0,0,1,3.2-.52l16.94.26a4.28,4.28,0,0,1,2.56.53l5.12,3.17c1.92,1.06,0,1.59,0,1.59l-7,3.17h0a10.16,10.16,0,0,1-3.2.53h-15.34a10.16,10.16,0,0,1-4.48-1.06l-5.12-2.64C3417.31,506.65,3418.59,506.12,3418.59,506.12Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ </g>
+ <g id="day_1">
+ <path data-com="0" data-seg="7" id="day_1_A" d="M3525.41,468h-31.34c-2.56,0-3.2.53-3.2.53l-1.28.53a1.05,1.05,0,0,0-.64,1.58l8.32,6.88a4.42,4.42,0,0,0,2.56,1.05h17.9c2.56,0,3.2-1.58,3.2-1.58l5.76-7.4C3528,468,3525.41,468,3525.41,468Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="1" data-seg="7" id="day_1_B" d="M3520.65,500.37a1.84,1.84,0,0,0,1.25,1.6l6.32,3.27a4,4,0,0,0,3.21-.47l1.65-1.88a2.11,2.11,0,0,0,.64-1.58l1.28-26.44a2.11,2.11,0,0,0-.64-1.58l-2.56-2.65a1.56,1.56,0,0,0-2.56,0l-7,9a2.21,2.21,0,0,0-.64,1.59l-.92,19.15" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="2" data-seg="7" id="day_1_C" d="M3532.44,515.05l-2.56,27.49a8.64,8.64,0,0,1-2.55,4.23l-1.28,1.59c-2.56,2.64-3.84.53-3.84.53l-4.48-8.46a4.37,4.37,0,0,1-.64-3.7l1.28-21.15a2.28,2.28,0,0,1,1.28-2.12l6.4-3.17c3.19-1.58,4.47.53,4.47.53l1.28,2.12A4.48,4.48,0,0,1,3532.44,515.05Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="2" data-seg="6" id="day_1_D" d="M3513.9,541h-17.27a9.28,9.28,0,0,0-3.84,1l-8.95,4.23c-2.56,1.06-1.28,2.12-1.28,2.12l3.84,2.11a7.43,7.43,0,0,0,2.55.53h29.42c1.92,0,1.28-1.59,1.28-1.59l-3.84-7.4a2.39,2.39,0,0,0-1.91-1" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="2" data-seg="8" id="day_1_E" d="M3494.07,515.05l-1.28,22.73c0,1.06-1.28,1.59-1.28,1.59l-9,4.23c-2.56,1.06-2.56-.53-2.56-.53l1.28-28.55a2.74,2.74,0,0,1,.64-2.11l1.28-1.59a3.92,3.92,0,0,1,3.2-.53l6.39,3.17a1.85,1.85,0,0,1,1.28,1.59" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="0" data-seg="8" id="day_1_F" d="M3496,499.72a3.89,3.89,0,0,1-1.92,2.11l-6.4,3.71c-5.11,2.11-5.11-2.65-5.11-2.65l1.92-25.37a9.8,9.8,0,0,1,.64-3.18l1.28-1.58a2,2,0,0,1,2.55,0l7,6.34a3.73,3.73,0,0,1,1.28,2.65Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="1" data-seg="8" id="day_1_G" d="M3489.59,507.12l7.36-3.44a5.79,5.79,0,0,1,3.2-.52l16.94.26a4.28,4.28,0,0,1,2.56.53l5.12,3.17c1.92,1.06,0,1.59,0,1.59l-7,3.17h0a10.16,10.16,0,0,1-3.2.53h-15.34a10.16,10.16,0,0,1-4.48-1.06l-5.12-2.64C3488.31,507.65,3489.59,507.12,3489.59,507.12Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ </g>
+ </g>
+ <g id="mode">
+ <g id="mode_2">
+ <path data-com="0" data-seg="13" id="mode_2_A" d="M3170,468l-4,6a3.49,3.49,0,0,1-2,1h-25a3.1,3.1,0,0,1-2-1l-5-7s-1-1,1-1h36C3171,466,3170,468,3170,468Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="1" data-seg="13" id="mode_2_B" d="M3168,474l4-5a1.39,1.39,0,0,1,2,0l1,1a3.89,3.89,0,0,1,1,3l-1,22c-1,5-5,3-5,3l-3.56-2.19a3.45,3.45,0,0,1-.9-2L3166,479A7.65,7.65,0,0,1,3168,474Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="2" data-seg="13" id="mode_2_C" d="M3165,529.47l3.51,6a1.28,1.28,0,0,0,2,.19l1.09-1a4.66,4.66,0,0,0,1.28-3.29l1-23.8c-.53-5.75-4.7-3.87-4.7-3.87l-3.75,2.13a4.09,4.09,0,0,0-1.09,2.23l-.83,15.59A9.28,9.28,0,0,0,3165,529.47Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="2" data-seg="15" id="mode_2_D" d="M3129,537l4-6a3.49,3.49,0,0,1,2-1h26a3.1,3.1,0,0,1,2,1l5,7s1,1-1,1h-37C3128,539,3129,537,3129,537Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="2" data-seg="14" id="mode_2_E" d="M3131.4,529.78l-4,5.63a1.29,1.29,0,0,1-2,0l-1-1.11a4.58,4.58,0,0,1-1-3.36l1.12-23.57c1-5.61,5-3.39,5-3.39l3.55,2.43a4.11,4.11,0,0,1,.89,2.29l-.55,15.45A9.15,9.15,0,0,1,3131.4,529.78Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="0" data-seg="14" id="mode_2_F" d="M3134.32,474.27l-3.54-5.33a1.38,1.38,0,0,0-2-.18l-1.09.91a3.9,3.9,0,0,0-1.26,2.9l-.87,22c.56,5.07,4.72,3.43,4.72,3.43l3.74-1.86a3.49,3.49,0,0,0,1.08-2l.76-14.75A7.63,7.63,0,0,0,3134.32,474.27Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="1" data-seg="15" id="mode_2_G" d="M3143,505l5-1a4.83,4.83,0,0,1,4,0l5,1a10.56,10.56,0,0,0,6,0l5-2s3-2,0-3l-4-2a13.6,13.6,0,0,0-7,0l-5,2a4.83,4.83,0,0,1-4,0l-5-2s-4-1-7,0l-5,2s-3,1,0,3l5,2A13.6,13.6,0,0,0,3143,505Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <polygon data-com="1" data-seg="14" id="mode_2_H" points="552.5 570 562.5 570 561.5 585 556.5 588 551.5 585 552.5 570" style="fill: #304246"/>
+ <polygon data-com="1" data-seg="14" id="mode_2_I" points="559.5 617 549.5 617 550.5 600 555.5 597 560.5 600 559.5 617" style="fill: #304246"/>
+ </g>
+ <g id="mode_1">
+ <path data-com="0" data-seg="11" id="mode_1_A" d="M3242,469l-4,6a3.49,3.49,0,0,1-2,1h-21a3.1,3.1,0,0,1-2-1l-5-7s-1-1,1-1h32C3243,467,3242,469,3242,469Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="1" data-seg="11" id="mode_1_B" d="M3241,475l4-5a1.39,1.39,0,0,1,2,0l1,1a3.89,3.89,0,0,1,1,3l-1,21c-1,5-5,3-5,3l-3.56-2.19a3.45,3.45,0,0,1-.9-2L3239,480A7.65,7.65,0,0,1,3241,475Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="1" data-seg="11" id="mode_1_C" d="M3238,530.47l3.51,6a1.28,1.28,0,0,0,2,.19l1.09-1a4.66,4.66,0,0,0,1.28-3.29l1-23.8c-.53-5.75-4.7-3.87-4.7-3.87l-3.75,2.13a4.09,4.09,0,0,0-1.09,2.23l-.83,15.59A9.28,9.28,0,0,0,3238,530.47Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="2" data-seg="11" id="mode_1_D" d="M3205,538l4-6a3.49,3.49,0,0,1,2-1h22a3.1,3.1,0,0,1,2,1l5,7s1,1-1,1h-33C3204,540,3205,538,3205,538Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="1" data-seg="12" id="mode_1_E" d="M3207.4,530.78l-4,5.63a1.29,1.29,0,0,1-2,0l-1-1.11a4.58,4.58,0,0,1-1-3.36l1.12-23.57c1-5.61,5-3.39,5-3.39l3.55,2.43a4.11,4.11,0,0,1,.89,2.29l-.55,15.45A9.15,9.15,0,0,1,3207.4,530.78Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="1" data-seg="12" id="mode_1_F" d="M3210.32,475.27l-3.54-5.33a1.38,1.38,0,0,0-2-.18l-1.09.91a3.9,3.9,0,0,0-1.26,2.9l-.87,21c.56,5.07,4.72,3.43,4.72,3.43l3.74-1.86a3.49,3.49,0,0,0,1.08-2l.76-13.75A7.63,7.63,0,0,0,3210.32,475.27Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="2" data-seg="12" id="mode_1_G" d="M3216,497h17a12.13,12.13,0,0,1,5,1l4,2c3,1,0,3,0,3l-5,2a10,10,0,0,1-4,1h-17a10.34,10.34,0,0,1-4-1l-5-2c-3-2,0-3,0-3l5-2A10,10,0,0,1,3216,497Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="0" data-seg="12" id="mode_1_H" d="M3202,469l-3,6a3.49,3.49,0,0,1-2,1h-3a3.1,3.1,0,0,1-2-1l-3-7s-1-1,1-1h11C3203,467,3202,469,3202,469Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ </g>
+ </g>
+ <g id="lap">
+ <path data-com="1" data-seg="10" d="M3297.93,536.73h17.61v5.81h-25v-34.6h7.41Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="1" data-seg="10" d="M3329,535.9l-2.34,6.64h-7.58l12.65-34.6h10.72l12.88,34.6h-7.41l-2.45-6.64Zm8.21-22.87-6.5,17.94h13.11Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="1" data-seg="10" d="M3361.94,507.94h15.22q7.64.06,11.29,2.05t3.64,9.78c0,.45,0,.92,0,1.4s-.05,1-.09,1.45a13.26,13.26,0,0,1-.71,3.53,6.55,6.55,0,0,1-2.14,3,8.07,8.07,0,0,1-3.85,1.84,24.44,24.44,0,0,1-4.41.39,3.83,3.83,0,0,1-.6,0H3369v11.15h-7.07Zm15.34,17.69a13.87,13.87,0,0,0,5.72-.75c1.12-.54,1.69-2.19,1.69-5,0-2.56-.39-4.26-1.15-5.09s-2.6-1.24-5.52-1.24h-9v12Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ </g>
+ <g id="timemode_24H">
+ <path data-com="2" data-seg="16" d="M3018.51,550.54h-17.6V545q0-4.51,1.75-5.8a12.09,12.09,0,0,1,4.93-1.89,3.09,3.09,0,0,1,.46-.12l.49-.08a6,6,0,0,1,.82-.12,7.37,7.37,0,0,0,.75-.12,6.8,6.8,0,0,0,3.1-1.05c.69-.51,1-1.77,1-3.78s-.33-3.31-1-3.73a7.11,7.11,0,0,0-3.49-.62,6.73,6.73,0,0,0-3.71.7c-.63.47-.94,1.82-.94,4v.84h-4.2V532c0-.24,0-.49,0-.74s0-.5,0-.74a13.83,13.83,0,0,1,.46-3,4.3,4.3,0,0,1,1.61-2.34,6.36,6.36,0,0,1,2.2-1.08,12.5,12.5,0,0,1,2.42-.41c.37,0,.73,0,1.08,0h1.05a12.24,12.24,0,0,1,6.5,1.43c1.5.94,2.25,3.25,2.25,6.91s-.66,5.88-2,6.78a13,13,0,0,1-5.06,1.91l-2,.34a17.28,17.28,0,0,0-2.13.51,2.41,2.41,0,0,0-1.91,1.48,10.28,10.28,0,0,0-.3,2.74v.69h13.37Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="2" data-seg="16" d="M3042.35,540.92h2.73v3.83h-2.73v5.79h-4.2v-5.79h-12.71v-5.56l10.36-15.5h6.55Zm-4.27-13.48-9.1,13.48h9.17Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="2" data-seg="16" d="M3071.71,550.54h-4.48V539.07h-10.88v11.47h-4.45V523.69h4.45v11h10.88v-11h4.48Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ </g>
+ <g id="timemode_PM">
+ <path data-com="2" data-seg="17" d="M2922.93,514.49h12.55q6.3.06,9.31,2.14t3,10.18c0,.47,0,1,0,1.46s0,1-.07,1.52a16.64,16.64,0,0,1-.59,3.67,6.84,6.84,0,0,1-1.76,3.08,6.22,6.22,0,0,1-3.17,1.92,16.25,16.25,0,0,1-3.64.41,2.73,2.73,0,0,1-.5,0h-9.28v11.62h-5.83Zm12.65,18.43a9.35,9.35,0,0,0,4.72-.78c.92-.56,1.39-2.28,1.39-5.16,0-2.67-.32-4.44-.94-5.3s-2.15-1.3-4.56-1.3h-7.43v12.54Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="2" data-seg="17" d="M2988.83,550.54H2983l.19-30.37-9.87,30.37h-5.41l-10-30.21.28,30.21h-5.87v-36h9.68l8.46,26.76h.19l8.37-26.76h9.87Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ </g>
+ <g id="alarm">
+ <path data-com="0" data-seg="16" id="alarm_inside" d="M3056,494.06c-3.84,0-4.77-4.95-4.77-4.95V476.42c0-6.45-6.71-6.45-6.71-6.45h-3.19v-4.5h-5V470h-3.2s-6.7,0-6.7,6.45v12.69s-.91,4.95-4.77,4.95v4.61H3036a6.21,6.21,0,0,0-1.27,3.84c0,3,1.92,5.39,4.28,5.39s4.27-2.42,4.27-5.39a6.31,6.31,0,0,0-1.23-3.84h14Zm-8,.94h-18V476a2.94,2.94,0,0,1,3-3h12a2.94,2.94,0,0,1,3,3Z" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ </g>
+ <g id="signal">
+ <path data-com="0" data-seg="17" id="signal_5" d="M2992.68,498.36c1,0,1.75-6.25,1.75-14s-.78-13.95-1.75-13.95h-6c.94,0,1.73,6.25,1.73,13.95s-.79,14-1.73,14h6" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="0" data-seg="17" id="signal_4" d="M2979.8,498.36c.95,0,1.74-6.25,1.74-14s-.79-13.95-1.74-13.95h-7.41c1,0,1.76,6.25,1.76,13.95s-.79,14-1.76,14h7.41" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="0" data-seg="17" id="signal_3" d="M2964.16,498.36c1.48,0,2.67-6.25,2.67-14s-1.19-13.95-2.67-13.95h-7.78c1.48,0,2.67,6.25,2.67,13.95s-1.19,14-2.67,14h7.78" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="0" data-seg="17" id="signal_2" d="M2948,498.36c2.58,0,4.71-6.25,4.71-14s-2.13-13.95-4.71-13.95h-8.33c2.59,0,4.71,6.25,4.71,13.95s-2.12,14-4.71,14H2948" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ <path data-com="0" data-seg="17" id="signal_1" d="M2932.78,498.36c2.61,0,4.71-6.25,4.71-14s-2.1-13.95-4.71-13.95H2923V498.3l9.78.06" transform="translate(-2593.5 91)" style="fill: #304246"/>
+ </g>
+ </g>
+ </g>
+ </svg>
+ <p style="text-align: center;"><a href="https://github.com/alexisphilip/Casio-F-91W">Original F-91W SVG</a> is &copy; 2020 Alexis Philip, and is used here under the terms of the MIT license.</p>
+</div>
+
+<textarea id="output" rows="8" style="width: 100%"></textarea>
+
+<script type='text/javascript'>
+ var outputElement = document.getElementById('output');
+ var Module = {
+ preRun: [],
+ postRun: [],
+ print: (function() {
+ if (outputElement) outputElement.value = ''; // clear browser cache
+ return function(text) {
+ if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' ');
+ console.log(text);
+ if (outputElement) {
+ outputElement.value += text + "\n";
+ outputElement.scrollTop = outputElement.scrollHeight; // focus on bottom
+ }
+ };
+ })(),
+ setStatus: function(text) {
+ if (!text) return;
+ if (text === 'Running...') text += '\n==========';
+
+ if (outputElement) {
+ outputElement.value += text + "\n";
+ outputElement.scrollTop = outputElement.scrollHeight; // focus on bottom
+ }
+ },
+ totalDependencies: 0,
+ monitorRunDependencies: function(left) {
+ this.totalDependencies = Math.max(this.totalDependencies, left);
+ Module.setStatus(left ? 'Preparing... (' + (this.totalDependencies-left) + '/' + this.totalDependencies + ')' : 'All downloads complete.');
+ }
+ };
+ Module.setStatus('Downloading...');
+ window.onerror = function() {
+ Module.setStatus('Exception thrown, see JavaScript console');
+ Module.setStatus = function(text) {
+ if (text) Module.printErr('[post-exception status] ' + text);
+ };
+ };
+</script>
+{{{ SCRIPT }}}
+</body>
+</html>
+
diff --git a/watch-library/simulator/watch/watch.c b/watch-library/simulator/watch/watch.c
new file mode 100644
index 00000000..2b14d0ab
--- /dev/null
+++ b/watch-library/simulator/watch/watch.c
@@ -0,0 +1,9 @@
+#include "watch.h"
+
+bool watch_is_battery_low(void) {
+ return false;
+}
+
+bool watch_is_buzzer_or_led_enabled(void) {
+ return false;
+}
diff --git a/watch-library/simulator/watch/watch_adc.c b/watch-library/simulator/watch/watch_adc.c
new file mode 100644
index 00000000..364e2119
--- /dev/null
+++ b/watch-library/simulator/watch/watch_adc.c
@@ -0,0 +1,48 @@
+/*
+ * MIT License
+ *
+ * Copyright (c) 2020 Joey Castillo
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include "watch_adc.h"
+
+void watch_enable_adc(void) {}
+
+void watch_enable_analog_input(const uint8_t pin) {}
+
+uint16_t watch_get_analog_pin_level(const uint8_t pin) {
+ return 0;
+}
+
+void watch_set_analog_num_samples(uint16_t samples) {}
+
+void watch_set_analog_sampling_length(uint8_t cycles) {}
+
+void watch_set_analog_reference_voltage(watch_adc_reference_voltage reference) {}
+
+uint16_t watch_get_vcc_voltage(void) {
+ // TODO: (a2) hook to UI
+ return 3000;
+}
+
+inline void watch_disable_analog_input(const uint8_t pin) {}
+
+inline void watch_disable_adc(void) {}
diff --git a/watch-library/simulator/watch/watch_buzzer.c b/watch-library/simulator/watch/watch_buzzer.c
new file mode 100644
index 00000000..f19e1928
--- /dev/null
+++ b/watch-library/simulator/watch/watch_buzzer.c
@@ -0,0 +1,60 @@
+/*
+ * MIT License
+ *
+ * Copyright (c) 2020 Joey Castillo
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include "watch_buzzer.h"
+
+inline void watch_enable_buzzer(void) {
+ // TODO: (a2) hook to UI
+}
+inline void watch_set_buzzer_period(uint32_t period) {
+ // TODO: (a2) hook to UI
+}
+
+void watch_disable_buzzer(void) {
+ _watch_disable_tcc();
+}
+
+inline void watch_set_buzzer_on(void) {
+ // TODO: (a2) hook to UI
+}
+
+inline void watch_set_buzzer_off(void) {
+ // TODO: (a2) hook to UI
+}
+
+// note: the buzzer uses a 1 MHz clock. these values were determined by dividing 1,000,000 by the target frequency.
+// i.e. for a 440 Hz tone (A4 on the piano), 1MHz/440Hz = 2273
+const uint16_t NotePeriods[108] = {0};
+
+void watch_buzzer_play_note(BuzzerNote note, uint16_t duration_ms) {
+ if (note == BUZZER_NOTE_REST) {
+ watch_set_buzzer_off();
+ } // else {
+ // hri_tcc_write_PERBUF_reg(TCC0, NotePeriods[note]);
+ // hri_tcc_write_CCBUF_reg(TCC0, WATCH_BUZZER_TCC_CHANNEL, NotePeriods[note] / 2);
+ // watch_set_buzzer_on();
+ // }
+ // delay_ms(duration_ms);
+ // watch_set_buzzer_off();
+}
diff --git a/watch-library/simulator/watch/watch_deepsleep.c b/watch-library/simulator/watch/watch_deepsleep.c
new file mode 100644
index 00000000..9f409570
--- /dev/null
+++ b/watch-library/simulator/watch/watch_deepsleep.c
@@ -0,0 +1,99 @@
+/*
+ * MIT License
+ *
+ * Copyright (c) 2020 Joey Castillo
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include "watch_extint.h"
+
+// this warning only appears when you `make BOARD=OSO-SWAT-A1-02`. it's annoying,
+// but i'd rather have it warn us at build-time than fail silently at run-time.
+// besides, no one but me really has any of these boards anyway.
+#if BTN_ALARM != GPIO(GPIO_PORTA, 2)
+#warning This board revision does not support external wake on BTN_ALARM, so watch_register_extwake_callback will not work with it. Use watch_register_interrupt_callback instead.
+#endif
+
+static uint32_t watch_backup_data[8];
+
+void watch_register_extwake_callback(uint8_t pin, ext_irq_cb_t callback, bool level) {
+ if (pin == BTN_ALARM) {
+ watch_register_interrupt_callback(pin, callback, level ? INTERRUPT_TRIGGER_RISING : INTERRUPT_TRIGGER_FALLING);
+ }
+}
+
+void watch_disable_extwake_interrupt(uint8_t pin) {
+ if (pin == BTN_ALARM) {
+ watch_register_interrupt_callback(pin, NULL, INTERRUPT_TRIGGER_NONE);
+ }
+}
+
+void watch_store_backup_data(uint32_t data, uint8_t reg) {
+ if (reg < 8) {
+ watch_backup_data[reg] = data;
+ }
+}
+
+uint32_t watch_get_backup_data(uint8_t reg) {
+ if (reg < 8) {
+ return watch_backup_data[reg];
+ }
+
+ return 0;
+}
+
+void watch_enter_sleep_mode(void) {
+ // TODO: (a2) hook to UI
+
+ // enter standby (4); we basically hang out here until an interrupt wakes us.
+ // sleep(4);
+
+ // call app_setup so the app can re-enable everything we disabled.
+ app_setup();
+
+ // and call app_wake_from_standby (since main won't have a chance to do it)
+ app_wake_from_standby();
+}
+
+void watch_enter_deep_sleep_mode(void) {
+ // identical to sleep mode except we disable the LCD first.
+ // TODO: (a2) hook to UI
+
+ watch_enter_sleep_mode();
+}
+
+void watch_enter_backup_mode(void) {
+ // TODO: (a2) hook to UI
+
+ // go into backup sleep mode (5). when we exit, the reset controller will take over.
+ // sleep(5);
+}
+
+// deprecated
+void watch_enter_shallow_sleep(bool display_on) {
+ if (display_on) watch_enter_sleep_mode();
+ else watch_enter_deep_sleep_mode();
+}
+
+// deprecated
+void watch_enter_deep_sleep(void) {
+ watch_register_extwake_callback(BTN_ALARM, NULL, true);
+ watch_enter_backup_mode();
+}
diff --git a/watch-library/simulator/watch/watch_extint.c b/watch-library/simulator/watch/watch_extint.c
new file mode 100644
index 00000000..d37059bf
--- /dev/null
+++ b/watch-library/simulator/watch/watch_extint.c
@@ -0,0 +1,191 @@
+/*
+ * MIT License
+ *
+ * Copyright (c) 2020 Joey Castillo
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include "watch_extint.h"
+
+#include <emscripten.h>
+#include <emscripten/html5.h>
+
+static bool output_focused = false;
+static bool external_interrupt_enabled = false;
+static bool button_callbacks_installed = false;
+static ext_irq_cb_t external_interrupt_mode_callback = NULL;
+static watch_interrupt_trigger external_interrupt_mode_trigger = INTERRUPT_TRIGGER_NONE;
+static ext_irq_cb_t external_interrupt_light_callback = NULL;
+static watch_interrupt_trigger external_interrupt_light_trigger = INTERRUPT_TRIGGER_NONE;
+static ext_irq_cb_t external_interrupt_alarm_callback = NULL;
+static watch_interrupt_trigger external_interrupt_alarm_trigger = INTERRUPT_TRIGGER_NONE;
+
+#define BTN_ID_ALARM 3
+#define BTN_ID_LIGHT 1
+#define BTN_ID_MODE 2
+static const uint8_t BTN_IDS[] = { BTN_ID_ALARM, BTN_ID_LIGHT, BTN_ID_MODE };
+static void watch_invoke_interrupt_callback(const uint8_t button_id, watch_interrupt_trigger trigger);
+
+static EM_BOOL watch_invoke_key_callback(int eventType, const EmscriptenKeyboardEvent *keyEvent, void *userData) {
+ if (output_focused || keyEvent->repeat) return EM_FALSE;
+
+ const char *key = keyEvent->key;
+ if (key[1] != 0) return EM_FALSE;
+
+ uint8_t button_id;
+ switch (key[0]) {
+ case 'A':
+ case 'a':
+ button_id = BTN_ID_ALARM;
+ break;
+ case 'L':
+ case 'l':
+ button_id = BTN_ID_LIGHT;
+ break;
+ case 'M':
+ case 'm':
+ button_id = BTN_ID_MODE;
+ break;
+ default:
+ return EM_FALSE;
+ }
+
+ watch_interrupt_trigger trigger = eventType == EMSCRIPTEN_EVENT_KEYDOWN ? INTERRUPT_TRIGGER_RISING : INTERRUPT_TRIGGER_FALLING;
+ watch_invoke_interrupt_callback(button_id, trigger);
+ return EM_TRUE;
+}
+
+static EM_BOOL watch_invoke_mouse_callback(int eventType, const EmscriptenMouseEvent *mouseEvent, void *userData) {
+ if (eventType == EMSCRIPTEN_EVENT_MOUSEOUT && mouseEvent->buttons == 0) return EM_FALSE;
+ uint8_t button_id = *(const char *)userData;
+ watch_interrupt_trigger trigger = eventType == EMSCRIPTEN_EVENT_MOUSEDOWN ? INTERRUPT_TRIGGER_RISING : INTERRUPT_TRIGGER_FALLING;
+ watch_invoke_interrupt_callback(button_id, trigger);
+ return EM_TRUE;
+}
+
+static EM_BOOL watch_invoke_touch_callback(int eventType, const EmscriptenTouchEvent *touchEvent, void *userData) {
+ uint8_t button_id = *(const char *)userData;
+ watch_interrupt_trigger trigger = eventType == EMSCRIPTEN_EVENT_TOUCHSTART ? INTERRUPT_TRIGGER_RISING : INTERRUPT_TRIGGER_FALLING;
+ watch_invoke_interrupt_callback(button_id, trigger);
+ return EM_TRUE;
+}
+
+static EM_BOOL watch_invoke_focus_callback(int eventType, const EmscriptenFocusEvent *focusEvent, void *userData) {
+ output_focused = eventType == EMSCRIPTEN_EVENT_FOCUS;
+ return EM_TRUE;
+}
+
+static void watch_install_button_callbacks(void) {
+ emscripten_set_keydown_callback(EMSCRIPTEN_EVENT_TARGET_DOCUMENT, NULL, EM_FALSE, watch_invoke_key_callback);
+ emscripten_set_keyup_callback(EMSCRIPTEN_EVENT_TARGET_DOCUMENT, NULL, EM_FALSE, watch_invoke_key_callback);
+
+ const char *target_output = "#output";
+ emscripten_set_focus_callback(target_output, NULL, EM_FALSE, watch_invoke_focus_callback);
+ emscripten_set_blur_callback(target_output, NULL, EM_FALSE, watch_invoke_focus_callback);
+
+ for (int i = 0, count = sizeof(BTN_IDS) / sizeof(BTN_IDS[0]); i < count; i++) {
+ char target[] = "#btn_";
+ target[4] = BTN_IDS[i] + '0';
+
+ emscripten_set_mousedown_callback(target, (void *)&BTN_IDS[i], EM_FALSE, watch_invoke_mouse_callback);
+ emscripten_set_mouseup_callback(target, (void *)&BTN_IDS[i], EM_FALSE, watch_invoke_mouse_callback);
+ emscripten_set_mouseout_callback(target, (void *)&BTN_IDS[i], EM_FALSE, watch_invoke_mouse_callback);
+
+ emscripten_set_touchstart_callback(target, (void *)&BTN_IDS[i], EM_FALSE, watch_invoke_touch_callback);
+ emscripten_set_touchend_callback(target, (void *)&BTN_IDS[i], EM_FALSE, watch_invoke_touch_callback);
+ }
+}
+
+void watch_enable_external_interrupts(void) {
+ external_interrupt_enabled = true;
+
+ if (!button_callbacks_installed) {
+ watch_install_button_callbacks();
+ button_callbacks_installed = true;
+ }
+}
+
+void watch_disable_external_interrupts(void) {
+ external_interrupt_enabled = false;
+}
+
+static void watch_invoke_interrupt_callback(const uint8_t button_id, watch_interrupt_trigger event) {
+ if (!external_interrupt_enabled) return;
+
+ ext_irq_cb_t callback;
+ watch_interrupt_trigger trigger;
+ uint8_t pin;
+ switch (button_id) {
+ case BTN_ID_MODE:
+ pin = BTN_MODE;
+ callback = external_interrupt_mode_callback;
+ trigger = external_interrupt_mode_trigger;
+ break;
+ case BTN_ID_LIGHT:
+ pin = BTN_LIGHT;
+ callback = external_interrupt_light_callback;
+ trigger = external_interrupt_light_trigger;
+ break;
+ case BTN_ID_ALARM:
+ pin = BTN_ALARM;
+ callback = external_interrupt_alarm_callback;
+ trigger = external_interrupt_alarm_trigger;
+ break;
+ default:
+ return;
+ }
+
+ const bool level = (event & INTERRUPT_TRIGGER_RISING) != 0;
+ EM_ASM({
+ const classList = document.querySelector('#btn' + $0).classList;
+ const highlight = 'highlight';
+ $1 ? classList.add(highlight) : classList.remove(highlight);
+ }, button_id, level);
+
+ watch_set_pin_level(pin, level);
+
+ if (callback && (event & trigger) != 0) {
+ callback();
+
+ void resume_main_loop(void);
+ resume_main_loop();
+ }
+}
+
+void watch_register_interrupt_callback(const uint8_t pin, ext_irq_cb_t callback, watch_interrupt_trigger trigger) {
+ if (pin == BTN_MODE) {
+ external_interrupt_mode_callback = callback;
+ external_interrupt_mode_trigger = trigger;
+ } else if (pin == BTN_LIGHT) {
+ external_interrupt_light_callback = callback;
+ external_interrupt_light_trigger = trigger;
+ } else if (pin == BTN_ALARM) {
+ external_interrupt_alarm_callback = callback;
+ external_interrupt_alarm_trigger = trigger;
+ }
+}
+
+void watch_register_button_callback(const uint8_t pin, ext_irq_cb_t callback) {
+ watch_register_interrupt_callback(pin, callback, INTERRUPT_TRIGGER_RISING);
+}
+
+void watch_enable_buttons(void) {
+ watch_enable_external_interrupts();
+}
diff --git a/watch-library/simulator/watch/watch_gpio.c b/watch-library/simulator/watch/watch_gpio.c
new file mode 100644
index 00000000..4bea2c11
--- /dev/null
+++ b/watch-library/simulator/watch/watch_gpio.c
@@ -0,0 +1,47 @@
+/*
+ * MIT License
+ *
+ * Copyright (c) 2020 Joey Castillo
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include "watch_gpio.h"
+
+static bool pin_levels[UINT8_MAX];
+
+void watch_enable_digital_input(const uint8_t pin) {}
+
+void watch_disable_digital_input(const uint8_t pin) {}
+
+void watch_enable_pull_up(const uint8_t pin) {}
+
+void watch_enable_pull_down(const uint8_t pin) {}
+
+bool watch_get_pin_level(const uint8_t pin) {
+ return pin_levels[pin];
+}
+
+void watch_enable_digital_output(const uint8_t pin) {}
+
+void watch_disable_digital_output(const uint8_t pin) {}
+
+void watch_set_pin_level(const uint8_t pin, const bool level) {
+ pin_levels[pin] = level;
+}
diff --git a/watch-library/simulator/watch/watch_i2c.c b/watch-library/simulator/watch/watch_i2c.c
new file mode 100644
index 00000000..09339888
--- /dev/null
+++ b/watch-library/simulator/watch/watch_i2c.c
@@ -0,0 +1,51 @@
+/*
+ * MIT License
+ *
+ * Copyright (c) 2020 Joey Castillo
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include "watch_i2c.h"
+
+void watch_enable_i2c(void) {}
+
+void watch_disable_i2c(void) {}
+
+void watch_i2c_send(int16_t addr, uint8_t *buf, uint16_t length) {}
+
+void watch_i2c_receive(int16_t addr, uint8_t *buf, uint16_t length) {}
+
+void watch_i2c_write8(int16_t addr, uint8_t reg, uint8_t data) {}
+
+uint8_t watch_i2c_read8(int16_t addr, uint8_t reg) {
+ return 0;
+}
+
+uint16_t watch_i2c_read16(int16_t addr, uint8_t reg) {
+ return 0;
+}
+
+uint32_t watch_i2c_read24(int16_t addr, uint8_t reg) {
+ return 0;
+}
+
+uint32_t watch_i2c_read32(int16_t addr, uint8_t reg) {
+ return 0;
+}
diff --git a/watch-library/simulator/watch/watch_led.c b/watch-library/simulator/watch/watch_led.c
new file mode 100644
index 00000000..173f1b08
--- /dev/null
+++ b/watch-library/simulator/watch/watch_led.c
@@ -0,0 +1,63 @@
+/*
+ * MIT License
+ *
+ * Copyright (c) 2020 Joey Castillo
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include "watch_led.h"
+
+#include <emscripten.h>
+
+void watch_enable_leds(void) {}
+
+void watch_disable_leds(void) {}
+
+void watch_enable_led(bool unused) {
+ (void)unused;
+ watch_enable_leds();
+}
+
+void watch_disable_led(bool unused) {
+ (void)unused;
+ watch_disable_leds();
+}
+
+void watch_set_led_color(uint8_t red, uint8_t green) {
+ EM_ASM({
+ document.getElementById('light').style.opacity = $1 / 255;
+ }, red, green);
+}
+
+void watch_set_led_red(void) {
+ watch_set_led_color(255, 0);
+}
+
+void watch_set_led_green(void) {
+ watch_set_led_color(0, 255);
+}
+
+void watch_set_led_yellow(void) {
+ watch_set_led_color(255, 255);
+}
+
+void watch_set_led_off(void) {
+ watch_set_led_color(0, 0);
+}
diff --git a/watch-library/simulator/watch/watch_private.c b/watch-library/simulator/watch/watch_private.c
new file mode 100644
index 00000000..b852893b
--- /dev/null
+++ b/watch-library/simulator/watch/watch_private.c
@@ -0,0 +1,78 @@
+/*
+ * MIT License
+ *
+ * Copyright (c) 2020 Joey Castillo
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include "watch_private.h"
+#include "watch_utility.h"
+#include <sys/time.h>
+
+void _watch_init(void) {
+ // External wake depends on RTC; calendar is a required module.
+ _watch_rtc_init();
+}
+
+// this function is called by arc4random to get entropy for random number generation.
+// let's use the SAM L22's true random number generator to seed the PRNG!
+int getentropy(void *buf, size_t buflen);
+int getentropy(void *buf, size_t buflen) {
+ // TODO: (a2) hook to RNG
+ return 0;
+}
+
+int _gettimeofday(struct timeval *tv, void *tzvp);
+int _gettimeofday(struct timeval *tv, void *tzvp) {
+ (void)tzvp;
+ watch_date_time date_time = watch_rtc_get_date_time();
+
+ // FIXME: this assumes the system time is UTC! Will break for any other time zone.
+ tv->tv_sec = watch_utility_date_time_to_unix_time(date_time, 0);
+ tv->tv_usec = 0;
+
+ return 0;
+}
+
+void _watch_enable_tcc(void) {}
+
+void _watch_disable_tcc(void) {}
+
+void _watch_enable_usb(void) {}
+
+// this function ends up getting called by printf to log stuff to the USB console.
+int _write(int file, char *ptr, int len) {
+ // TODO: (a2) hook to UI
+ return 0;
+}
+
+// this method could be overridden to read stuff from the USB console? but no need rn.
+int _read(void) {
+ return 0;
+}
+
+// Alternate function that outputs to the debug UART. useful for debugging USB issues.
+// int _write(int file, char *ptr, int len) {
+// (void)file;
+// int pos = 0;
+// while(pos < len) watch_debug_putc(ptr[pos++]);
+
+// return 0;
+// }
diff --git a/watch-library/simulator/watch/watch_rtc.c b/watch-library/simulator/watch/watch_rtc.c
new file mode 100644
index 00000000..573c0ff2
--- /dev/null
+++ b/watch-library/simulator/watch/watch_rtc.c
@@ -0,0 +1,223 @@
+/*
+ * MIT License
+ *
+ * Copyright (c) 2020 Joey Castillo
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include "watch_rtc.h"
+
+#include <emscripten.h>
+#include <emscripten/html5.h>
+
+static double time_offset = 0;
+static long tick_callbacks[8];
+
+static long alarm_interval_id;
+static long alarm_timeout_id;
+static double alarm_interval;
+ext_irq_cb_t alarm_callback;
+ext_irq_cb_t btn_alarm_callback;
+ext_irq_cb_t a2_callback;
+ext_irq_cb_t a4_callback;
+
+bool _watch_rtc_is_enabled(void) {
+ return true;
+}
+
+void _watch_rtc_init(void) {
+}
+
+void watch_rtc_set_date_time(watch_date_time date_time) {
+ time_offset = EM_ASM_DOUBLE({
+ const year = 2020 + (($0 >> 26) & 0x3f);
+ const month = ($0 >> 22) & 0xf;
+ const day = ($0 >> 17) & 0x1f;
+ const hour = ($0 >> 12) & 0x1f;
+ const minute = ($0 >> 6) & 0x3f;
+ const second = $0 & 0x3f;
+ const date = new Date(year, month - 1, day, hour, minute, second);
+ return date - Date.now();
+ }, date_time.reg);
+}
+
+watch_date_time watch_rtc_get_date_time(void) {
+ watch_date_time retval;
+ retval.reg = EM_ASM_INT({
+ const date = new Date(Date.now() + $0);
+ return date.getSeconds() |
+ (date.getMinutes() << 6) |
+ (date.getHours() << 12) |
+ (date.getDate() << 17) |
+ ((date.getMonth() + 1) << 22) |
+ ((date.getFullYear() - 2020) << 26);
+ }, time_offset);
+ return retval;
+}
+
+void watch_rtc_register_tick_callback(ext_irq_cb_t callback) {
+ watch_rtc_register_periodic_callback(callback, 1);
+}
+
+void watch_rtc_disable_tick_callback(void) {
+ watch_rtc_disable_periodic_callback(1);
+}
+
+static void watch_invoke_periodic_callback(void *userData) {
+ ext_irq_cb_t callback = userData;
+ callback();
+
+ void resume_main_loop(void);
+ resume_main_loop();
+}
+
+void watch_rtc_register_periodic_callback(ext_irq_cb_t callback, uint8_t frequency) {
+ // we told them, it has to be a power of 2.
+ if (__builtin_popcount(frequency) != 1) return;
+
+ // this left-justifies the period in a 32-bit integer.
+ uint32_t tmp = frequency << 24;
+ // now we can count the leading zeroes to get the value we need.
+ // 0x01 (1 Hz) will have 7 leading zeros for PER7. 0xF0 (128 Hz) will have no leading zeroes for PER0.
+ uint8_t per_n = __builtin_clz(tmp);
+
+ // this also maps nicely to an index for our list of tick callbacks.
+ double interval = 1000 / frequency; // in msec
+ tick_callbacks[per_n] = emscripten_set_interval(watch_invoke_periodic_callback, interval, (void *)callback);
+}
+
+void watch_rtc_disable_periodic_callback(uint8_t frequency) {
+ if (__builtin_popcount(frequency) != 1) return;
+ uint8_t per_n = __builtin_clz(frequency << 24);
+ emscripten_clear_interval(tick_callbacks[per_n]);
+ tick_callbacks[per_n] = 0;
+}
+
+void watch_rtc_disable_all_periodic_callbacks(void) {
+ for (int i = 0; i < 8; i++) {
+ if (tick_callbacks[i] != 0) {
+ emscripten_clear_interval(tick_callbacks[i]);
+ tick_callbacks[i] = 0;
+ }
+ }
+}
+
+static void watch_invoke_alarm_interval_callback(void *userData) {
+ (void)userData;
+ if (alarm_callback) alarm_callback();
+}
+
+static void watch_invoke_alarm_callback(void *userData) {
+ (void)userData;
+ if (alarm_callback) alarm_callback();
+ alarm_interval_id = emscripten_set_interval(watch_invoke_alarm_interval_callback, alarm_interval, NULL);
+}
+
+void watch_rtc_register_alarm_callback(ext_irq_cb_t callback, watch_date_time alarm_time, watch_rtc_alarm_match mask) {
+ watch_rtc_disable_alarm_callback();
+
+ switch (mask) {
+ case ALARM_MATCH_DISABLED:
+ return;
+ case ALARM_MATCH_SS:
+ alarm_interval = 60 * 1000;
+ break;
+ case ALARM_MATCH_MMSS:
+ alarm_interval = 60 * 60 * 1000;
+ break;
+ case ALARM_MATCH_HHMMSS:
+ alarm_interval = 60 * 60 * 60 * 1000;
+ break;
+ }
+
+ double timeout = EM_ASM_DOUBLE({
+ const now = Date.now();
+ const date = new Date(now + $0);
+
+ const hour = ($1 >> 12) & 0x1f;
+ const minute = ($1 >> 6) & 0x3f;
+ const second = $1 & 0x3f;
+
+ if ($2 == 1) { // SS
+ if (second < date.getSeconds()) date.setMinutes(date.getMinutes() + 1);
+ date.setSeconds(second);
+ } else if ($2 == 2) { // MMSS
+ if (second < date.getSeconds()) date.setMinutes(date.getMinutes() + 1);
+ if (minute < date.getMinutes()) date.setHours(date.getHours() + 1);
+ date.setMinutes(minute, second);
+ } else if ($2 == 3) { // HHMMSS
+ if (second < date.getSeconds()) date.setMinutes(date.getMinutes() + 1);
+ if (minute < date.getMinutes()) date.setHours(date.getHours() + 1);
+ if (hour < date.getHours()) date.setDate(date.getDate() + 1);
+ date.setHours(hour, minute, second);
+ } else {
+ throw 'Invalid alarm match mask';
+ }
+
+ return date - now;
+ }, time_offset, alarm_time.reg, mask);
+
+ alarm_callback = callback;
+ alarm_timeout_id = emscripten_set_timeout(watch_invoke_alarm_callback, timeout, NULL);
+}
+
+void watch_rtc_disable_alarm_callback(void) {
+ alarm_callback = NULL;
+ alarm_interval = 0;
+
+ if (alarm_timeout_id) {
+ emscripten_clear_timeout(alarm_timeout_id);
+ alarm_timeout_id = 0;
+ }
+
+ if (alarm_interval_id) {
+ emscripten_clear_interval(alarm_interval_id);
+ alarm_interval_id = 0;
+ }
+}
+
+///////////////////////
+// Deprecated functions
+
+void watch_set_date_time(struct calendar_date_time date_time) {
+ watch_date_time val;
+ val.unit.second = date_time.time.sec;
+ val.unit.minute = date_time.time.min;
+ val.unit.hour = date_time.time.hour;
+ val.unit.day = date_time.date.day;
+ val.unit.month = date_time.date.month;
+ val.unit.year = date_time.date.year - WATCH_RTC_REFERENCE_YEAR;
+ watch_rtc_set_date_time(val);
+}
+
+void watch_get_date_time(struct calendar_date_time *date_time) {
+ if (date_time == NULL) return;
+ watch_date_time val = watch_rtc_get_date_time();
+ date_time->time.sec = val.unit.second;
+ date_time->time.min = val.unit.minute;
+ date_time->time.hour = val.unit.hour;
+ date_time->date.day = val.unit.day;
+ date_time->date.month = val.unit.month;
+ date_time->date.year = val.unit.year + WATCH_RTC_REFERENCE_YEAR;
+}
+
+void watch_register_tick_callback(ext_irq_cb_t callback) {
+ watch_rtc_register_tick_callback(callback);
+}
diff --git a/watch-library/simulator/watch/watch_slcd.c b/watch-library/simulator/watch/watch_slcd.c
new file mode 100644
index 00000000..2af96847
--- /dev/null
+++ b/watch-library/simulator/watch/watch_slcd.c
@@ -0,0 +1,115 @@
+/*
+ * MIT License
+ *
+ * Copyright (c) 2020 Joey Castillo
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include "watch_slcd.h"
+#include "watch_private_display.h"
+#include "hpl_slcd_config.h"
+
+#include <emscripten.h>
+#include <emscripten/html5.h>
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// Segmented Display
+
+static char blink_character;
+static bool blink_state;
+static long blink_interval_id;
+static bool tick_state;
+static long tick_interval_id;
+
+void watch_enable_display(void) {
+ watch_clear_display();
+}
+
+void watch_set_pixel(uint8_t com, uint8_t seg) {
+ EM_ASM({
+ document.querySelectorAll("[data-com='" + $0 + "'][data-seg='" + $1 + "']")
+ .forEach((e) => e.style.opacity = 1);
+ }, com, seg);
+}
+
+void watch_clear_pixel(uint8_t com, uint8_t seg) {
+ EM_ASM({
+ document.querySelectorAll("[data-com='" + $0 + "'][data-seg='" + $1 + "']")
+ .forEach((e) => e.style.opacity = 0);
+ }, com, seg);
+}
+
+void watch_clear_display(void) {
+ EM_ASM({
+ document.querySelectorAll("[data-com][data-seg]")
+ .forEach((e) => e.style.opacity = 0);
+ });
+}
+
+static void watch_invoke_blink_callback(void *userData) {
+ blink_state = !blink_state;
+ watch_display_character(blink_state ? blink_character : ' ', 7);
+ watch_clear_pixel(2, 10); // clear segment B of position 7 since it can't blink
+}
+
+void watch_start_character_blink(char character, uint32_t duration) {
+ watch_display_character(character, 7);
+ watch_clear_pixel(2, 10); // clear segment B of position 7 since it can't blink
+
+ blink_state = true;
+ blink_character = character;
+ blink_interval_id = emscripten_set_interval(watch_invoke_blink_callback, (double)duration, NULL);
+}
+
+void watch_stop_blink(void) {
+ emscripten_clear_timeout(blink_interval_id);
+ blink_interval_id = 0;
+ blink_state = false;
+}
+
+static void watch_invoke_tick_callback(void *userData) {
+ tick_state = !tick_state;
+ if (tick_state) {
+ watch_clear_pixel(0, 2);
+ watch_set_pixel(0, 3);
+ } else {
+ watch_clear_pixel(0, 3);
+ watch_set_pixel(0, 2);
+ }
+}
+
+void watch_start_tick_animation(uint32_t duration) {
+ watch_display_character(' ', 8);
+
+ tick_state = true;
+ tick_interval_id = emscripten_set_interval(watch_invoke_tick_callback, (double)duration, NULL);
+}
+
+bool watch_tick_animation_is_running(void) {
+ return tick_interval_id != 0;
+}
+
+void watch_stop_tick_animation(void) {
+ emscripten_clear_timeout(tick_interval_id);
+ tick_interval_id = 0;
+ tick_state = false;
+
+ watch_display_character(' ', 8);
+}
diff --git a/watch-library/simulator/watch/watch_uart.c b/watch-library/simulator/watch/watch_uart.c
new file mode 100644
index 00000000..e37fabff
--- /dev/null
+++ b/watch-library/simulator/watch/watch_uart.c
@@ -0,0 +1,65 @@
+/*
+ * MIT License
+ *
+ * Copyright (c) 2020 Joey Castillo
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+ /*
+ * UART methods are Copyright (c) 2014-2017, Alex Taradov <alex@taradov.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "watch_uart.h"
+#include "peripheral_clk_config.h"
+
+void watch_enable_debug_uart(uint32_t baud) {}
+
+void watch_debug_putc(char c) {}
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+void watch_debug_puts(char *s) {
+ while (*s) watch_debug_putc(*s++);
+}
+#pragma GCC diagnostic pop
diff --git a/watch-library/watch/watch_slcd.c b/watch-library/watch/watch_slcd.c
deleted file mode 100644
index 1b1e53e4..00000000
--- a/watch-library/watch/watch_slcd.c
+++ /dev/null
@@ -1,318 +0,0 @@
-/*
- * MIT License
- *
- * Copyright (c) 2020 Joey Castillo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include "watch_slcd.h"
-#include "hpl_slcd_config.h"
-
- //////////////////////////////////////////////////////////////////////////////////////////
-// Segmented Display
-
-static const uint8_t Character_Set[] =
-{
- 0b00000000, //
- 0b01100000, // ! (L in the top half for positions 4 and 6)
- 0b00100010, // "
- 0b01100011, // # (degree symbol, hash mark doesn't fit)
- 0b00000000, // $ (unused)
- 0b00000000, // % (unused)
- 0b01000100, // & ("lowercase 7" for positions 4 and 6)
- 0b00100000, // '
- 0b00111001, // (
- 0b00001111, // )
- 0b00000000, // * (unused)
- 0b11000000, // + (only works in position 0)
- 0b00000100, // ,
- 0b01000000, // -
- 0b01000000, // . (same as -, semantically most useful)
- 0b00010010, // /
- 0b00111111, // 0
- 0b00000110, // 1
- 0b01011011, // 2
- 0b01001111, // 3
- 0b01100110, // 4
- 0b01101101, // 5
- 0b01111101, // 6
- 0b00000111, // 7
- 0b01111111, // 8
- 0b01101111, // 9
- 0b00000000, // : (unused)
- 0b00000000, // ; (unused)
- 0b01011000, // <
- 0b01001000, // =
- 0b01001100, // >
- 0b01010011, // ?
- 0b11111111, // @ (all segments on)
- 0b01110111, // A
- 0b01111111, // B
- 0b00111001, // C
- 0b00111111, // D
- 0b01111001, // E
- 0b01110001, // F
- 0b00111101, // G
- 0b01110110, // H
- 0b10001001, // I (only works in position 0)
- 0b00001110, // J
- 0b01110101, // K
- 0b00111000, // L
- 0b10110111, // M (only works in position 0)
- 0b00110111, // N
- 0b00111111, // O
- 0b01110011, // P
- 0b01100111, // Q
- 0b11110111, // R (only works in position 1)
- 0b01101101, // S
- 0b10000001, // T (only works in position 0; set (1, 12) to make it work in position 1)
- 0b00111110, // U
- 0b00111110, // V
- 0b10111110, // W (only works in position 0)
- 0b01111110, // X
- 0b01101110, // Y
- 0b00011011, // Z
- 0b00111001, // [
- 0b00100100, // backslash
- 0b00001111, // ]
- 0b00100011, // ^
- 0b00001000, // _
- 0b00000010, // `
- 0b01011111, // a
- 0b01111100, // b
- 0b01011000, // c
- 0b01011110, // d
- 0b01111011, // e
- 0b01110001, // f
- 0b01101111, // g
- 0b01110100, // h
- 0b00010000, // i
- 0b01000010, // j (appears as superscript to work in more positions)
- 0b01110101, // k
- 0b00110000, // l
- 0b10110111, // m (only works in position 0)
- 0b01010100, // n
- 0b01011100, // o
- 0b01110011, // p
- 0b01100111, // q
- 0b01010000, // r
- 0b01101101, // s
- 0b01111000, // t
- 0b01100010, // u (appears in (u)pper half to work in more positions)
- 0b00011100, // v (looks like u but in the lower half)
- 0b10111110, // w (only works in position 0)
- 0b01111110, // x
- 0b01101110, // y
- 0b00011011, // z
- 0b00111001, // {
- 0b00110000, // |
- 0b00001111, // }
- 0b00000001, // ~
-};
-
-static const uint64_t Segment_Map[] = {
- 0x4e4f0e8e8f8d4d0d, // Position 0, mode
- 0xc8c4c4c8b4b4b0b, // Position 1, mode (Segments B and C shared, as are segments E and F)
- 0xc049c00a49890949, // Position 2, day of month (Segments A, D, G shared; missing segment F)
- 0xc048088886874707, // Position 3, day of month
- 0xc053921252139352, // Position 4, clock hours (Segments A and D shared)
- 0xc054511415559594, // Position 5, clock hours
- 0xc057965616179716, // Position 6, clock minutes (Segments A and D shared)
- 0xc041804000018a81, // Position 7, clock minutes
- 0xc043420203048382, // Position 8, clock seconds
- 0xc045440506468584, // Position 9, clock seconds
-};
-
-static const uint8_t Num_Chars = 10;
-
-static const uint32_t IndicatorSegments[6] = {
- SLCD_SEGID(0, 17), // WATCH_INDICATOR_SIGNAL
- SLCD_SEGID(0, 16), // WATCH_INDICATOR_BELL
- SLCD_SEGID(2, 17), // WATCH_INDICATOR_PM
- SLCD_SEGID(2, 16), // WATCH_INDICATOR_24H
- SLCD_SEGID(1, 10), // WATCH_INDICATOR_LAP
-};
-
-static void _sync_slcd(void) {
- while (SLCD->SYNCBUSY.reg);
-}
-
-void watch_enable_display(void) {
- SEGMENT_LCD_0_init();
- slcd_sync_enable(&SEGMENT_LCD_0);
-}
-
-inline void watch_set_pixel(uint8_t com, uint8_t seg) {
- slcd_sync_seg_on(&SEGMENT_LCD_0, SLCD_SEGID(com, seg));
-}
-
-inline void watch_clear_pixel(uint8_t com, uint8_t seg) {
- slcd_sync_seg_off(&SEGMENT_LCD_0, SLCD_SEGID(com, seg));
-}
-
-void watch_clear_display(void) {
- SLCD->SDATAL0.reg = 0;
- SLCD->SDATAL1.reg = 0;
- SLCD->SDATAL2.reg = 0;
-}
-
-static void watch_display_character(uint8_t character, uint8_t position) {
- // special cases for positions 4 and 6
- if (position == 4 || position == 6) {
- if (character == '7') character = '&'; // "lowercase" 7
- else if (character == 'A') character = 'a'; // A needs to be lowercase
- else if (character == 'o') character = 'O'; // O needs to be uppercase
- else if (character == 'L') character = '!'; // L needs to be in top half
- else if (character == 'M' || character == 'm' || character == 'N') character = 'n'; // M and uppercase N need to be lowercase n
- else if (character == 'c') character = 'C'; // C needs to be uppercase
- else if (character == 'J') character = 'j'; // same
- else if (character == 'v' || character == 'V' || character == 'U' || character == 'W' || character == 'w') character = 'u'; // bottom segment duplicated, so show in top half
- } else {
- if (character == 'u') character = 'v'; // we can use the bottom segment; move to lower half
- else if (character == 'j') character = 'J'; // same but just display a normal J
- }
- if (position > 1) {
- if (character == 'T') character = 't'; // uppercase T only works in positions 0 and 1
- }
- if (position == 1) {
- if (character == 'o') character = 'O'; // O needs to be uppercase
- if (character == 'i') character = 'l'; // I needs to be uppercase (use an l, it looks the same)
- if (character == 'n') character = 'N'; // N needs to be uppercase
- if (character == 'r') character = 'R'; // R needs to be uppercase
- if (character == 'd') character = 'D'; // D needs to be uppercase
- if (character == 'v' || character == 'V' || character == 'u') character = 'U'; // side segments shared, make uppercase
- if (character == 'b') character = 'B'; // B needs to be uppercase
- if (character == 'c') character = 'C'; // C needs to be uppercase
- } else {
- if (character == 'R') character = 'r'; // R needs to be lowercase almost everywhere
- }
- if (position == 0) {
- slcd_sync_seg_off(&SEGMENT_LCD_0, SLCD_SEGID(0, 15)); // clear funky ninth segment
- } else {
- if (character == 'I') character = 'l'; // uppercase I only works in position 0
- }
-
- uint64_t segmap = Segment_Map[position];
- uint64_t segdata = Character_Set[character - 0x20];
-
- for (int i = 0; i < 8; i++) {
- uint8_t com = (segmap & 0xFF) >> 6;
- if (com > 2) {
- // COM3 means no segment exists; skip it.
- segmap = segmap >> 8;
- segdata = segdata >> 1;
- continue;
- }
- uint8_t seg = segmap & 0x3F;
- slcd_sync_seg_off(&SEGMENT_LCD_0, SLCD_SEGID(com, seg));
- if (segdata & 1) slcd_sync_seg_on(&SEGMENT_LCD_0, SLCD_SEGID(com, seg));
- segmap = segmap >> 8;
- segdata = segdata >> 1;
- }
- if (character == 'T' && position == 1) slcd_sync_seg_on(&SEGMENT_LCD_0, SLCD_SEGID(1, 12)); // add descender
- else if (position == 0 && (character == 'B' || character == 'D')) slcd_sync_seg_on(&SEGMENT_LCD_0, SLCD_SEGID(0, 15)); // add funky ninth segment
- else if (position == 1 && (character == 'B' || character == 'D' || character == '@')) slcd_sync_seg_on(&SEGMENT_LCD_0, SLCD_SEGID(0, 12)); // add funky ninth segment
-}
-
-void watch_display_string(char *string, uint8_t position) {
- size_t i = 0;
- while(string[i] != 0) {
- watch_display_character(string[i], position + i);
- i++;
- if (position + i >= Num_Chars) break;
- }
- // uncomment this line to see screen output on terminal, i.e.
- // FR 29
- // 11 50 23
- // note that for partial displays (positon > 0) it will only show the characters that were updated.
- // printf("________\n %c%c %c%c\n%c%c %c%c %c%c\n--------\n", (position > 0) ? ' ' : string[0], (position > 1) ? ' ' : string[1 - position], (position > 2) ? ' ' : string[2 - position], (position > 3) ? ' ' : string[3 - position], (position > 4) ? ' ' : string[4 - position], (position > 5) ? ' ' : string[5 - position], (position > 6) ? ' ' : string[6 - position], (position > 7) ? ' ' : string[7 - position], (position > 8) ? ' ' : string[8 - position], (position > 9) ? ' ' : string[9 - position]);
-}
-
-inline void watch_set_colon(void) {
- slcd_sync_seg_on(&SEGMENT_LCD_0, SLCD_SEGID(1, 16));
-}
-
-inline void watch_clear_colon(void) {
- slcd_sync_seg_off(&SEGMENT_LCD_0, SLCD_SEGID(1, 16));
-}
-
-inline void watch_set_indicator(WatchIndicatorSegment indicator) {
- slcd_sync_seg_on(&SEGMENT_LCD_0, IndicatorSegments[indicator]);
-}
-
-inline void watch_clear_indicator(WatchIndicatorSegment indicator) {
- slcd_sync_seg_off(&SEGMENT_LCD_0, IndicatorSegments[indicator]);
-}
-
-void watch_clear_all_indicators(void) {
- slcd_sync_seg_off(&SEGMENT_LCD_0, SLCD_SEGID(2, 17));
- slcd_sync_seg_off(&SEGMENT_LCD_0, SLCD_SEGID(2, 16));
- slcd_sync_seg_off(&SEGMENT_LCD_0, SLCD_SEGID(0, 17));
- slcd_sync_seg_off(&SEGMENT_LCD_0, SLCD_SEGID(0, 16));
- slcd_sync_seg_off(&SEGMENT_LCD_0, SLCD_SEGID(1, 10));
-}
-
-void watch_start_character_blink(char character, uint32_t duration) {
- SLCD->CTRLD.bit.FC0EN = 0;
- _sync_slcd();
-
- if (duration <= SLCD_FC_BYPASS_MAX_MS) {
- SLCD->FC0.reg = SLCD_FC0_PB | ((duration / (1000 / SLCD_FRAME_FREQUENCY)) - 1);
- } else {
- SLCD->FC0.reg = (((duration / (1000 / SLCD_FRAME_FREQUENCY)) / 8 - 1));
- }
- SLCD->CTRLD.bit.FC0EN = 1;
-
- watch_display_character(character, 7);
- watch_clear_pixel(2, 10); // clear segment B of position 7 since it can't blink
-
- SLCD->CTRLD.bit.BLINK = 0;
- SLCD->CTRLA.bit.ENABLE = 0;
- _sync_slcd();
-
- SLCD->BCFG.bit.BSS0 = 0x07;
- SLCD->BCFG.bit.BSS1 = 0x07;
-
- SLCD->CTRLD.bit.BLINK = 1;
- _sync_slcd();
- SLCD->CTRLA.bit.ENABLE = 1;
- _sync_slcd();
-}
-
-void watch_stop_blink(void) {
- SLCD->CTRLD.bit.FC0EN = 0;
- SLCD->CTRLD.bit.BLINK = 0;
-}
-
-void watch_start_tick_animation(uint32_t duration) {
- watch_display_character(' ', 8);
- const uint32_t segs[] = { SLCD_SEGID(0, 2)};
- slcd_sync_start_animation(&SEGMENT_LCD_0, segs, 1, duration);
-}
-
-bool watch_tick_animation_is_running(void) {
- return hri_slcd_get_CTRLD_CSREN_bit(SLCD);
-}
-
-void watch_stop_tick_animation(void) {
- const uint32_t segs[] = { SLCD_SEGID(0, 2)};
- slcd_sync_stop_animation(&SEGMENT_LCD_0, segs, 1);
- watch_display_character(' ', 8);
-}