diff --git a/.vscode/settings.json b/.vscode/settings.json index 5048e106..2d4a704a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,4 +7,7 @@ "${workspaceFolder}/app", "${workspaceFolder}\\app" ], + "nrf-connect.debugging.bindings": { + "${workspaceFolder}/app/build": "Launch build" + }, } diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 5e8811bd..00c984f6 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -26,19 +26,19 @@ include_directories(src/) include_directories(src/ui) include_directories(src/applications) -target_sources(app PRIVATE src/display_control.c) target_sources(app PRIVATE src/main.c) target_sources(app PRIVATE src/ram_retention_storage.c) -target_sources(app PRIVATE src/zsw_vibration_motor.c) target_sources(app PRIVATE src/zsw_clock.c) target_sources(app PRIVATE src/zsw_cpu_freq.c) -target_sources(app PRIVATE src/zsw_gatt_sensor_server.c) -target_sources(app PRIVATE src/zsw_phone_app_publisher.c) -target_sources(app PRIVATE src/manager/application_manager.c) -target_sources(app PRIVATE src/manager/notification_manager.c) -target_sources(app PRIVATE src/manager/zsw_battery_manager.c) -target_sources(app PRIVATE src/manager/zsw_power_manager.c) +target_sources(app PRIVATE src/drivers/zsw_display_control.c) +target_sources(app PRIVATE src/drivers/zsw_vibration_motor.c) + +target_sources(app PRIVATE src/managers/zsw_app_manager.c) +target_sources(app PRIVATE src/managers/zsw_notification_manager.c) +target_sources(app PRIVATE src/managers/zsw_battery_manager.c) +target_sources(app PRIVATE src/managers/zsw_power_manager.c) +target_sources(app PRIVATE src/managers/zsw_phone_app_publisher.c) target_sources(app PRIVATE src/battery/battery.c) target_sources(app PRIVATE src/battery/zsw_charger.c) @@ -46,6 +46,7 @@ target_sources(app PRIVATE src/battery/zsw_charger.c) target_sources(app PRIVATE src/ble/ble_aoa.c) target_sources(app PRIVATE src/ble/ble_comm.c) target_sources(app PRIVATE src/ble/ble_transport.c) +target_sources(app PRIVATE src/ble/zsw_gatt_sensor_server.c) target_sources(app PRIVATE src/sensors/zsw_imu.c) target_sources(app PRIVATE src/sensors/zsw_pressure_sensor.c) @@ -57,9 +58,9 @@ target_sources(app PRIVATE src/ui/notification/zsw_popup_notifcation.c) target_sources(app PRIVATE src/ui/popup/zsw_popup_window.c) target_sources(app PRIVATE src/ui/utils/zsw_ui_utils.c) -target_sources_ifdef(CONFIG_SPI_FLASH_LOADER app PRIVATE src/zsw_rtt_flash_loader.c) -target_sources_ifdef(CONFIG_FILE_SYSTEM_LITTLEFS app PRIVATE src/zsw_filesystem.c) -target_sources_ifdef(CONFIG_FILE_SYSTEM_LITTLEFS app PRIVATE src/zsw_lvgl_spi_decoder.c) +target_sources_ifdef(CONFIG_SPI_FLASH_LOADER app PRIVATE src/filesystem/zsw_rtt_flash_loader.c) +target_sources_ifdef(CONFIG_FILE_SYSTEM_LITTLEFS app PRIVATE src/filesystem/zsw_filesystem.c) +target_sources_ifdef(CONFIG_FILE_SYSTEM_LITTLEFS app PRIVATE src/filesystem/zsw_lvgl_spi_decoder.c) if (DFU_BUILD) target_sources(app PRIVATE src/dfu.c) diff --git a/app/src/applications/2048/game_2048_app.c b/app/src/applications/2048/game_2048_app.c index ff6544e4..db1a9ea8 100644 --- a/app/src/applications/2048/game_2048_app.c +++ b/app/src/applications/2048/game_2048_app.c @@ -3,7 +3,7 @@ #include #include "game_2048_ui.h" -#include "manager/application_manager.h" +#include "managers/zsw_app_manager.h" // Functions needed for all applications static void game_2048_app_start(lv_obj_t *root, lv_group_t *group); @@ -30,7 +30,7 @@ static void game_2048_app_stop(void) static int game_2048_app_add(void) { - application_manager_add_application(&app); + zsw_app_manager_add_application(&app); return 0; } diff --git a/app/src/applications/accelerometer/accel_app.c b/app/src/applications/accelerometer/accel_app.c index 49509bdc..1a49e35a 100644 --- a/app/src/applications/accelerometer/accel_app.c +++ b/app/src/applications/accelerometer/accel_app.c @@ -5,7 +5,7 @@ #include "accel_ui.h" #include "sensors/zsw_imu.h" #include "events/zsw_periodic_event.h" -#include "manager/application_manager.h" +#include "managers/zsw_app_manager.h" static void zbus_fetch_accel_data_callback(const struct zbus_channel *chan); static void accel_app_start(lv_obj_t *root, lv_group_t *group); @@ -49,12 +49,12 @@ static void zbus_fetch_accel_data_callback(const struct zbus_channel *chan) static void on_close_accel(void) { - application_manager_app_close_request(&app); + zsw_app_manager_app_close_request(&app); } static int accel_app_add(void) { - application_manager_add_application(&app); + zsw_app_manager_add_application(&app); return 0; } diff --git a/app/src/applications/battery/battery_app.c b/app/src/applications/battery/battery_app.c index 89fe25b1..bd8fedbe 100644 --- a/app/src/applications/battery/battery_app.c +++ b/app/src/applications/battery/battery_app.c @@ -6,7 +6,7 @@ #include "battery/battery.h" #include "battery/battery_ui.h" #include "events/battery_event.h" -#include "manager/application_manager.h" +#include "managers/zsw_app_manager.h" LOG_MODULE_REGISTER(battery_app, LOG_LEVEL_WRN); @@ -108,7 +108,7 @@ static int get_num_samples(void) static int battery_app_add(void) { - application_manager_add_application(&app); + zsw_app_manager_add_application(&app); memset(battery_samples, 0, sizeof(battery_samples)); return 0; } diff --git a/app/src/applications/compass/compass_app.c b/app/src/applications/compass/compass_app.c index 1ffba1e9..fe78a7fa 100644 --- a/app/src/applications/compass/compass_app.c +++ b/app/src/applications/compass/compass_app.c @@ -5,7 +5,7 @@ #include "compass_ui.h" #include "ui/popup/zsw_popup_window.h" #include "sensors/zsw_magnetometer.h" -#include "manager/application_manager.h" +#include "managers/zsw_app_manager.h" LOG_MODULE_REGISTER(compass_app, LOG_LEVEL_DBG); @@ -68,7 +68,7 @@ static void timer_callback(lv_timer_t *timer) static int compass_app_add(void) { - application_manager_add_application(&app); + zsw_app_manager_add_application(&app); return 0; } diff --git a/app/src/applications/info/info_app.c b/app/src/applications/info/info_app.c index 305d65bf..7e9a0987 100644 --- a/app/src/applications/info/info_app.c +++ b/app/src/applications/info/info_app.c @@ -7,8 +7,8 @@ #include #include "info_ui.h" -#include "manager/zsw_power_manager.h" -#include "manager/application_manager.h" +#include "managers/zsw_power_manager.h" +#include "managers/zsw_app_manager.h" LOG_MODULE_REGISTER(info_app, LOG_LEVEL_DBG); @@ -78,7 +78,7 @@ static void on_reset_pressed(void) static int info_app_add(void) { - application_manager_add_application(&app); + zsw_app_manager_add_application(&app); return 0; } diff --git a/app/src/applications/music_control/music_control_app.c b/app/src/applications/music_control/music_control_app.c index f83865aa..ab1683cb 100644 --- a/app/src/applications/music_control/music_control_app.c +++ b/app/src/applications/music_control/music_control_app.c @@ -6,7 +6,7 @@ #include "music_control_ui.h" #include "ble/ble_comm.h" #include "events/ble_data_event.h" -#include "manager/application_manager.h" +#include "managers/zsw_app_manager.h" // Functions needed for all applications static void music_control_app_start(lv_obj_t *root, lv_group_t *group); @@ -60,7 +60,7 @@ static void on_music_ui_evt_music(music_control_ui_evt_type_t evt_type) switch (evt_type) { case MUSIC_CONTROL_UI_CLOSE: - application_manager_app_close_request(&app); + zsw_app_manager_app_close_request(&app); break; case MUSIC_CONTROL_UI_PLAY: msg_len = snprintf(buf, sizeof(buf), "{\"t\":\"music\", \"n\": %s} \n", "play"); @@ -127,7 +127,7 @@ static void timer_callback(lv_timer_t *timer) static int music_control_app_add(void) { - application_manager_add_application(&app); + zsw_app_manager_add_application(&app); running = false; return 0; diff --git a/app/src/applications/notification/notification_app.c b/app/src/applications/notification/notification_app.c index 259ba698..de01e150 100644 --- a/app/src/applications/notification/notification_app.c +++ b/app/src/applications/notification/notification_app.c @@ -2,8 +2,8 @@ #include #include "notification_ui.h" -#include "manager/notification_manager.h" -#include "manager/application_manager.h" +#include "managers/zsw_notification_manager.h" +#include "managers/zsw_app_manager.h" // Functions needed for all applications static void notification_app_start(lv_obj_t *root, lv_group_t *group); @@ -19,16 +19,16 @@ static application_t app = { static void on_notification_page_notification_close(uint32_t not_id) { // TODO send to phone that the notification was read. - notification_manager_remove(not_id); + zsw_notification_manager_remove(not_id); } static void notification_app_start(lv_obj_t *root, lv_group_t *group) { int num_unread; - not_mngr_notification_t notifications[NOTIFICATION_MANAGER_MAX_STORED]; + zsw_not_mngr_notification_t notifications[NOTIFICATION_MANAGER_MAX_STORED]; - notification_manager_get_all(notifications, &num_unread); + zsw_notification_manager_get_all(notifications, &num_unread); notifications_page_init(on_notification_page_notification_close); notifications_page_create(notifications, num_unread, group); } @@ -40,7 +40,7 @@ static void notification_app_stop(void) static int notification_app_add(void) { - application_manager_add_application(&app); + zsw_app_manager_add_application(&app); return 0; } diff --git a/app/src/applications/notification/notification_ui.c b/app/src/applications/notification/notification_ui.c index 5b3ad977..a208d478 100644 --- a/app/src/applications/notification/notification_ui.c +++ b/app/src/applications/notification/notification_ui.c @@ -3,7 +3,7 @@ static void not_button_pressed(lv_event_t *e); static void scroll_event_cb(lv_event_t *e); -static void build_notification_entry(lv_obj_t *parent, not_mngr_notification_t *not, lv_group_t *input_group); +static void build_notification_entry(lv_obj_t *parent, zsw_not_mngr_notification_t *not, lv_group_t *input_group); static on_notification_remove_cb_t not_removed_callback; @@ -15,7 +15,7 @@ void notifications_page_init(on_notification_remove_cb_t not_removed_cb) not_removed_callback = not_removed_cb; } -void notifications_page_create(not_mngr_notification_t *notifications, uint8_t num_notifications, +void notifications_page_create(zsw_not_mngr_notification_t *notifications, uint8_t num_notifications, lv_group_t *input_group) { group = input_group; @@ -49,7 +49,7 @@ void notifications_page_close(void) lv_obj_del(main_page); } -static void build_notification_entry(lv_obj_t *parent, not_mngr_notification_t *not, lv_group_t *input_group) +static void build_notification_entry(lv_obj_t *parent, zsw_not_mngr_notification_t *not, lv_group_t *input_group) { lv_obj_t *title; lv_obj_t *cont; diff --git a/app/src/applications/notification/notification_ui.h b/app/src/applications/notification/notification_ui.h index f690d172..5ef3e908 100644 --- a/app/src/applications/notification/notification_ui.h +++ b/app/src/applications/notification/notification_ui.h @@ -4,13 +4,13 @@ #include #include -#include "manager/notification_manager.h" +#include "managers/zsw_notification_manager.h" typedef void(*on_notification_remove_cb_t)(uint32_t id); void notifications_page_init(on_notification_remove_cb_t not_removed_cb); -void notifications_page_create(not_mngr_notification_t *notifications, uint8_t num_notifications, +void notifications_page_create(zsw_not_mngr_notification_t *notifications, uint8_t num_notifications, lv_group_t *input_group); void notifications_page_close(void); diff --git a/app/src/applications/qr_code/qr_code_app.c b/app/src/applications/qr_code/qr_code_app.c index 9dec4ea5..033a9e3c 100644 --- a/app/src/applications/qr_code/qr_code_app.c +++ b/app/src/applications/qr_code/qr_code_app.c @@ -1,9 +1,9 @@ #include #include -#include +#include "drivers/zsw_display_control.h" #include "qr_code_ui.h" -#include "manager/application_manager.h" +#include "managers/zsw_app_manager.h" // Functions needed for all applications static void qr_code_app_start(lv_obj_t *root, lv_group_t *group); @@ -22,20 +22,20 @@ static uint8_t original_brightness; static void qr_code_app_start(lv_obj_t *root, lv_group_t *group) { - original_brightness = display_control_get_brightness(); - display_control_set_brightness(100); + original_brightness = zsw_display_control_get_brightness(); + zsw_display_control_set_brightness(100); qr_code_ui_show(root); } static void qr_code_app_stop(void) { - display_control_set_brightness(original_brightness); + zsw_display_control_set_brightness(original_brightness); qr_code_ui_remove(); } static int qr_code_app_add(void) { - application_manager_add_application(&app); + zsw_app_manager_add_application(&app); return 0; } diff --git a/app/src/applications/sensors_summary/sensors_summary_app.c b/app/src/applications/sensors_summary/sensors_summary_app.c index 7ac05a9d..ce6aaeaa 100644 --- a/app/src/applications/sensors_summary/sensors_summary_app.c +++ b/app/src/applications/sensors_summary/sensors_summary_app.c @@ -9,7 +9,7 @@ #include "sensors/zsw_env_sensor.h" #include "sensors/zsw_light_sensor.h" #include "sensors/zsw_pressure_sensor.h" -#include "manager/application_manager.h" +#include "managers/zsw_app_manager.h" LOG_MODULE_REGISTER(sensors_summary_app, LOG_LEVEL_DBG); @@ -85,7 +85,7 @@ static void timer_callback(lv_timer_t *timer) static void on_close_sensors_summary(void) { - application_manager_app_close_request(&app); + zsw_app_manager_app_close_request(&app); } static void on_ref_set(void) @@ -95,7 +95,7 @@ static void on_ref_set(void) static int sensors_summary_app_add(void) { - application_manager_add_application(&app); + zsw_app_manager_add_application(&app); return 0; } diff --git a/app/src/applications/settings/settings_app.c b/app/src/applications/settings/settings_app.c index 500b5be6..161d3573 100644 --- a/app/src/applications/settings/settings_app.c +++ b/app/src/applications/settings/settings_app.c @@ -1,6 +1,5 @@ #include #include -#include #include #include #include @@ -9,7 +8,8 @@ #include "ble/ble_aoa.h" #include "ble/ble_comm.h" #include "sensors/zsw_imu.h" -#include "manager/application_manager.h" +#include "drivers/zsw_display_control.h" +#include "managers/zsw_app_manager.h" static void settings_app_start(lv_obj_t *root, lv_group_t *group); static void settings_app_stop(void); @@ -155,13 +155,13 @@ static void settings_app_stop(void) static void on_close_settings(void) { printk("on_close_settings\n"); - application_manager_app_close_request(&app); + zsw_app_manager_app_close_request(&app); } static void on_brightness_changed(lv_setting_value_t value, bool final) { // Slider have values 0-10 hence multiply with 10 to get brightness in percent - display_control_set_brightness(value.item.slider * 10); + zsw_display_control_set_brightness(value.item.slider * 10); value.item.slider *= 10; settings_save_one("settings/brightness", &value.item.slider, sizeof(value.item.slider)); } @@ -228,7 +228,7 @@ static int settings_load_cb(const char *name, size_t len, rc = read_cb(cb_arg, &bri, sizeof(bri)); printk("Read br: %d\n", bri); general_page_items[0].item.slider.inital_val = bri / 10; - display_control_set_brightness(bri); + zsw_display_control_set_brightness(bri); if (rc >= 0) { return 0; } @@ -242,7 +242,7 @@ static int settings_load_cb(const char *name, size_t len, static int settings_app_add(void) { - application_manager_add_application(&app); + zsw_app_manager_add_application(&app); return 0; } diff --git a/app/src/applications/template/template_app.c b/app/src/applications/template/template_app.c index 22d3c77f..a53450bc 100644 --- a/app/src/applications/template/template_app.c +++ b/app/src/applications/template/template_app.c @@ -2,7 +2,7 @@ #include #include "template_ui.h" -#include "manager/application_manager.h" +#include "managers/zsw_app_manager.h" // Functions needed for all applications static void template_app_start(lv_obj_t *root, lv_group_t *group); @@ -51,7 +51,7 @@ static void on_incrementation(void) static int template_app_add(void) { - application_manager_add_application(&app); + zsw_app_manager_add_application(&app); return 0; } diff --git a/app/src/applications/watchface/watchface_app.c b/app/src/applications/watchface/watchface_app.c index 1c4162de..8bf1b40f 100644 --- a/app/src/applications/watchface/watchface_app.c +++ b/app/src/applications/watchface/watchface_app.c @@ -22,8 +22,8 @@ #include "sensors/zsw_imu.h" #include "sensors/zsw_env_sensor.h" #include "sensors/zsw_pressure_sensor.h" -#include "manager/zsw_battery_manager.h" -#include "manager/notification_manager.h" +#include "managers/zsw_battery_manager.h" +#include "managers/zsw_notification_manager.h" LOG_MODULE_REGISTER(watcface_app, LOG_LEVEL_WRN); @@ -212,7 +212,7 @@ static void general_work(struct k_work *item) static void check_notifications(void) { - uint32_t num_unread = notification_manager_get_num(); + uint32_t num_unread = zsw_notification_manager_get_num(); watchfaces[current_watchface]->set_num_notifcations(num_unread); } diff --git a/app/src/applications/x_ray/x_ray_app.c b/app/src/applications/x_ray/x_ray_app.c index c87c18ec..c6917192 100644 --- a/app/src/applications/x_ray/x_ray_app.c +++ b/app/src/applications/x_ray/x_ray_app.c @@ -1,9 +1,9 @@ #include #include -#include +#include "drivers/zsw_display_control.h" #include "x_ray_ui.h" -#include "manager/application_manager.h" +#include "managers/zsw_app_manager.h" // Functions needed for all applications static void x_ray_app_start(lv_obj_t *root, lv_group_t *group); @@ -22,20 +22,20 @@ static uint8_t original_brightness; static void x_ray_app_start(lv_obj_t *root, lv_group_t *group) { - original_brightness = display_control_get_brightness(); - display_control_set_brightness(100); + original_brightness = zsw_display_control_get_brightness(); + zsw_display_control_set_brightness(100); x_ray_ui_show(root); } static void x_ray_app_stop(void) { - display_control_set_brightness(original_brightness); + zsw_display_control_set_brightness(original_brightness); x_ray_ui_remove(); } static int x_ray_app_add(void) { - application_manager_add_application(&app); + zsw_app_manager_add_application(&app); return 0; } diff --git a/app/src/applications/zds/zds_app.c b/app/src/applications/zds/zds_app.c index 0f4af878..179493af 100644 --- a/app/src/applications/zds/zds_app.c +++ b/app/src/applications/zds/zds_app.c @@ -4,7 +4,7 @@ #include #include "events/accel_event.h" -#include "manager/application_manager.h" +#include "managers/zsw_app_manager.h" // Functions needed for all applications static void zds_app_start(lv_obj_t *root, lv_group_t *group); @@ -38,7 +38,7 @@ static void zds_app_stop(void) static int zds_app_add(void) { - application_manager_add_application(&app); + zsw_app_manager_add_application(&app); return 0; } diff --git a/app/src/zsw_gatt_sensor_server.c b/app/src/ble/zsw_gatt_sensor_server.c similarity index 99% rename from app/src/zsw_gatt_sensor_server.c rename to app/src/ble/zsw_gatt_sensor_server.c index 7724ab52..af66a9f9 100644 --- a/app/src/zsw_gatt_sensor_server.c +++ b/app/src/ble/zsw_gatt_sensor_server.c @@ -15,7 +15,6 @@ * along with this program. If not, see . */ -#include #include #include #include @@ -26,6 +25,7 @@ #include "events/zsw_periodic_event.h" #include "ble/ble_comm.h" +#include #include "sensors/zsw_imu.h" #include "sensors/zsw_env_sensor.h" diff --git a/app/src/zsw_gatt_sensor_server.h b/app/src/ble/zsw_gatt_sensor_server.h similarity index 100% rename from app/src/zsw_gatt_sensor_server.h rename to app/src/ble/zsw_gatt_sensor_server.h diff --git a/app/src/display_control.h b/app/src/display_control.h deleted file mode 100644 index cb81d61d..00000000 --- a/app/src/display_control.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef __DISPLAY_CONTROL_H_ -#define __DISPLAY_CONTROL_H_ -#include -#include - -void display_control_init(void); -int display_control_sleep_ctrl(bool on); -int display_control_pwr_ctrl(bool on); -void display_control_set_brightness(uint8_t percent); -uint8_t display_control_get_brightness(void); -#endif \ No newline at end of file diff --git a/app/src/display_control.c b/app/src/drivers/zsw_display_control.c similarity index 93% rename from app/src/display_control.c rename to app/src/drivers/zsw_display_control.c index f93ee2eb..894dcaea 100644 --- a/app/src/display_control.c +++ b/app/src/drivers/zsw_display_control.c @@ -1,4 +1,4 @@ -#include +#include "drivers/zsw_display_control.h" #include #include #include @@ -33,7 +33,7 @@ static display_state_t display_state; static bool first_render_since_poweron; static uint8_t last_brightness = 30; -void display_control_init(void) +void zsw_display_control_init(void) { if (!device_is_ready(display_dev)) { LOG_ERR("Device display not ready."); @@ -51,7 +51,7 @@ void display_control_init(void) display_state = DISPLAY_STATE_SLEEPING; } -int display_control_sleep_ctrl(bool on) +int zsw_display_control_sleep_ctrl(bool on) { int res = -EALREADY; @@ -72,7 +72,7 @@ int display_control_sleep_ctrl(bool on) pm_device_action_run(touch_dev, PM_DEVICE_ACTION_SUSPEND); } // Turn off PWM peripheral as it consumes like 200-250uA - display_control_set_brightness(0); + zsw_display_control_set_brightness(0); // Cancel pending call to lv_task_handler // Don't waste resosuces to rendering when display is off anyway. k_work_cancel_delayable_sync(&lvgl_work, &canel_work_sync); @@ -96,7 +96,7 @@ int display_control_sleep_ctrl(bool on) // then wait to show content until rendering completes. // This avoids user seeing random pixel data for ~500ms if (!first_render_since_poweron) { - display_control_set_brightness(last_brightness); + zsw_display_control_set_brightness(last_brightness); } display_blanking_off(display_dev); k_work_schedule(&lvgl_work, K_MSEC(250)); @@ -121,7 +121,7 @@ int display_control_sleep_ctrl(bool on) return res; } -int display_control_pwr_ctrl(bool on) +int zsw_display_control_pwr_ctrl(bool on) { int res = -EALREADY; @@ -173,12 +173,12 @@ int display_control_pwr_ctrl(bool on) return res; } -uint8_t display_control_get_brightness(void) +uint8_t zsw_display_control_get_brightness(void) { return last_brightness; } -void display_control_set_brightness(uint8_t percent) +void zsw_display_control_set_brightness(uint8_t percent) { if (!device_is_ready(display_blk.dev)) { return; @@ -209,7 +209,7 @@ static void lvgl_render(struct k_work *item) { const int64_t next_update_in_ms = lv_task_handler(); if (first_render_since_poweron) { - display_control_set_brightness(last_brightness); + zsw_display_control_set_brightness(last_brightness); first_render_since_poweron = false; } k_work_schedule(&lvgl_work, K_MSEC(next_update_in_ms)); diff --git a/app/src/drivers/zsw_display_control.h b/app/src/drivers/zsw_display_control.h new file mode 100644 index 00000000..7fe54642 --- /dev/null +++ b/app/src/drivers/zsw_display_control.h @@ -0,0 +1,11 @@ +#ifndef __ZSW_DISPLAY_CONTROL_H_ +#define __ZSW_DISPLAY_CONTROL_H_ +#include +#include + +void zsw_display_control_init(void); +int zsw_display_control_sleep_ctrl(bool on); +int zsw_display_control_pwr_ctrl(bool on); +void zsw_display_control_set_brightness(uint8_t percent); +uint8_t zsw_display_control_get_brightness(void); +#endif \ No newline at end of file diff --git a/app/src/zsw_vibration_motor.c b/app/src/drivers/zsw_vibration_motor.c similarity index 98% rename from app/src/zsw_vibration_motor.c rename to app/src/drivers/zsw_vibration_motor.c index 22a370ae..929af260 100644 --- a/app/src/zsw_vibration_motor.c +++ b/app/src/drivers/zsw_vibration_motor.c @@ -1,4 +1,4 @@ -#include +#include "drivers/zsw_vibration_motor.h" #include #include #include diff --git a/app/src/zsw_vibration_motor.h b/app/src/drivers/zsw_vibration_motor.h similarity index 100% rename from app/src/zsw_vibration_motor.h rename to app/src/drivers/zsw_vibration_motor.h diff --git a/app/src/events/activity_event.h b/app/src/events/activity_event.h index e98cbb0c..c1b62739 100644 --- a/app/src/events/activity_event.h +++ b/app/src/events/activity_event.h @@ -1,6 +1,6 @@ #include -#include "manager/zsw_power_manager.h" +#include "managers/zsw_power_manager.h" struct activity_state_event { zsw_power_manager_state_t state; diff --git a/app/src/zsw_filesystem.c b/app/src/filesystem/zsw_filesystem.c similarity index 100% rename from app/src/zsw_filesystem.c rename to app/src/filesystem/zsw_filesystem.c diff --git a/app/src/zsw_lvgl_spi_decoder.c b/app/src/filesystem/zsw_lvgl_spi_decoder.c similarity index 100% rename from app/src/zsw_lvgl_spi_decoder.c rename to app/src/filesystem/zsw_lvgl_spi_decoder.c diff --git a/app/src/zsw_rtt_flash_loader.c b/app/src/filesystem/zsw_rtt_flash_loader.c similarity index 99% rename from app/src/zsw_rtt_flash_loader.c rename to app/src/filesystem/zsw_rtt_flash_loader.c index 4606f366..690fc56d 100644 --- a/app/src/zsw_rtt_flash_loader.c +++ b/app/src/filesystem/zsw_rtt_flash_loader.c @@ -47,9 +47,9 @@ static struct k_thread rtt_work_thread; static const struct flash_area *flash_area; -static uint8_t* data_buf; -static uint8_t* up_buffer; -static uint8_t* down_buffer; +static uint8_t *data_buf; +static uint8_t *up_buffer; +static uint8_t *down_buffer; static int loader_write_flash(int partition_id, int buf_idx, uint8_t *buf, int len) { diff --git a/app/src/zsw_rtt_flash_loader.h b/app/src/filesystem/zsw_rtt_flash_loader.h similarity index 100% rename from app/src/zsw_rtt_flash_loader.h rename to app/src/filesystem/zsw_rtt_flash_loader.h diff --git a/app/src/main.c b/app/src/main.c index f5d9c0a5..b7954e12 100644 --- a/app/src/main.c +++ b/app/src/main.c @@ -1,33 +1,22 @@ #include -#include -#include #include #include #include -#include -#include #include #include -#include #include +#include #include #include #include -#include -#include -#include #include #include #include -#include #include -#include -#include #include #include #include #include -#include #include "dfu.h" #include "ui/zsw_ui.h" #include "ble/ble_comm.h" @@ -39,10 +28,14 @@ #include "sensors/zsw_imu.h" #include "sensors/zsw_magnetometer.h" #include "sensors/zsw_pressure_sensor.h" -#include "manager/zsw_power_manager.h" -#include "manager/application_manager.h" -#include "manager/notification_manager.h" +#include +#include "drivers/zsw_vibration_motor.h" +#include "drivers/zsw_display_control.h" +#include "managers/zsw_power_manager.h" +#include "managers/zsw_app_manager.h" +#include "managers/zsw_notification_manager.h" #include "applications/watchface/watchface_app.h" +#include LOG_MODULE_REGISTER(main, LOG_LEVEL_WRN); @@ -141,7 +134,7 @@ static void run_input_work(struct k_work *item) if (zsw_notification_popup_is_shown()) { zsw_notification_popup_remove(); } else if (watch_state == APPLICATION_MANAGER_STATE) { - application_manager_exit_app(); + zsw_app_manager_exit_app(); return; } @@ -199,7 +192,7 @@ static void run_init_work(struct k_work *item) lv_indev_t *touch_indev; load_retention_ram(); - notification_manager_init(); + zsw_notification_manager_init(); enable_bluetoth(); //uint32_t br = 1337; //int rc = settings_save_one("settings/brightness", &br, sizeof(br)); @@ -210,8 +203,8 @@ static void run_init_work(struct k_work *item) zsw_clock_init(retained.current_time_seconds); // Not to self, PWM consumes like 250uA... // Need to disable also when screen is off. - display_control_init(); - display_control_sleep_ctrl(true); + zsw_display_control_init(); + zsw_display_control_sleep_ctrl(true); INPUT_CALLBACK_DEFINE(NULL, on_input_subsys_callback); @@ -335,7 +328,7 @@ static bool load_retention_ram(void) static void open_notification_popup(void *data) { - not_mngr_notification_t *not = notification_manager_get_newest(); + zsw_not_mngr_notification_t *not = zsw_notification_manager_get_newest(); if (not != NULL) { lv_group_set_default(temp_group); lv_indev_set_group(enc_indev, temp_group); @@ -351,7 +344,7 @@ static void open_application_manager_page(void *app_name) watchface_app_stop(); is_buttons_for_lvgl = true; watch_state = APPLICATION_MANAGER_STATE; - application_manager_show(on_application_manager_close, lv_scr_act(), input_group, (char *)app_name); + zsw_app_manager_show(on_application_manager_close, lv_scr_act(), input_group, (char *)app_name); } static void close_popup_notification(lv_timer_t *timer) @@ -362,7 +355,7 @@ static void close_popup_notification(lv_timer_t *timer) id = (uint32_t)timer->user_data; // Notification was dismissed, hence consider it read. - notification_manager_remove(id); + zsw_notification_manager_remove(id); lv_group_set_default(input_group); lv_indev_set_group(enc_indev, input_group); @@ -393,7 +386,7 @@ static void on_popup_notifcation_closed(uint32_t id) static void on_application_manager_close(void) { - application_manager_delete(); + zsw_app_manager_delete(); watch_state = WATCHFACE_STATE; watchface_app_start(input_group, on_watchface_app_event_callback); lv_async_call(async_turn_off_buttons_allocation, NULL); @@ -449,7 +442,7 @@ static void handle_screen_gesture(lv_dir_t event_code) } else if (watch_state == APPLICATION_MANAGER_STATE && event_code == LV_DIR_RIGHT) { #ifdef CONFIG_BOARD_NATIVE_POSIX // Until there is a better way to go back without access to buttons. - application_manager_exit_app(); + zsw_app_manager_exit_app(); #endif } } @@ -536,11 +529,11 @@ static void click_feedback(struct _lv_indev_drv_t *drv, uint8_t e) static void on_ble_data_callback(ble_comm_cb_data_t *cb) { - not_mngr_notification_t *parsed_not; + zsw_not_mngr_notification_t *parsed_not; switch (cb->type) { case BLE_COMM_DATA_TYPE_NOTIFY: - parsed_not = notification_manager_add(&cb->data.notify); + parsed_not = zsw_notification_manager_add(&cb->data.notify); if (!parsed_not) { return; } @@ -571,7 +564,7 @@ static void on_zbus_ble_data_callback(const struct zbus_channel *chan) // Handled in ble_comm callback for now break; case BLE_COMM_DATA_TYPE_NOTIFY_REMOVE: - if (notification_manager_remove(event->data.data.notify_remove.id) != 0) { + if (zsw_notification_manager_remove(event->data.data.notify_remove.id) != 0) { LOG_WRN("Notification %d not found", event->data.data.notify_remove.id); } break; @@ -589,8 +582,8 @@ static void on_zbus_ble_data_callback(const struct zbus_channel *chan) if (event->data.data.remote_control.button == 4) { zsw_power_manager_reset_idle_timout(); if (watch_state == APPLICATION_MANAGER_STATE) { - application_manager_delete(); - application_manager_set_index(0); + zsw_app_manager_delete(); + zsw_app_manager_set_index(0); is_buttons_for_lvgl = false; watch_state = WATCHFACE_STATE; watchface_app_start(input_group, on_watchface_app_event_callback); diff --git a/app/src/manager/notification_manager.h b/app/src/manager/notification_manager.h deleted file mode 100644 index efd338d6..00000000 --- a/app/src/manager/notification_manager.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef __NOTIFICATION_MANAGERH_ -#define __NOTIFICATION_MANAGERH_ - -#include - -#include "ble/ble_comm.h" - -#define NOTIFICATION_MGR_MAX_FIELD_LEN 50 -#define NOTIFICATION_MANAGER_MAX_STORED 20 - -typedef enum notification_src { - NOTIFICATION_SRC_MESSENGER, - NOTIFICATION_SRC_GMAIL, - NOTIFICATION_SRC_NONE -} notification_src_t; - -typedef struct not_mngr_notification { - uint32_t id; - char sender[NOTIFICATION_MGR_MAX_FIELD_LEN]; - char title[NOTIFICATION_MGR_MAX_FIELD_LEN]; - char body[NOTIFICATION_MGR_MAX_FIELD_LEN]; - notification_src_t src; -} not_mngr_notification_t; - -void notification_manager_init(void); -not_mngr_notification_t *notification_manager_add(ble_comm_notify_t *notification); -int32_t notification_manager_remove(uint32_t id); -int32_t notification_manager_get(uint32_t id, not_mngr_notification_t *notifcation); -int32_t notification_manager_get_all(not_mngr_notification_t *notifcations, int *num_notifications); -int32_t notification_manager_get_num(void); -not_mngr_notification_t *notification_manager_get_newest(void); - -#endif \ No newline at end of file diff --git a/app/src/manager/application_manager.c b/app/src/managers/zsw_app_manager.c similarity index 94% rename from app/src/manager/application_manager.c rename to app/src/managers/zsw_app_manager.c index 6342a1dc..fc05239c 100644 --- a/app/src/manager/application_manager.c +++ b/app/src/managers/zsw_app_manager.c @@ -2,7 +2,7 @@ #include #include -#include "manager/application_manager.h" +#include "managers/zsw_app_manager.h" LOG_MODULE_REGISTER(APP_MANAGER, LOG_LEVEL_INF); @@ -20,7 +20,7 @@ static uint8_t num_visible_apps; static uint8_t current_app; static lv_obj_t *root_obj; static lv_group_t *group_obj; -static on_application_manager_cb_fn close_cb_func; +static on_app_manager_cb_fn close_cb_func; static lv_obj_t *grid; static uint8_t last_index; static bool app_launch_only; @@ -90,14 +90,14 @@ static void async_app_close(lv_timer_t *timer) apps[current_app]->stop_func(); current_app = INVALID_APP_ID; if (app_launch_only) { - application_manager_delete(); + zsw_app_manager_delete(); close_cb_func(); } else { draw_application_picker(); } } else { // No app running, then close whole application_manager - application_manager_delete(); + zsw_app_manager_delete(); close_cb_func(); } } @@ -239,7 +239,7 @@ static void draw_application_picker(void) lv_obj_scroll_to_view(lv_obj_get_child(grid, apps[last_index]->private_list_index), LV_ANIM_OFF); } -int application_manager_show(on_application_manager_cb_fn close_cb, lv_obj_t *root, lv_group_t *group, char *app_name) +int zsw_app_manager_show(on_app_manager_cb_fn close_cb, lv_obj_t *root, lv_group_t *group, char *app_name) { int err = 0; bool app_found; @@ -272,7 +272,7 @@ int application_manager_show(on_application_manager_cb_fn close_cb, lv_obj_t *ro return err; } -void application_manager_delete(void) +void zsw_app_manager_delete(void) { if (current_app < num_apps) { LOG_DBG("Stop force %d", current_app); @@ -281,7 +281,7 @@ void application_manager_delete(void) delete_application_picker(); } -void application_manager_add_application(application_t *app) +void zsw_app_manager_add_application(application_t *app) { __ASSERT_NO_MSG(num_apps < MAX_APPS); apps[num_apps] = app; @@ -292,19 +292,19 @@ void application_manager_add_application(application_t *app) } } -void application_manager_exit_app(void) +void zsw_app_manager_exit_app(void) { lv_timer_t *timer = lv_timer_create(async_app_close, 500, NULL); lv_timer_set_repeat_count(timer, 1); } -void application_manager_app_close_request(application_t *app) +void zsw_app_manager_app_close_request(application_t *app) { - LOG_DBG("application_manager_app_close_request"); - application_manager_exit_app(); + LOG_DBG("zsw_app_manager_app_close_request"); + zsw_app_manager_exit_app(); } -void application_manager_set_index(int index) +void zsw_app_manager_set_index(int index) { __ASSERT_NO_MSG(index >= 0 && index < num_apps); diff --git a/app/src/manager/application_manager.h b/app/src/managers/zsw_app_manager.h similarity index 50% rename from app/src/manager/application_manager.h rename to app/src/managers/zsw_app_manager.h index b44c9473..0218eb58 100644 --- a/app/src/manager/application_manager.h +++ b/app/src/managers/zsw_app_manager.h @@ -5,7 +5,7 @@ typedef void(*application_start_fn)(lv_obj_t *root, lv_group_t *group); typedef void(*application_stop_fn)(void); -typedef void(*on_application_manager_cb_fn)(void); +typedef void(*on_app_manager_cb_fn)(void); typedef struct application_t { application_start_fn start_func; @@ -16,14 +16,14 @@ typedef struct application_t { uint8_t private_list_index; } application_t; -int application_manager_show(on_application_manager_cb_fn close_cb, lv_obj_t *root, lv_group_t *group, char *app_name); +int zsw_app_manager_show(on_app_manager_cb_fn close_cb, lv_obj_t *root, lv_group_t *group, char *app_name); -void application_manager_delete(void); +void zsw_app_manager_delete(void); -void application_manager_add_application(application_t *app); +void zsw_app_manager_add_application(application_t *app); -void application_manager_app_close_request(application_t *app); +void zsw_app_manager_app_close_request(application_t *app); -void application_manager_exit_app(void); +void zsw_app_manager_exit_app(void); -void application_manager_set_index(int index); +void zsw_app_manager_set_index(int index); diff --git a/app/src/manager/zsw_battery_manager.c b/app/src/managers/zsw_battery_manager.c similarity index 98% rename from app/src/manager/zsw_battery_manager.c rename to app/src/managers/zsw_battery_manager.c index bb08aab7..9e18de3c 100644 --- a/app/src/manager/zsw_battery_manager.c +++ b/app/src/managers/zsw_battery_manager.c @@ -22,7 +22,7 @@ #include "battery/battery.h" #include "events/battery_event.h" -#include "manager/zsw_battery_manager.h" +#include "managers/zsw_battery_manager.h" LOG_MODULE_REGISTER(zsw_battery_manager, LOG_LEVEL_WRN); diff --git a/app/src/manager/zsw_battery_manager.h b/app/src/managers/zsw_battery_manager.h similarity index 100% rename from app/src/manager/zsw_battery_manager.h rename to app/src/managers/zsw_battery_manager.h diff --git a/app/src/manager/notification_manager.c b/app/src/managers/zsw_notification_manager.c similarity index 88% rename from app/src/manager/notification_manager.c rename to app/src/managers/zsw_notification_manager.c index 2b7f1783..26b529d2 100644 --- a/app/src/manager/notification_manager.c +++ b/app/src/managers/zsw_notification_manager.c @@ -1,6 +1,6 @@ #include -#include "notification_manager.h" +#include "zsw_notification_manager.h" #define NOTIFICATION_INVALID_ID 0xFFFFFFFF #define NOTIFICATION_INVALID_INDEX 0xFFFFFFFF @@ -10,11 +10,11 @@ static uint32_t find_notification_idx(uint32_t id); static uint32_t find_oldest_notification_idx(void); static uint32_t find_newest_notification_idx(void); -static not_mngr_notification_t notifications[NOTIFICATION_MANAGER_MAX_STORED]; +static zsw_not_mngr_notification_t notifications[NOTIFICATION_MANAGER_MAX_STORED]; static uint8_t num_notifications; -static not_mngr_notification_t *active_notification; +static zsw_not_mngr_notification_t *active_notification; -void notification_manager_init(void) +void zsw_notification_manager_init(void) { memset(notifications, 0, sizeof(notifications)); for (int i = 0; i < NOTIFICATION_MANAGER_MAX_STORED; i++) { @@ -24,7 +24,7 @@ void notification_manager_init(void) active_notification = NULL; } -not_mngr_notification_t *notification_manager_add(ble_comm_notify_t *not) +zsw_not_mngr_notification_t *zsw_notification_manager_add(ble_comm_notify_t *not) { uint32_t idx = find_free_notification_idx(); if (idx == NOTIFICATION_INVALID_INDEX) { @@ -34,7 +34,7 @@ not_mngr_notification_t *notification_manager_add(ble_comm_notify_t *not) notifications[idx].id = NOTIFICATION_INVALID_ID; num_notifications--; } - memset(¬ifications[idx], 0, sizeof(not_mngr_notification_t)); + memset(¬ifications[idx], 0, sizeof(zsw_not_mngr_notification_t)); if (strncmp(not->src, "Messenger", not->src_len) == 0) { notifications[idx].src = NOTIFICATION_SRC_MESSENGER; notifications[idx].id = not->id; @@ -71,7 +71,7 @@ not_mngr_notification_t *notification_manager_add(ble_comm_notify_t *not) return ¬ifications[idx]; } -int32_t notification_manager_remove(uint32_t id) +int32_t zsw_notification_manager_remove(uint32_t id) { uint32_t idx = find_notification_idx(id); if (idx != NOTIFICATION_INVALID_INDEX) { @@ -83,7 +83,7 @@ int32_t notification_manager_remove(uint32_t id) } } -int32_t notification_manager_get_all(not_mngr_notification_t *nots, int *num_notifications) +int32_t zsw_notification_manager_get_all(zsw_not_mngr_notification_t *nots, int *num_notifications) { int num_stored = 0; for (int i = 0; i < NOTIFICATION_MANAGER_MAX_STORED; i++) { @@ -96,12 +96,12 @@ int32_t notification_manager_get_all(not_mngr_notification_t *nots, int *num_not return 0; } -int32_t notification_manager_get_num(void) +int32_t zsw_notification_manager_get_num(void) { return num_notifications; } -not_mngr_notification_t *notification_manager_get_newest(void) +zsw_not_mngr_notification_t *zsw_notification_manager_get_newest(void) { int idx = find_newest_notification_idx(); if (idx != NOTIFICATION_INVALID_ID) { diff --git a/app/src/managers/zsw_notification_manager.h b/app/src/managers/zsw_notification_manager.h new file mode 100644 index 00000000..e5587c1d --- /dev/null +++ b/app/src/managers/zsw_notification_manager.h @@ -0,0 +1,33 @@ +#ifndef __ZSW_NOTIFICATION_MANAGER_H_ +#define __ZSW_NOTIFICATION_MANAGER_H_ + +#include + +#include "ble/ble_comm.h" + +#define NOTIFICATION_MGR_MAX_FIELD_LEN 50 +#define NOTIFICATION_MANAGER_MAX_STORED 20 + +typedef enum zsw_notification_src { + NOTIFICATION_SRC_MESSENGER, + NOTIFICATION_SRC_GMAIL, + NOTIFICATION_SRC_NONE +} zsw_notification_src_t; + +typedef struct not_mngr_notification { + uint32_t id; + char sender[NOTIFICATION_MGR_MAX_FIELD_LEN]; + char title[NOTIFICATION_MGR_MAX_FIELD_LEN]; + char body[NOTIFICATION_MGR_MAX_FIELD_LEN]; + zsw_notification_src_t src; +} zsw_not_mngr_notification_t; + +void zsw_notification_manager_init(void); +zsw_not_mngr_notification_t *zsw_notification_manager_add(ble_comm_notify_t *notification); +int32_t zsw_notification_manager_remove(uint32_t id); +int32_t zsw_notification_manager_get(uint32_t id, zsw_not_mngr_notification_t *notifcation); +int32_t zsw_notification_manager_get_all(zsw_not_mngr_notification_t *notifcations, int *num_notifications); +int32_t zsw_notification_manager_get_num(void); +zsw_not_mngr_notification_t *zsw_notification_manager_get_newest(void); + +#endif \ No newline at end of file diff --git a/app/src/zsw_phone_app_publisher.c b/app/src/managers/zsw_phone_app_publisher.c similarity index 98% rename from app/src/zsw_phone_app_publisher.c rename to app/src/managers/zsw_phone_app_publisher.c index 9a92ef9e..a3b56331 100644 --- a/app/src/zsw_phone_app_publisher.c +++ b/app/src/managers/zsw_phone_app_publisher.c @@ -28,7 +28,7 @@ #include "battery/zsw_charger.h" #include "events/chg_event.h" #include "events/battery_event.h" -#include "manager/zsw_battery_manager.h" +#include "managers/zsw_battery_manager.h" LOG_MODULE_REGISTER(zsw_phone_app_publisher, LOG_LEVEL_DBG); diff --git a/app/src/manager/zsw_power_manager.c b/app/src/managers/zsw_power_manager.c similarity index 95% rename from app/src/manager/zsw_power_manager.c rename to app/src/managers/zsw_power_manager.c index 89eb3b83..eda10be5 100644 --- a/app/src/manager/zsw_power_manager.c +++ b/app/src/managers/zsw_power_manager.c @@ -19,14 +19,14 @@ #include #include #include -#include +#include "drivers/zsw_display_control.h" #include #include #include #include #include -#include "manager/zsw_power_manager.h" +#include "managers/zsw_power_manager.h" LOG_MODULE_REGISTER(zsw_power_manager, LOG_LEVEL_INF); @@ -59,7 +59,7 @@ static void enter_inactive(void) is_active = false; retained.wakeup_time += k_uptime_get_32() - last_wakeup_time; retained_update(); - display_control_sleep_ctrl(false); + zsw_display_control_sleep_ctrl(false); zsw_cpu_set_freq(ZSW_CPU_FREQ_DEFAULT, true); @@ -85,8 +85,8 @@ static void enter_active(void) // and the SPI transmit time. zsw_cpu_set_freq(ZSW_CPU_FREQ_FAST, true); - ret = display_control_pwr_ctrl(true); - display_control_sleep_ctrl(true); + ret = zsw_display_control_pwr_ctrl(true); + zsw_display_control_sleep_ctrl(true); if (ret == 0) { retained.display_off_time += k_uptime_get_32() - last_pwr_off_time; @@ -173,7 +173,7 @@ static void zbus_accel_data_callback(const struct zbus_channel *chan) if (!is_active) { is_stationary = true; last_pwr_off_time = k_uptime_get(); - display_control_pwr_ctrl(false); + zsw_display_control_pwr_ctrl(false); zsw_imu_feature_enable(ZSW_IMU_FEATURE_ANY_MOTION, true); zsw_imu_feature_disable(ZSW_IMU_FEATURE_NO_MOTION); @@ -185,7 +185,7 @@ static void zbus_accel_data_callback(const struct zbus_channel *chan) LOG_INF("Watch moved, init display"); if (!is_active) { is_stationary = false; - display_control_pwr_ctrl(true); + zsw_display_control_pwr_ctrl(true); retained.display_off_time += k_uptime_get_32() - last_pwr_off_time; retained_update(); zsw_imu_feature_enable(ZSW_IMU_FEATURE_NO_MOTION, true); diff --git a/app/src/manager/zsw_power_manager.h b/app/src/managers/zsw_power_manager.h similarity index 100% rename from app/src/manager/zsw_power_manager.h rename to app/src/managers/zsw_power_manager.h diff --git a/app/src/ui/notification/zsw_popup_notifcation.c b/app/src/ui/notification/zsw_popup_notifcation.c index 186f3e26..58f4597c 100644 --- a/app/src/ui/notification/zsw_popup_notifcation.c +++ b/app/src/ui/notification/zsw_popup_notifcation.c @@ -19,7 +19,7 @@ static uint32_t active_notif_id; static lv_timer_t *auto_close_timer; static notif_box_t notif_box; -void zsw_notification_popup_show(char *title, char *body, notification_src_t icon, uint32_t id, +void zsw_notification_popup_show(char *title, char *body, zsw_notification_src_t icon, uint32_t id, on_close_notif_cb_t close_cb, uint32_t close_after_seconds) { diff --git a/app/src/ui/notification/zsw_popup_notifcation.h b/app/src/ui/notification/zsw_popup_notifcation.h index 4af45c65..958debf0 100644 --- a/app/src/ui/notification/zsw_popup_notifcation.h +++ b/app/src/ui/notification/zsw_popup_notifcation.h @@ -1,11 +1,11 @@ #ifndef __ZSW_POPUP_NOTIFCATION_H #define __ZSW_POPUP_NOTIFCATION_H -#include "manager/notification_manager.h" +#include "managers/zsw_notification_manager.h" typedef void (*on_close_notif_cb_t)(uint32_t id); -void zsw_notification_popup_show(char *title, char *body, notification_src_t icon, uint32_t id, +void zsw_notification_popup_show(char *title, char *body, zsw_notification_src_t icon, uint32_t id, on_close_notif_cb_t close_cb, uint32_t close_after_seconds); diff --git a/app/src/ui/popup/zsw_popup_window.c b/app/src/ui/popup/zsw_popup_window.c index 56a60be4..18e45262 100644 --- a/app/src/ui/popup/zsw_popup_window.c +++ b/app/src/ui/popup/zsw_popup_window.c @@ -1,4 +1,4 @@ -#include "manager/zsw_power_manager.h" +#include "managers/zsw_power_manager.h" #include "ui/popup/zsw_popup_window.h" static void on_popup_closed(lv_event_t *e);