diff options
author | ConfuSomu | 2021-08-20 15:53:29 +0200 |
---|---|---|
committer | ConfuSomu | 2021-08-20 15:53:29 +0200 |
commit | 7c4ed9a4261b3c4ebb6bf5f1047507170f7c7e16 (patch) | |
tree | 20a6082e20e7d11e554b90645774d809e43053d4 | |
parent | 74b05b65b2dcd2a7428fa06c6c15e4c8f68f0534 (diff) | |
download | pico-watch-7c4ed9a4261b3c4ebb6bf5f1047507170f7c7e16.tar pico-watch-7c4ed9a4261b3c4ebb6bf5f1047507170f7c7e16.tar.gz pico-watch-7c4ed9a4261b3c4ebb6bf5f1047507170f7c7e16.zip |
Tidy up project tree; move api, appMgr and BaseApp
-rw-r--r-- | CMakeLists.txt | 5 | ||||
-rw-r--r-- | app/app_manager.cpp (renamed from app_manager.cpp) | 10 | ||||
-rw-r--r-- | app/app_manager.hpp (renamed from app_manager.hpp) | 0 | ||||
-rw-r--r-- | app/base_app.hpp (renamed from base_app.hpp) | 2 | ||||
-rw-r--r-- | apps/home_menu/main.cpp | 2 | ||||
-rw-r--r-- | apps/home_menu/main.hpp | 2 | ||||
-rw-r--r-- | apps/main_clock/main.hpp | 2 | ||||
-rw-r--r-- | apps/settings/main.hpp | 2 | ||||
-rw-r--r-- | buttons.cpp | 4 | ||||
-rw-r--r-- | globals.hpp | 2 | ||||
-rw-r--r-- | hal/api.cpp (renamed from api.cpp) | 4 | ||||
-rw-r--r-- | hal/api.hpp (renamed from api.hpp) | 4 | ||||
-rw-r--r-- | pico-watch.cpp | 4 |
13 files changed, 21 insertions, 22 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index fe8dc50..0efeb1f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,13 +40,12 @@ target_link_libraries(Oled pico_stdlib hardware_i2c) # Main code add_executable(pico-watch pico-watch.cpp - app_manager.cpp + app/app_manager.cpp init.cpp init.hpp buttons.cpp buttons.hpp - api.cpp - api.hpp + hal/api.cpp apps/home_menu/main.cpp apps/home_menu/main.hpp apps/main_clock/main.cpp diff --git a/app_manager.cpp b/app/app_manager.cpp index 68aa3b9..01bf3fd 100644 --- a/app_manager.cpp +++ b/app/app_manager.cpp @@ -1,13 +1,13 @@ #include <algorithm> #include "app_manager.hpp" -#include "api.hpp" -#include "globals.hpp" +#include "../hal/api.hpp" +#include "../globals.hpp" // App classes following: -#include "apps/main_clock/main.hpp" -#include "apps/home_menu/main.hpp" -#include "apps/settings/main.hpp" +#include "../apps/main_clock/main.hpp" +#include "../apps/home_menu/main.hpp" +#include "../apps/settings/main.hpp" #define NUMBER_OF_APPS 3 // From pico-watch.c: diff --git a/app_manager.hpp b/app/app_manager.hpp index b7783ea..b7783ea 100644 --- a/app_manager.hpp +++ b/app/app_manager.hpp diff --git a/base_app.hpp b/app/base_app.hpp index 3615df3..c9367de 100644 --- a/base_app.hpp +++ b/app/base_app.hpp @@ -1,5 +1,5 @@ #pragma once -#include "api.hpp" +#include "../hal/api.hpp" // Base app class BaseApp { diff --git a/apps/home_menu/main.cpp b/apps/home_menu/main.cpp index 4508e38..bf47e1e 100644 --- a/apps/home_menu/main.cpp +++ b/apps/home_menu/main.cpp @@ -2,7 +2,7 @@ #include "pico/stdlib.h" #include "../../globals.hpp" -#include "../../app_manager.hpp" +#include "../../app/app_manager.hpp" #include "main.hpp" extern bool rtc_get_datetime(datetime_t *t); diff --git a/apps/home_menu/main.hpp b/apps/home_menu/main.hpp index d82e2a0..0e13c3f 100644 --- a/apps/home_menu/main.hpp +++ b/apps/home_menu/main.hpp @@ -3,7 +3,7 @@ #include "pico/util/datetime.h" // Includes also buttons, API and ss_oled -#include "../../base_app.hpp" +#include "../../app/base_app.hpp" #define NUMBER_OF_APPS 3 #define SIZE_APP_NAME 12 diff --git a/apps/main_clock/main.hpp b/apps/main_clock/main.hpp index 7c07cb3..0919fd7 100644 --- a/apps/main_clock/main.hpp +++ b/apps/main_clock/main.hpp @@ -3,7 +3,7 @@ #include "pico/util/datetime.h" // Includes also buttons, API and ss_oled -#include "../../base_app.hpp" +#include "../../app/base_app.hpp" class app_main_clock : public BaseApp { private: diff --git a/apps/settings/main.hpp b/apps/settings/main.hpp index d53b8a9..c425033 100644 --- a/apps/settings/main.hpp +++ b/apps/settings/main.hpp @@ -1,5 +1,5 @@ #pragma once -#include "../../base_app.hpp" +#include "../../app/base_app.hpp" #include "strings.hpp" class app_settings : public BaseApp { diff --git a/buttons.cpp b/buttons.cpp index a4eacab..1b92aa6 100644 --- a/buttons.cpp +++ b/buttons.cpp @@ -3,8 +3,8 @@ #include "buttons.hpp" #include "globals.hpp" -#include "api.hpp" -#include "app_manager.hpp" +#include "hal/api.hpp" +#include "app/app_manager.hpp" // From pico-watch.c: extern Api app_api; diff --git a/globals.hpp b/globals.hpp index 7c6b866..fd24542 100644 --- a/globals.hpp +++ b/globals.hpp @@ -1,5 +1,5 @@ #pragma once -#include "base_app.hpp" +#include "app/base_app.hpp" struct global_status { BaseApp* foreground_app = 0; @@ -5,8 +5,8 @@ extern "C" { } #include "api.hpp" -#include "init.hpp" -#include "globals.hpp" +#include "../init.hpp" +#include "../globals.hpp" void Api::init() { if (!m_init_done) { @@ -2,9 +2,9 @@ #include <iostream> #include "pico/util/datetime.h" -#include "oled/ss_oled.h" +#include "../oled/ss_oled.h" -#include "buttons.hpp" +#include "../buttons.hpp" class Api { private: diff --git a/pico-watch.cpp b/pico-watch.cpp index b1d0c13..54e78f4 100644 --- a/pico-watch.cpp +++ b/pico-watch.cpp @@ -6,10 +6,10 @@ #include "pico/util/datetime.h" #include "init.hpp" -#include "api.hpp" +#include "hal/api.hpp" #include "buttons.hpp" #include "globals.hpp" -#include "app_manager.hpp" +#include "app/app_manager.hpp" global_status g_s; user_settings g_user; |