diff --git a/Apps/System/menu.c b/Apps/System/menu.c index 9cc3a406..54e380ad 100644 --- a/Apps/System/menu.c +++ b/Apps/System/menu.c @@ -6,8 +6,7 @@ * * Author: Barry Carter . */ - -#include "rebbleos.h" +#include "display.h" #include "menu.h" static list_head _res_list_head = LIST_HEAD(_res_list_head); diff --git a/Apps/System/notification.c b/Apps/System/notification.c index 4be4f230..7f71ef10 100644 --- a/Apps/System/notification.c +++ b/Apps/System/notification.c @@ -5,8 +5,7 @@ * Author: Carson Katri * Barry Carter */ - -#include "rebbleos.h" +#include "display.h" #include "notification.h" #include "single_notification_layer.h" #include "librebble.h" diff --git a/Apps/System/notification.h b/Apps/System/notification.h index bfe7bc24..ab088dae 100644 --- a/Apps/System/notification.h +++ b/Apps/System/notification.h @@ -6,7 +6,6 @@ * Author: Carson Katri . */ -#include "rebbleos.h" #include "librebble.h" #include "display.h" #include "backlight.h" diff --git a/Apps/System/settings.c b/Apps/System/settings.c index 3630f65d..17912653 100644 --- a/Apps/System/settings.c +++ b/Apps/System/settings.c @@ -5,7 +5,6 @@ * Author: Joshua Wise */ -#include "rebbleos.h" #include "menu.h" #include "status_bar_layer.h" #include "action_bar_layer.h" diff --git a/Apps/System/settings_tz.c b/Apps/System/settings_tz.c index 718df294..8ebba279 100644 --- a/Apps/System/settings_tz.c +++ b/Apps/System/settings_tz.c @@ -5,7 +5,6 @@ * Author: Joshua Wise */ -#include "rebbleos.h" #include "menu.h" #include "status_bar_layer.h" #include "action_bar_layer.h" diff --git a/Apps/System/systemapp.c b/Apps/System/systemapp.c index 80f35f04..f074feb2 100644 --- a/Apps/System/systemapp.c +++ b/Apps/System/systemapp.c @@ -4,8 +4,7 @@ * * Author: Barry Carter */ - -#include "rebbleos.h" +#include "display.h" #include "systemapp.h" #include "menu.h" #include "status_bar_layer.h" diff --git a/Apps/System/testapp.c b/Apps/System/testapp.c index cc251a7f..37b6c4ae 100644 --- a/Apps/System/testapp.c +++ b/Apps/System/testapp.c @@ -5,8 +5,7 @@ * * Author: Barry Carter */ - -#include "rebbleos.h" +#include "display.h" #include "menu.h" #include "status_bar_layer.h" #include "test_defs.h" @@ -14,7 +13,7 @@ static Window *s_main_window; static Menu *s_menu; -StatusBarLayer *status_bar; +static StatusBarLayer *status_bar; static void testapp_exec_window_unload(Window *window); static void _reset_menu_items(void); diff --git a/Apps/System/tests/color_test.c b/Apps/System/tests/color_test.c index 0944419c..778861c8 100644 --- a/Apps/System/tests/color_test.c +++ b/Apps/System/tests/color_test.c @@ -4,7 +4,7 @@ * * Author: Author: Chris Multhaupt . */ -#include "rebbleos.h" +#include "display.h" #include "systemapp.h" #include "menu.h" #include "status_bar_layer.h" diff --git a/Apps/System/tests/overlay_test.c b/Apps/System/tests/overlay_test.c index 590a47bb..49739457 100644 --- a/Apps/System/tests/overlay_test.c +++ b/Apps/System/tests/overlay_test.c @@ -4,8 +4,7 @@ * * Author: Barry Carter . */ - -#include "rebbleos.h" +#include "display.h" #include "systemapp.h" #include "menu.h" #include "status_bar_layer.h" diff --git a/Apps/System/tests/test_test.c b/Apps/System/tests/test_test.c index d2c4b5be..30d96b07 100644 --- a/Apps/System/tests/test_test.c +++ b/Apps/System/tests/test_test.c @@ -1,4 +1,4 @@ -#include "rebbleos.h" +#include "display.h" #include "systemapp.h" #include "menu.h" #include "status_bar_layer.h" diff --git a/Apps/System/tests/vibes_test.c b/Apps/System/tests/vibes_test.c index dca97a08..5e07bd28 100644 --- a/Apps/System/tests/vibes_test.c +++ b/Apps/System/tests/vibes_test.c @@ -4,8 +4,7 @@ * * Author: Author: Elliot Hawkins . */ - -#include "rebbleos.h" +#include "display.h" #include "systemapp.h" #include "menu.h" #include "status_bar_layer.h" diff --git a/Apps/System/widgettest.c b/Apps/System/widgettest.c index a3ce1cb6..5c501216 100644 --- a/Apps/System/widgettest.c +++ b/Apps/System/widgettest.c @@ -4,8 +4,7 @@ * * Author: Carson Katri */ - -#include "rebbleos.h" +#include "display.h" #include "test.h" #include "librebble.h" #include "bitmap_layer.h" @@ -18,7 +17,7 @@ const char * const test_name = "Test"; static Window *s_main_window; ActionBarLayer *action_bar; -StatusBarLayer *status_bar; +static StatusBarLayer *status_bar; typedef struct { uint8_t hours; diff --git a/hw/chip/nrf52840/debug.c b/hw/chip/nrf52840/debug.c index 3591396f..5131a033 100644 --- a/hw/chip/nrf52840/debug.c +++ b/hw/chip/nrf52840/debug.c @@ -6,7 +6,6 @@ */ #include -#include "rebbleos.h" #include "nrf_delay.h" #include "nrfx_uart.h" #include "board_config.h" diff --git a/hw/chip/nrf52840/fault_handlers.c b/hw/chip/nrf52840/fault_handlers.c index fe86fdfa..e8e7d9e9 100644 --- a/hw/chip/nrf52840/fault_handlers.c +++ b/hw/chip/nrf52840/fault_handlers.c @@ -6,8 +6,11 @@ * Author: Joshua Wise */ +#include +#include #include "debug.h" -#include "rebbleos.h" + +typedef uint32_t ret_code_t; struct { uint32_t r4, r5, r6, r7, r8, r9, r10, r11, r13; diff --git a/hw/drivers/nrf52_bluetooth/nrf52_bluetooth.c b/hw/drivers/nrf52_bluetooth/nrf52_bluetooth.c index 1e613bfc..3e964e5e 100644 --- a/hw/drivers/nrf52_bluetooth/nrf52_bluetooth.c +++ b/hw/drivers/nrf52_bluetooth/nrf52_bluetooth.c @@ -6,8 +6,10 @@ */ #include -#include "rebbleos.h" +#include +#include "log.h" #include "service.h" +#include "rbl_bluetooth.h" #include "nrf_sdh.h" #include "nrf_sdh_ble.h" #include "nrf_ble_gatt.h" diff --git a/hw/drivers/nrf52_bluetooth/nrf52_bluetooth_ppogatt.c b/hw/drivers/nrf52_bluetooth/nrf52_bluetooth_ppogatt.c index a5dd5647..beb2b65d 100644 --- a/hw/drivers/nrf52_bluetooth/nrf52_bluetooth_ppogatt.c +++ b/hw/drivers/nrf52_bluetooth/nrf52_bluetooth_ppogatt.c @@ -4,9 +4,10 @@ * * Author: Joshua Wise */ - +#define BLUETOOTH_IS_BLE 1 #include -#include "rebbleos.h" +#include "log.h" +#include "rbl_bluetooth.h" #include "nrf_sdh.h" #include "nrf_sdh_ble.h" #include "nrf_ble_gatt.h" diff --git a/hw/drivers/nrf52_ls013b7dh05/nrf52_ls013b7dh05.c b/hw/drivers/nrf52_ls013b7dh05/nrf52_ls013b7dh05.c index 3a5a6ca6..89676986 100644 --- a/hw/drivers/nrf52_ls013b7dh05/nrf52_ls013b7dh05.c +++ b/hw/drivers/nrf52_ls013b7dh05/nrf52_ls013b7dh05.c @@ -5,7 +5,9 @@ * Author: Joshua Wise */ -#include "rebbleos.h" +#include +#include "FreeRTOSConfig.h" +#include "log.h" #include "nrfx_spim.h" #include "nrf_gpio.h" #include "board_config.h" diff --git a/hw/drivers/nrf52_qspi_flash/nrf52_qspi_flash.c b/hw/drivers/nrf52_qspi_flash/nrf52_qspi_flash.c index 5920fb0a..76ffd64f 100644 --- a/hw/drivers/nrf52_qspi_flash/nrf52_qspi_flash.c +++ b/hw/drivers/nrf52_qspi_flash/nrf52_qspi_flash.c @@ -5,8 +5,10 @@ * Author: Joshua Wise */ +#include "FreeRTOSConfig.h" +#include "log.h" +#include "platform.h" #include -#include "rebbleos.h" #include "nrfx_qspi.h" /* Asterix has 128Mbit (16MB) of QSPI flash -- a W25Q128JV. */ diff --git a/hw/drivers/stm32_bluetooth_cc256x/btstack_rebble.c b/hw/drivers/stm32_bluetooth_cc256x/btstack_rebble.c index 0bbf5ef9..c0d7e4fd 100644 --- a/hw/drivers/stm32_bluetooth_cc256x/btstack_rebble.c +++ b/hw/drivers/stm32_bluetooth_cc256x/btstack_rebble.c @@ -8,7 +8,8 @@ #include "btstack_rebble.h" #include "btstack_chipset_cc256x.h" #include "hal_uart_dma.h" -#include "rebbleos.h" +#include "main.h" +#include "init.h" #include "btstack_spp.h" #include "hal_time_ms.h" #include "rbl_bluetooth.h" diff --git a/hw/platform/asterix/asterix.c b/hw/platform/asterix/asterix.c index 56a6b501..a7627283 100644 --- a/hw/platform/asterix/asterix.c +++ b/hw/platform/asterix/asterix.c @@ -6,7 +6,8 @@ */ #include -#include "rebbleos.h" +#include "FreeRTOSConfig.h" +#include "rebble_time.h" #include "nrf_delay.h" #include "nrfx_uart.h" #include "nrfx_twi.h" diff --git a/hw/platform/chalk/chalk_bluetooth.c b/hw/platform/chalk/chalk_bluetooth.c index e80f5509..1666cca6 100644 --- a/hw/platform/chalk/chalk_bluetooth.c +++ b/hw/platform/chalk/chalk_bluetooth.c @@ -1,4 +1,5 @@ -#include "rebbleos.h" +#include "rbl_bluetooth.h" +#include "init.h" /* * NOT IMPLEMENTED diff --git a/hw/platform/qemu/hw_qemu.c b/hw/platform/qemu/hw_qemu.c index 30de34f5..27c17dde 100644 --- a/hw/platform/qemu/hw_qemu.c +++ b/hw/platform/qemu/hw_qemu.c @@ -3,7 +3,6 @@ #include "hw_qemu.h" #include "stm32_usart.h" #include "stm32_power.h" -#include "rebbleos.h" void _hw_qemu_rx(void); diff --git a/hw/platform/tintin/tintin.c b/hw/platform/tintin/tintin.c index c36052d8..3eb96885 100644 --- a/hw/platform/tintin/tintin.c +++ b/hw/platform/tintin/tintin.c @@ -16,7 +16,6 @@ #include #include #include -#include "rebbleos.h" #include "stm32_usart.h" #include "stm32_power.h" diff --git a/hw/platform/tintin/tintin_bluetooth.c b/hw/platform/tintin/tintin_bluetooth.c index 1bdf10ba..f7f24bcc 100644 --- a/hw/platform/tintin/tintin_bluetooth.c +++ b/hw/platform/tintin/tintin_bluetooth.c @@ -16,7 +16,6 @@ #include #include #include -#include "rebbleos.h" #include "stm32_dma.h" #include "stm32_usart.h" diff --git a/hw/platform/tintin/tintin_display.c b/hw/platform/tintin/tintin_display.c index dbbd65a6..511303de 100644 --- a/hw/platform/tintin/tintin_display.c +++ b/hw/platform/tintin/tintin_display.c @@ -16,7 +16,6 @@ #include #include #include -#include "rebbleos.h" #include "stm32_power.h" #include "stm32_spi.h" diff --git a/hw/platform/tintin/tintin_flash.c b/hw/platform/tintin/tintin_flash.c index 0800fb39..79c5af32 100644 --- a/hw/platform/tintin/tintin_flash.c +++ b/hw/platform/tintin/tintin_flash.c @@ -15,7 +15,6 @@ #include #include #include -#include "rebbleos.h" #include "stm32_power.h" #include "stm32_spi.h" diff --git a/rcore/api_func_symbols.h b/rcore/api_func_symbols.h index 546e8459..fb2c18bf 100644 --- a/rcore/api_func_symbols.h +++ b/rcore/api_func_symbols.h @@ -1,5 +1,4 @@ #include "common.h" -#include "rebbleos.h" #include "librebble.h" #include "graphics_wrapper.h" #include "libros_graphics.h" diff --git a/rcore/appmanager.c b/rcore/appmanager.c index 9f049a6e..060cb65d 100644 --- a/rcore/appmanager.c +++ b/rcore/appmanager.c @@ -6,9 +6,11 @@ * * Author: Barry Carter . */ - +#include "rebble_memory.h" #include #include "appmanager_thread.h" +#include "display.h" +#include "librebble.h" #include "appmanager.h" #include "systemapp.h" diff --git a/rcore/appmanager_app.c b/rcore/appmanager_app.c index 6f8c8310..293535e0 100644 --- a/rcore/appmanager_app.c +++ b/rcore/appmanager_app.c @@ -7,7 +7,7 @@ */ #include -#include "rebbleos.h" +#include "display.h" #include "appmanager.h" #include "systemapp.h" #include "widgettest.h" diff --git a/rcore/appmanager_app_api.c b/rcore/appmanager_app_api.c index a929845d..a9dc90e7 100644 --- a/rcore/appmanager_app_api.c +++ b/rcore/appmanager_app_api.c @@ -6,8 +6,9 @@ */ #include -#include "rebbleos.h" +#include "display.h" #include "appmanager.h" +#include "main.h" #include "overlay_manager.h" #include "protocol.h" #include "protocol_music.h" diff --git a/rcore/appmanager_app_runloop.c b/rcore/appmanager_app_runloop.c index 94db641a..bac028d3 100644 --- a/rcore/appmanager_app_runloop.c +++ b/rcore/appmanager_app_runloop.c @@ -6,14 +6,16 @@ */ #include -#include "rebbleos.h" +#include "display.h" #include "appmanager.h" +#include "main.h" #include "overlay_manager.h" #include "notification_manager.h" #include "timers.h" #include "ngfxwrap.h" #include "event_service.h" + /* Configure Logging */ #define MODULE_NAME "apploop" #define MODULE_TYPE "APLOOP" diff --git a/rcore/appmanager_app_timer.c b/rcore/appmanager_app_timer.c index 912a57f1..44cf1930 100644 --- a/rcore/appmanager_app_timer.c +++ b/rcore/appmanager_app_timer.c @@ -7,8 +7,9 @@ */ #include -#include "rebbleos.h" +#include "display.h" #include "appmanager.h" +#include "main.h" #include "overlay_manager.h" #include "notification_manager.h" diff --git a/rcore/bluetooth.c b/rcore/bluetooth.c index 89ce968f..7bd725fd 100644 --- a/rcore/bluetooth.c +++ b/rcore/bluetooth.c @@ -24,6 +24,7 @@ */ #include "FreeRTOS.h" +#include "librebble.h" #include "task.h" /* xTaskCreate */ #include "timers.h" /* xTimerCreate */ #include "queue.h" /* xQueueCreate */ @@ -32,7 +33,7 @@ #include "backlight.h" #include "ambient.h" #include "rebble_memory.h" -#include "rebbleos.h" +#include "init.h" #include "rbl_bluetooth.h" #include "pebble_protocol.h" #include "stdarg.h" @@ -41,6 +42,7 @@ #include "protocol_service.h" #include "service.h" #include "rdb.h" +#include /* Stack sizes of the threads */ #define STACK_SZ_CMD configMINIMAL_STACK_SIZE + 600 diff --git a/rcore/buttons.h b/rcore/buttons.h index 947915fd..832d4920 100644 --- a/rcore/buttons.h +++ b/rcore/buttons.h @@ -7,7 +7,7 @@ */ #include "FreeRTOS.h" -#include "rebbleos.h" +// not ideal. TODO reorg #include "librebble.h" #define butDEBOUNCE_DELAY ( pdMS_TO_TICKS(2) ) diff --git a/rcore/display.c b/rcore/display.c index 55a357c4..314dc2a7 100644 --- a/rcore/display.c +++ b/rcore/display.c @@ -15,10 +15,10 @@ * This must be run in the scheduler, not before. * */ - -#include "rebbleos.h" +#include "display.h" +#include "init.h" #include "appmanager.h" - +#include "semphr.h" /* Semaphore to start drawing */ static SemaphoreHandle_t _display_start_sem; static StaticSemaphore_t _display_start_sem_buf; diff --git a/rcore/flash.c b/rcore/flash.c index 90d40675..9ae4356b 100644 --- a/rcore/flash.c +++ b/rcore/flash.c @@ -4,10 +4,12 @@ * * Author: Barry Carter */ - -#include "rebbleos.h" +#include "FreeRTOS.h" +#include "display.h" #include "platform.h" +#include "semphr.h" #include "flash.h" +#include #include "fs.h" extern void hw_flash_init(void); diff --git a/rcore/gyro.c b/rcore/gyro.c index f81a926c..957b13ad 100644 --- a/rcore/gyro.c +++ b/rcore/gyro.c @@ -4,5 +4,4 @@ * * Author: Barry Carter */ - -#include "rebbleos.h" +#include "display.h" diff --git a/rcore/init.h b/rcore/init.h new file mode 100644 index 00000000..a1fc347b --- /dev/null +++ b/rcore/init.h @@ -0,0 +1,28 @@ +#pragma once +/* init.h + * routines for [...] + * RebbleOS + */ +//Let's make sure the user is using an 'up to date' version of the compiler + + +#define VERSION "v0.0.0.2" + +#if __GNUC__ < 8 + #error It appears you are using a version of arm-none-eabi-gcc that is incompatible with with the RebbleOS project. \ + Please find an updated version by using your respective package manager or going to the developer.arm.com download page. +#endif + + + +// Reset the watchdog timer manually +void watchdog_reset(void); + + +void rebbleos_init(void); +void os_module_init_complete(uint8_t result); + +#define INIT_RESP_OK 0 +#define INIT_RESP_ASYNC_WAIT 1 +#define INIT_RESP_NOT_SUPPORTED 2 +#define INIT_RESP_ERROR 3 diff --git a/rcore/log.c b/rcore/log.c index b2a54b7a..6cfc2976 100644 --- a/rcore/log.c +++ b/rcore/log.c @@ -4,8 +4,8 @@ * * Author: Barry Carter */ +#include "main.h" -#include "rebbleos.h" #include "minilib.h" #include "rtoswrap.h" @@ -23,6 +23,7 @@ static void _log_entry(void *arg) { } } THREAD_DEFINE(log, 300, tskIDLE_PRIORITY + 10UL, _log_entry); +extern int vsfmt(char *buf, unsigned int len, const char *ifmt, va_list ap); void log_onpanic_dump() { log_clock_enable(); diff --git a/rcore/log.h b/rcore/log.h index 9e748761..f5c6f5a4 100644 --- a/rcore/log.h +++ b/rcore/log.h @@ -6,6 +6,7 @@ * Author: Barry Carter */ +#include #include #define NULL_LOG(module_, lvl_, fmt_, ...) {;} diff --git a/rcore/main.c b/rcore/main.c index e7b410bf..d78cc665 100644 --- a/rcore/main.c +++ b/rcore/main.c @@ -4,8 +4,7 @@ * * Author: Barry Carter */ - -#include "rebbleos.h" +#include "main.h" #include "watchdog.h" #include "ambient.h" diff --git a/rcore/notification_manager.c b/rcore/notification_manager.c index 99b8f706..f41085c3 100644 --- a/rcore/notification_manager.c +++ b/rcore/notification_manager.c @@ -5,7 +5,7 @@ * * Author: Barry Carter . */ -#include "rebbleos.h" +#include "main.h" #include "protocol_notification.h" #include "notification_manager.h" #include "overlay_manager.h" diff --git a/rcore/overlay_manager.c b/rcore/overlay_manager.c index 0191280c..8621e5c1 100644 --- a/rcore/overlay_manager.c +++ b/rcore/overlay_manager.c @@ -4,7 +4,8 @@ * * Author: Barry Carter . */ -#include "rebbleos.h" +#include "main.h" +#include "init.h" #include "ngfxwrap.h" #include "overlay_manager.h" #include "protocol.h" diff --git a/rcore/overlay_manager.h b/rcore/overlay_manager.h index 077a2434..9a80347d 100644 --- a/rcore/overlay_manager.h +++ b/rcore/overlay_manager.h @@ -22,7 +22,7 @@ * Window creation happens in a callback so we can delegate the work to our thread * and constrain memory and runtime of the window */ -#include "rebbleos.h" +#include "overlay_manager.h" /* NOT USED YET */ typedef enum OverlayMode { diff --git a/rcore/power.c b/rcore/power.c index 9b5abbbb..63add4e2 100644 --- a/rcore/power.c +++ b/rcore/power.c @@ -4,11 +4,12 @@ * * Author: Barry Carter */ +#include "main.h" #include #include "power.h" -#include "rebbleos.h" #include "notification_manager.h" #include "battery_state_service.h" +#include "flash.h" static uint8_t _charge_mode_prev = 0; static uint8_t _charge_mode = 0; diff --git a/rcore/protocol/protocol.c b/rcore/protocol/protocol.c index 546c8af1..6d3e1599 100644 --- a/rcore/protocol/protocol.c +++ b/rcore/protocol/protocol.c @@ -5,7 +5,7 @@ * Author: Barry Carter */ #include -#include "rebbleos.h" +#include "main.h" #include "endpoint.h" #include "protocol.h" #include "pebble_protocol.h" diff --git a/rcore/protocol/protocol_app.c b/rcore/protocol/protocol_app.c index 69e658d9..f1ad48b4 100644 --- a/rcore/protocol/protocol_app.c +++ b/rcore/protocol/protocol_app.c @@ -5,7 +5,7 @@ * Author: Barry Carter */ #include -#include "rebbleos.h" +#include "main.h" #include "protocol_system.h" #include "pebble_protocol.h" #include "protocol_service.h" diff --git a/rcore/protocol/protocol_blob.c b/rcore/protocol/protocol_blob.c index 0d35b39a..939fa9c2 100644 --- a/rcore/protocol/protocol_blob.c +++ b/rcore/protocol/protocol_blob.c @@ -4,7 +4,7 @@ * * Author: Barry Carter . */ -#include "rebbleos.h" +#include "main.h" #include "protocol_system.h" #include "pebble_protocol.h" #include "protocol_service.h" diff --git a/rcore/protocol/protocol_call.c b/rcore/protocol/protocol_call.c index 1c315eff..273a830a 100644 --- a/rcore/protocol/protocol_call.c +++ b/rcore/protocol/protocol_call.c @@ -4,11 +4,14 @@ * * Author: Barry Carter */ -#include "rebbleos.h" +#include +#include "log.h" #include "protocol.h" #include "pebble_protocol.h" #include "protocol_service.h" #include "event_service.h" +#include "rebble_memory.h" +#include /* Configure Logging */ #define MODULE_NAME "p-call" diff --git a/rcore/protocol/protocol_music.c b/rcore/protocol/protocol_music.c index c713aa0b..67c40958 100644 --- a/rcore/protocol/protocol_music.c +++ b/rcore/protocol/protocol_music.c @@ -4,10 +4,12 @@ * * Author: Barry Carter */ -#include "rebbleos.h" +#include +#include "log.h" #include "protocol.h" #include "pebble_protocol.h" #include "protocol_service.h" +#include "rebble_memory.h" #include "event_service.h" /* Configure Logging */ diff --git a/rcore/protocol/protocol_notification.c b/rcore/protocol/protocol_notification.c index 084c2de8..64c02ab6 100644 --- a/rcore/protocol/protocol_notification.c +++ b/rcore/protocol/protocol_notification.c @@ -4,8 +4,8 @@ * * Author: Barry Carter */ +#include "main.h" #include -#include "rebbleos.h" #include "appmanager.h" #include "test.h" #include "protocol.h" diff --git a/rcore/protocol/protocol_system.c b/rcore/protocol/protocol_system.c index 88b1d704..5b32a391 100644 --- a/rcore/protocol/protocol_system.c +++ b/rcore/protocol/protocol_system.c @@ -4,7 +4,7 @@ * * Author: Barry Carter */ -#include "rebbleos.h" +#include "main.h" #include "protocol.h" #include "protocol_system.h" #include "pebble_protocol.h" diff --git a/rcore/protocol/protocol_transfer.c b/rcore/protocol/protocol_transfer.c index ba4c9269..a8e67035 100644 --- a/rcore/protocol/protocol_transfer.c +++ b/rcore/protocol/protocol_transfer.c @@ -19,8 +19,9 @@ * Each request requires an (N)ACK */ #include -#include "rebbleos.h" -#include "protocol_system.h" +#include +#include "main.h" +#include "notification_manager.h" #include "pebble_protocol.h" #include "protocol_service.h" #include "notification_manager.h" diff --git a/rcore/qemu.c b/rcore/qemu.c index d0e32f85..a7596754 100644 --- a/rcore/qemu.c +++ b/rcore/qemu.c @@ -9,11 +9,13 @@ #include "FreeRTOS.h" #include "task.h" #include "log.h" -#include "rebbleos.h" +#include "init.h" #include "endpoint.h" #include "protocol.h" #include "protocol_service.h" +#include "rebble_memory.h" +#include "semphr.h" /* Configure Logging */ #define MODULE_NAME "qemu" #define MODULE_TYPE "SYS" diff --git a/rcore/rbl_bluetooth.h b/rcore/rbl_bluetooth.h index 93de3545..85d4078d 100644 --- a/rcore/rbl_bluetooth.h +++ b/rcore/rbl_bluetooth.h @@ -1,6 +1,7 @@ #pragma once #include "stdbool.h" #include "platform.h" +#include #define TX_TIMEOUT_MS 10 @@ -81,3 +82,8 @@ extern void ble_ppogatt_set_callback_rx(ble_ppogatt_callback_rx_t cbk); extern void ble_ppogatt_set_callback_disconnected(ble_ppogatt_callback_disconnected_t cbk); #endif + +#define INIT_RESP_OK 0 +#define INIT_RESP_ASYNC_WAIT 1 +#define INIT_RESP_NOT_SUPPORTED 2 +#define INIT_RESP_ERROR 3 \ No newline at end of file diff --git a/rcore/rdb.c b/rcore/rdb.c index 4d75ee9c..6e176e8d 100644 --- a/rcore/rdb.c +++ b/rcore/rdb.c @@ -1,15 +1,21 @@ -/* rdb.c + /* rdb.c * {rebble, record, [un]reliable} database: a key-value record store in flash * libRebbleOS * * Authors: Barry Carter * Joshua Wise */ -#include "rebbleos.h" +#include +#include +#include +#include "FreeRTOS.h" +#include "task.h" +#include "log.h" #include "protocol_system.h" #include "pebble_protocol.h" #include "node_list.h" #include "timeline.h" +#include "rebble_memory.h" #include "rdb.h" /* Configure Logging */ diff --git a/rcore/rdb_test.c b/rcore/rdb_test.c index 2236c23f..1c570bf3 100644 --- a/rcore/rdb_test.c +++ b/rcore/rdb_test.c @@ -2,13 +2,15 @@ * tests for rdb database * RebbleOS */ -#include "rebbleos.h" +#include +#include "rebble_memory.h" #include "protocol_system.h" #include "pebble_protocol.h" #include "node_list.h" #include "timeline.h" #include "rdb.h" #include "test.h" +#include "log.h" #include "debug.h" #define MODULE_NAME "rdb" diff --git a/rcore/rebble_memory.c b/rcore/rebble_memory.c index 0a544052..e6c7ab73 100644 --- a/rcore/rebble_memory.c +++ b/rcore/rebble_memory.c @@ -5,8 +5,7 @@ * * Author: Barry Carter */ - -#include "rebbleos.h" +#include "main.h" /* Configure Logging */ #define MODULE_NAME "mem" diff --git a/rcore/rebble_time.c b/rcore/rebble_time.c index d8090f62..57e97848 100644 --- a/rcore/rebble_time.c +++ b/rcore/rebble_time.c @@ -4,8 +4,7 @@ * * Author: Joshua Wise */ - -#include "rebbleos.h" +#include "main.h" #include "strftime.h" #include "prefs.h" diff --git a/rcore/rebble_util.c b/rcore/rebble_util.c index cefdaf36..6be9559c 100644 --- a/rcore/rebble_util.c +++ b/rcore/rebble_util.c @@ -1,4 +1,4 @@ -#include "rebbleos.h" +#include "display.h" #include "librebble.h" #include "uuid.h" diff --git a/rcore/rebbleos.c b/rcore/rebbleos.c index 20bcfcfe..382b414a 100644 --- a/rcore/rebbleos.c +++ b/rcore/rebbleos.c @@ -4,11 +4,13 @@ * * Author: Barry Carter */ - +#include "main.h" #include "FreeRTOS.h" #include "task.h" #include "stdio.h" -#include "rebbleos.h" +#include "rbl_bluetooth.h" +#include "settings.h" +#include "init.h" #include "watchdog.h" #include "ngfxwrap.h" #include "overlay_manager.h" @@ -19,6 +21,7 @@ #include "rtoswrap.h" #include "test.h" #include "service.h" +#include "flash.h" typedef uint8_t (*mod_callback)(void); // static TaskHandle_t _os_task; diff --git a/rcore/rebbleos.h b/rcore/rebbleos.h deleted file mode 100644 index f1c58495..00000000 --- a/rcore/rebbleos.h +++ /dev/null @@ -1,64 +0,0 @@ -#pragma once -/* rebbleos.h - * routines for [...] - * RebbleOS - * - * Author: Barry Carter - */ - -#include -#include -#include -#include -#include -#include "FreeRTOS.h" -#include "rebble_memory.h" -#include "platform.h" -#include "appmanager.h" -#include "ambient.h" -#include "task.h" -#include "semphr.h" -#include "display.h" -#include "rebble_time.h" -#include "main.h" -#include "log.h" -#include "debug.h" -#include "flash.h" -#include "resource.h" -#include "rebble_util.h" -#include "rbl_bluetooth.h" - -#define VERSION "v0.0.0.2" - -//Let's make sure the user is using an 'up to date' version of the compiler - -#if __GNUC__ < 8 - #error It appears you are using a version of arm-none-eabi-gcc that is incompatible with with the RebbleOS project. \ - Please find an updated version by using your respective package manager or going to the developer.arm.com download page. -#endif - -// Public API functions as exposed through the various layers - -// Reset the watchdog timer manually -void watchdog_reset(void); - - - -typedef struct SystemSettings { - uint16_t backlight_intensity; - uint16_t backlight_on_time; - uint16_t vibrate_intensity; - uint16_t vibrate_pattern; - // may need 16t - uint8_t modules_enabled_flag; - uint8_t modules_error_flag; -} SystemSettings; - -void rebbleos_init(void); -void os_module_init_complete(uint8_t result); -SystemSettings *rebbleos_get_settings(void); - -#define INIT_RESP_OK 0 -#define INIT_RESP_ASYNC_WAIT 1 -#define INIT_RESP_NOT_SUPPORTED 2 -#define INIT_RESP_ERROR 3 diff --git a/rcore/resource.c b/rcore/resource.c index decf6946..6c3d90dd 100644 --- a/rcore/resource.c +++ b/rcore/resource.c @@ -4,8 +4,7 @@ * * Author: Barry Carter */ - -#include "rebbleos.h" +#include "main.h" #include "platform.h" #include "flash.h" diff --git a/rcore/service/protocol_service.c b/rcore/service/protocol_service.c index e10328be..587eeb93 100644 --- a/rcore/service/protocol_service.c +++ b/rcore/service/protocol_service.c @@ -10,14 +10,19 @@ * * Author: Barry Carter */ -#include "rebbleos.h" +#include #include "protocol_system.h" #include "protocol_service.h" #include "pebble_protocol.h" #include "timeline.h" #include "FreeRTOS.h" #include "rtoswrap.h" +#include "rebble_memory.h" #include "qemu.h" +#include +#include +#include "log.h" +#include "qalloc.h" /* Configure Logging */ #define MODULE_NAME "pcolsvc" diff --git a/rcore/service/timeline.c b/rcore/service/timeline.c index 5df89846..50776f8a 100644 --- a/rcore/service/timeline.c +++ b/rcore/service/timeline.c @@ -5,7 +5,7 @@ * * Author: Barry Carter */ -#include "rebbleos.h" +#include "main.h" #include "protocol_system.h" #include "protocol_service.h" #include "pebble_protocol.h" diff --git a/rcore/settings.h b/rcore/settings.h new file mode 100644 index 00000000..bae1ab7a --- /dev/null +++ b/rcore/settings.h @@ -0,0 +1,16 @@ +/* settings.h + * settings for [...] + * RebbleOS + */ +typedef struct SystemSettings { + uint16_t backlight_intensity; + uint16_t backlight_on_time; + uint16_t vibrate_intensity; + uint16_t vibrate_pattern; + // may need 16t + uint8_t modules_enabled_flag; + uint8_t modules_error_flag; +} SystemSettings; + +SystemSettings *rebbleos_get_settings(void); + diff --git a/rcore/test.c b/rcore/test.c index 611983d0..cf847ad1 100644 --- a/rcore/test.c +++ b/rcore/test.c @@ -1,5 +1,6 @@ #include "test.h" -#include "rebbleos.h" +#include "main.h" +#include "init.h" #include "protocol.h" #include "protocol_service.h" #include "rtoswrap.h" diff --git a/rwatch/event/app_timer.c b/rwatch/event/app_timer.c index 3fc2fc7b..ec094b95 100644 --- a/rwatch/event/app_timer.c +++ b/rwatch/event/app_timer.c @@ -4,7 +4,7 @@ * * Author: Joshua Wise */ -#include "rebbleos.h" +#include "main.h" #include "app_timer.h" #include "appmanager.h" #include "task.h" diff --git a/rwatch/event/battery_state_service.c b/rwatch/event/battery_state_service.c index 5088bf56..1decfe05 100644 --- a/rwatch/event/battery_state_service.c +++ b/rwatch/event/battery_state_service.c @@ -4,7 +4,7 @@ * Author: Barry Carter * */ - +#include "main.h" #include "librebble.h" #include "ngfxwrap.h" #include "battery_state_service.h" diff --git a/rwatch/event/connection_service.c b/rwatch/event/connection_service.c index 898ad126..59322a57 100644 --- a/rwatch/event/connection_service.c +++ b/rwatch/event/connection_service.c @@ -9,6 +9,7 @@ #include "event_service.h" #include "event_service.h" #include "connection_service.h" +#include "rebble_util.h" static void _connection_service_cb(EventServiceCommand command, void *data, void *context) diff --git a/rwatch/event/event_service.c b/rwatch/event/event_service.c index 97ecf9f7..5bfc2abd 100644 --- a/rwatch/event/event_service.c +++ b/rwatch/event/event_service.c @@ -4,7 +4,9 @@ * * Author: Barry Carter */ -#include "rebbleos.h" +#include +#include "main.h" +#include "rebble_util.h" #include "protocol.h" #include "pebble_protocol.h" #include "overlay_manager.h" diff --git a/rwatch/graphics/font_loader.c b/rwatch/graphics/font_loader.c index 45f47fa2..24da28d9 100644 --- a/rwatch/graphics/font_loader.c +++ b/rwatch/graphics/font_loader.c @@ -4,8 +4,7 @@ * * Author: Barry Carter */ - -#include "rebbleos.h" +#include "display.h" #include "librebble.h" #include "platform_res.h" diff --git a/rwatch/ngfxwrap.c b/rwatch/ngfxwrap.c index ad112bfa..3bb84e1a 100644 --- a/rwatch/ngfxwrap.c +++ b/rwatch/ngfxwrap.c @@ -4,7 +4,7 @@ * * Author: Barry Carter */ - +#include "main.h" #include "context.h" #include "appmanager.h" #include "display.h" diff --git a/rwatch/storage/dictionary.c b/rwatch/storage/dictionary.c index d4ef9d3b..3ccbd283 100644 --- a/rwatch/storage/dictionary.c +++ b/rwatch/storage/dictionary.c @@ -11,7 +11,11 @@ probably should be a status header */ -#include "rebbleos.h" +#include +#include +#include +#include +#include #include "dictionary.h" uint32_t dict_calc_buffer_size(const uint8_t tuple_count, ...) @@ -501,4 +505,4 @@ TEST(dictionary) *artifact = 0; return TEST_PASS; } -#endif \ No newline at end of file +#endif diff --git a/rwatch/storage/storage_persist.c b/rwatch/storage/storage_persist.c index bdf1028b..aac05691 100644 --- a/rwatch/storage/storage_persist.c +++ b/rwatch/storage/storage_persist.c @@ -4,10 +4,12 @@ * * Authors: Barry Carter */ -#include "rebbleos.h" #include "rdb.h" -#include "storage_persist.h" #include "appmanager_thread.h" +#include "log.h" +#include +#include +#include "storage_persist.h" #define MODULE_NAME "stor" #define MODULE_TYPE "RWAT" diff --git a/rwatch/ui/action_menu.c b/rwatch/ui/action_menu.c index 158d0561..1b12712d 100644 --- a/rwatch/ui/action_menu.c +++ b/rwatch/ui/action_menu.c @@ -7,8 +7,7 @@ * Author: Carson Katri . * Author: Hermann Noll */ - -#include "rebbleos.h" +#include "display.h" #include "action_menu.h" #include "menu_layer.h" #include "pebble_defines.h" diff --git a/rwatch/ui/animation/animation.c b/rwatch/ui/animation/animation.c index 71dc32cc..2f02f2b4 100644 --- a/rwatch/ui/animation/animation.c +++ b/rwatch/ui/animation/animation.c @@ -39,6 +39,7 @@ #include "appmanager.h" #include "FreeRTOS.h" #include "animation.h" +#include "rebble_util.h" /* Configure Logging */ #define MODULE_NAME "anim" diff --git a/rwatch/ui/notifications/battery_overlay.c b/rwatch/ui/notifications/battery_overlay.c index 72a54cd6..b9d9a93b 100644 --- a/rwatch/ui/notifications/battery_overlay.c +++ b/rwatch/ui/notifications/battery_overlay.c @@ -1,4 +1,4 @@ -#include "rebbleos.h" +#include "main.h" #include "protocol_notification.h" #include "notification_manager.h" #include "platform_res.h" diff --git a/rwatch/ui/notifications/call_window.c b/rwatch/ui/notifications/call_window.c index c02b9f81..4e3b7c93 100644 --- a/rwatch/ui/notifications/call_window.c +++ b/rwatch/ui/notifications/call_window.c @@ -4,7 +4,8 @@ * * Author: Barry Carter . */ -#include "rebbleos.h" +#include +#include "main.h" #include "platform_res.h" #include "notification_manager.h" #include "protocol.h" diff --git a/rwatch/ui/notifications/mini_message.c b/rwatch/ui/notifications/mini_message.c index 98caf679..3c8199ca 100644 --- a/rwatch/ui/notifications/mini_message.c +++ b/rwatch/ui/notifications/mini_message.c @@ -1,10 +1,10 @@ +#include "main.h" /* mini_message.c * Allows a small message to be displayed at the bottom of the screen * RebbleOS * * Author: Barry Carter . */ -#include "rebbleos.h" #include "protocol_notification.h" #include "notification_manager.h" #include "platform_res.h" diff --git a/rwatch/ui/notifications/progress_window.c b/rwatch/ui/notifications/progress_window.c index 9526f2d8..a8ab7271 100644 --- a/rwatch/ui/notifications/progress_window.c +++ b/rwatch/ui/notifications/progress_window.c @@ -4,7 +4,8 @@ * * Author: Barry Carter . */ -#include "rebbleos.h" +#include +#include "main.h" #include "platform_res.h" #include "notification_manager.h" diff --git a/rwatch/ui/vibes.c b/rwatch/ui/vibes.c index 5ea131a9..a4bac72e 100644 --- a/rwatch/ui/vibes.c +++ b/rwatch/ui/vibes.c @@ -8,7 +8,6 @@ #include #include "vibes.h" #include "vibrate.h" -#include "rebbleos.h" const static VibratePattern_t short_pattern = { .length = 1,