Merge pull request #136 from okaestne/include-cleanup

Includes cleanup
This commit is contained in:
JF002 2020-12-01 21:44:44 +01:00 committed by GitHub
commit c6556bcdea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
91 changed files with 391 additions and 434 deletions

View File

@ -1,8 +1,7 @@
#include <drivers/include/nrfx_saadc.h> #include "BatteryController.h"
#include <hal/nrf_gpio.h> #include <hal/nrf_gpio.h>
#include <libraries/log/nrf_log.h> #include <libraries/log/nrf_log.h>
#include <algorithm> #include <algorithm>
#include "BatteryController.h"
using namespace Pinetime::Controllers; using namespace Pinetime::Controllers;

View File

@ -1,7 +1,7 @@
#pragma once #pragma once
#include <cstdint>
#include <drivers/include/nrfx_saadc.h> #include <drivers/include/nrfx_saadc.h>
namespace Pinetime { namespace Pinetime {
namespace Controllers { namespace Controllers {
class Battery { class Battery {

View File

@ -1,7 +1,7 @@
#include <systemtask/SystemTask.h>
#include "NotificationManager.h"
#include "AlertNotificationClient.h" #include "AlertNotificationClient.h"
#include <algorithm>
#include "NotificationManager.h"
#include "systemtask/SystemTask.h"
using namespace Pinetime::Controllers; using namespace Pinetime::Controllers;
constexpr ble_uuid16_t AlertNotificationClient::ansServiceUuid; constexpr ble_uuid16_t AlertNotificationClient::ansServiceUuid;
@ -159,8 +159,8 @@ void AlertNotificationClient::OnNotification(ble_gap_event *event) {
const auto maxBufferSize{maxMessageSize + headerSize}; const auto maxBufferSize{maxMessageSize + headerSize};
const auto dbgPacketLen = OS_MBUF_PKTLEN(event->notify_rx.om); const auto dbgPacketLen = OS_MBUF_PKTLEN(event->notify_rx.om);
size_t bufferSize = min(dbgPacketLen + stringTerminatorSize, maxBufferSize); size_t bufferSize = std::min(dbgPacketLen + stringTerminatorSize, maxBufferSize);
auto messageSize = min(maxMessageSize, (bufferSize - headerSize)); auto messageSize = std::min(maxMessageSize, (bufferSize - headerSize));
NotificationManager::Notification notif; NotificationManager::Notification notif;
os_mbuf_copydata(event->notify_rx.om, headerSize, messageSize - 1, notif.message.data()); os_mbuf_copydata(event->notify_rx.om, headerSize, messageSize - 1, notif.message.data());

View File

@ -1,13 +1,23 @@
#pragma once #pragma once
#include <cstdint> #include <cstdint>
#include <array> #include <functional>
#define min // workaround: nimble's min/max macros conflict with libstdc++
#define max
#include <host/ble_gap.h> #include <host/ble_gap.h>
#undef max
#undef min
#include "BleClient.h" #include "BleClient.h"
namespace Pinetime { namespace Pinetime {
namespace System {
class SystemTask;
}
namespace Controllers { namespace Controllers {
class NotificationManager;
class AlertNotificationClient : public BleClient { class AlertNotificationClient : public BleClient {
public: public:
explicit AlertNotificationClient(Pinetime::System::SystemTask &systemTask, explicit AlertNotificationClient(Pinetime::System::SystemTask &systemTask,

View File

@ -1,10 +1,9 @@
#include <hal/nrf_rtc.h>
#include "NotificationManager.h"
#include <systemtask/SystemTask.h>
#include "AlertNotificationService.h" #include "AlertNotificationService.h"
#include <hal/nrf_rtc.h>
#include <cstring> #include <cstring>
#include <algorithm>
#include "NotificationManager.h"
#include "systemtask/SystemTask.h"
using namespace Pinetime::Controllers; using namespace Pinetime::Controllers;
@ -60,8 +59,8 @@ int AlertNotificationService::OnAlert(uint16_t conn_handle, uint16_t attr_handle
const auto maxBufferSize{maxMessageSize + headerSize}; const auto maxBufferSize{maxMessageSize + headerSize};
const auto dbgPacketLen = OS_MBUF_PKTLEN(ctxt->om); const auto dbgPacketLen = OS_MBUF_PKTLEN(ctxt->om);
size_t bufferSize = min(dbgPacketLen + stringTerminatorSize, maxBufferSize); size_t bufferSize = std::min(dbgPacketLen + stringTerminatorSize, maxBufferSize);
auto messageSize = min(maxMessageSize, (bufferSize-headerSize)); auto messageSize = std::min(maxMessageSize, (bufferSize-headerSize));
NotificationManager::Notification notif; NotificationManager::Notification notif;
os_mbuf_copydata(ctxt->om, headerSize, messageSize-1, notif.message.data()); os_mbuf_copydata(ctxt->om, headerSize, messageSize-1, notif.message.data());

View File

@ -1,10 +1,20 @@
#pragma once #pragma once
#include <cstdint> #include <cstdint>
#include <array> #include <array>
#define min // workaround: nimble's min/max macros conflict with libstdc++
#define max
#include <host/ble_gap.h> #include <host/ble_gap.h>
#undef max
#undef min
namespace Pinetime { namespace Pinetime {
namespace System {
class SystemTask;
}
namespace Controllers { namespace Controllers {
class NotificationManager;
class AlertNotificationService { class AlertNotificationService {
public: public:
AlertNotificationService(Pinetime::System::SystemTask &systemTask, AlertNotificationService(Pinetime::System::SystemTask &systemTask,

View File

@ -1,5 +1,9 @@
#pragma once #pragma once
#define min // workaround: nimble's min/max macros conflict with libstdc++
#define max
#include <host/ble_gap.h> #include <host/ble_gap.h>
#undef max
#undef min
namespace Pinetime { namespace Pinetime {
namespace System { namespace System {

View File

@ -1,5 +1,3 @@
#include <cstring>
#include <cstdlib>
#include "BleController.h" #include "BleController.h"
using namespace Pinetime::Controllers; using namespace Pinetime::Controllers;

View File

@ -1,8 +1,7 @@
#pragma once #pragma once
#include <FreeRTOS.h>
#include <queue.h>
#include <array> #include <array>
#include <cstdint>
namespace Pinetime { namespace Pinetime {
namespace Controllers { namespace Controllers {

View File

@ -1,5 +1,6 @@
#include <hal/nrf_rtc.h>
#include "CurrentTimeClient.h" #include "CurrentTimeClient.h"
#include <hal/nrf_rtc.h>
#include "components/datetime/DateTimeController.h"
using namespace Pinetime::Controllers; using namespace Pinetime::Controllers;

View File

@ -1,13 +1,15 @@
#pragma once #pragma once
#include <cstdint> #define min // workaround: nimble's min/max macros conflict with libstdc++
#include <array> #define max
#include "components/datetime/DateTimeController.h"
#include "BleClient.h"
#include <host/ble_gap.h> #include <host/ble_gap.h>
#undef max
#undef min
#include <cstdint>
#include "BleClient.h"
namespace Pinetime { namespace Pinetime {
namespace Controllers { namespace Controllers {
class DateTime;
class CurrentTimeClient : public BleClient { class CurrentTimeClient : public BleClient {
public: public:

View File

@ -3,7 +3,11 @@
#include <array> #include <array>
#include "components/datetime/DateTimeController.h" #include "components/datetime/DateTimeController.h"
#define min // workaround: nimble's min/max macros conflict with libstdc++
#define max
#include <host/ble_gap.h> #include <host/ble_gap.h>
#undef max
#undef min
namespace Pinetime { namespace Pinetime {
namespace Controllers { namespace Controllers {

View File

@ -1,9 +1,10 @@
#pragma once #pragma once
#include <cstdint> #define min // workaround: nimble's min/max macros conflict with libstdc++
#include <array> #define max
#include <host/ble_gap.h> #include <host/ble_gap.h>
#include <Version.h> #undef max
#undef min
#include "Version.h"
namespace Pinetime { namespace Pinetime {
namespace Controllers { namespace Controllers {

View File

@ -1,8 +1,8 @@
#include <cstring>
#include "components/ble/BleController.h"
#include "systemtask/SystemTask.h"
#include "DfuService.h" #include "DfuService.h"
#include <cstring>
#include "components/ble/BleController.h"
#include "drivers/SpiNorFlash.h"
#include "systemtask/SystemTask.h"
using namespace Pinetime::Controllers; using namespace Pinetime::Controllers;

View File

@ -3,7 +3,11 @@
#include <cstdint> #include <cstdint>
#include <array> #include <array>
#define min // workaround: nimble's min/max macros conflict with libstdc++
#define max
#include <host/ble_gap.h> #include <host/ble_gap.h>
#undef max
#undef min
namespace Pinetime { namespace Pinetime {
namespace System { namespace System {

View File

@ -1,7 +1,7 @@
#include <systemtask/SystemTask.h>
#include <cstring>
#include "ImmediateAlertService.h" #include "ImmediateAlertService.h"
#include "AlertNotificationService.h" #include <cstring>
#include "NotificationManager.h"
#include "systemtask/SystemTask.h"
using namespace Pinetime::Controllers; using namespace Pinetime::Controllers;

View File

@ -1,5 +1,9 @@
#pragma once #pragma once
#define min // workaround: nimble's min/max macros conflict with libstdc++
#define max
#include <host/ble_gap.h> #include <host/ble_gap.h>
#undef max
#undef min
namespace Pinetime { namespace Pinetime {
namespace System { namespace System {

View File

@ -15,8 +15,8 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
#include <systemtask/SystemTask.h>
#include "MusicService.h" #include "MusicService.h"
#include "systemtask/SystemTask.h"
int MSCallback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt, void *arg) { int MSCallback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt, void *arg) {
auto musicService = static_cast<Pinetime::Controllers::MusicService *>(arg); auto musicService = static_cast<Pinetime::Controllers::MusicService *>(arg);

View File

@ -18,10 +18,13 @@
#pragma once #pragma once
#include <cstdint> #include <cstdint>
#include <array> #include <string>
#define min // workaround: nimble's min/max macros conflict with libstdc++
#define max
#include <host/ble_gap.h> #include <host/ble_gap.h>
#include <host/ble_uuid.h> #include <host/ble_uuid.h>
#include <string> #undef max
#undef min
//c7e50000-78fc-48fe-8e23-43b37a1942d0 //c7e50000-78fc-48fe-8e23-43b37a1942d0
#define MUSIC_SERVICE_UUID_BASE {0xd0, 0x42, 0x19, 0x3a, 0x3b, 0x43, 0x23, 0x8e, 0xfe, 0x48, 0xfc, 0x78, 0x00, 0x00, 0xe5, 0xc7} #define MUSIC_SERVICE_UUID_BASE {0xd0, 0x42, 0x19, 0x3a, 0x3b, 0x43, 0x23, 0x8e, 0xfe, 0x48, 0xfc, 0x78, 0x00, 0x00, 0xe5, 0xc7}

View File

@ -1,15 +1,19 @@
#include "components/datetime/DateTimeController.h"
#include <systemtask/SystemTask.h>
#include "components/ble/NotificationManager.h"
#include <hal/nrf_rtc.h>
#include "NimbleController.h" #include "NimbleController.h"
#include "MusicService.h" #include <hal/nrf_rtc.h>
#include <services/gatt/ble_svc_gatt.h> #define min // workaround: nimble's min/max macros conflict with libstdc++
#include <services/gap/ble_svc_gap.h> #define max
#include <host/util/util.h>
#include <host/ble_hs_id.h>
#include <host/ble_hs.h>
#include <host/ble_gap.h> #include <host/ble_gap.h>
#include <host/ble_hs.h>
#include <host/ble_hs_id.h>
#include <host/util/util.h>
#undef max
#undef min
#include <services/gap/ble_svc_gap.h>
#include <services/gatt/ble_svc_gatt.h>
#include "components/ble/BleController.h"
#include "components/ble/NotificationManager.h"
#include "components/datetime/DateTimeController.h"
#include "systemtask/SystemTask.h"
using namespace Pinetime::Controllers; using namespace Pinetime::Controllers;

View File

@ -2,24 +2,35 @@
#include <cstdint> #include <cstdint>
#include "AlertNotificationService.h" #define min // workaround: nimble's min/max macros conflict with libstdc++
#include "AlertNotificationClient.h" #define max
#include "DeviceInformationService.h"
#include "CurrentTimeClient.h"
#include "DfuService.h"
#include "CurrentTimeService.h"
#include "MusicService.h"
#include "BatteryInformationService.h"
#include "ImmediateAlertService.h"
#include "ServiceDiscovery.h"
#include <host/ble_gap.h> #include <host/ble_gap.h>
#undef max
#undef min
#include "AlertNotificationClient.h"
#include "AlertNotificationService.h"
#include "BatteryInformationService.h"
#include "CurrentTimeClient.h"
#include "CurrentTimeService.h"
#include "DeviceInformationService.h"
#include "DfuService.h"
#include "ImmediateAlertService.h"
#include "MusicService.h"
#include "ServiceDiscovery.h"
namespace Pinetime { namespace Pinetime {
namespace Drivers { namespace Drivers {
class SpiNorFlash; class SpiNorFlash;
} }
namespace System {
class SystemTask;
}
namespace Controllers { namespace Controllers {
class Ble;
class DateTime; class DateTime;
class NotificationManager;
class NimbleController { class NimbleController {

View File

@ -1,6 +1,6 @@
#include "NotificationManager.h"
#include <cstring> #include <cstring>
#include <algorithm> #include <algorithm>
#include "NotificationManager.h"
using namespace Pinetime::Controllers; using namespace Pinetime::Controllers;

View File

@ -2,6 +2,8 @@
#include <array> #include <array>
#include <atomic> #include <atomic>
#include <cstddef>
#include <cstdint>
namespace Pinetime { namespace Pinetime {
namespace Controllers { namespace Controllers {
@ -27,7 +29,7 @@ namespace Pinetime {
bool ClearNewNotificationFlag(); bool ClearNewNotificationFlag();
bool AreNewNotificationsAvailable(); bool AreNewNotificationsAvailable();
static constexpr uint8_t MaximumMessageSize() { return MessageSize; }; static constexpr size_t MaximumMessageSize() { return MessageSize; };
size_t NbNotifications() const; size_t NbNotifications() const;
private: private:

View File

@ -1,5 +1,7 @@
#include <libraries/log/nrf_log.h>
#include "ServiceDiscovery.h" #include "ServiceDiscovery.h"
#include <libraries/log/nrf_log.h>
#include "BleClient.h"
using namespace Pinetime::Controllers; using namespace Pinetime::Controllers;
ServiceDiscovery::ServiceDiscovery(std::array<BleClient*, 2>&& clients) : clients{clients} { ServiceDiscovery::ServiceDiscovery(std::array<BleClient*, 2>&& clients) : clients{clients} {

View File

@ -1,12 +1,12 @@
#pragma once #pragma once
#include <array> #include <array>
#include <functional> #include <cstdint>
#include <memory>
#include "BleClient.h"
namespace Pinetime { namespace Pinetime {
namespace Controllers { namespace Controllers {
class BleClient;
class ServiceDiscovery { class ServiceDiscovery {
public: public:
ServiceDiscovery(std::array<BleClient*, 2>&& bleClients); ServiceDiscovery(std::array<BleClient*, 2>&& bleClients);

View File

@ -1,5 +1,5 @@
#include <hal/nrf_gpio.h>
#include "BrightnessController.h" #include "BrightnessController.h"
#include <hal/nrf_gpio.h>
using namespace Pinetime::Controllers; using namespace Pinetime::Controllers;

View File

@ -1,8 +1,8 @@
#include <drivers/InternalFlash.h>
#include <hal/nrf_rtc.h>
#include "FirmwareValidator.h" #include "FirmwareValidator.h"
#include <hal/nrf_rtc.h>
#include "drivers/InternalFlash.h"
using namespace Pinetime::Controllers; using namespace Pinetime::Controllers;
bool FirmwareValidator::IsValidated() const { bool FirmwareValidator::IsValidated() const {

View File

@ -1,8 +1,5 @@
#include <libraries/svc/nrf_svci.h>
#include <FreeRTOS.h>
#include <task.h>
#include "Gfx.h" #include "Gfx.h"
#include "../../drivers/St7789.h" #include "drivers/St7789.h"
using namespace Pinetime::Components; using namespace Pinetime::Components;
Gfx::Gfx(Pinetime::Drivers::St7789 &lcd) : lcd{lcd} { Gfx::Gfx(Pinetime::Drivers::St7789 &lcd) : lcd{lcd} {

View File

@ -1,10 +1,10 @@
#pragma once #pragma once
#include <cstdint>
#include <nrf_font.h>
#include <drivers/BufferProvider.h>
#include <FreeRTOS.h> #include <FreeRTOS.h>
#include <nrf_font.h>
#include <task.h> #include <task.h>
#include <cstddef>
#include <cstdint>
#include "drivers/BufferProvider.h"
namespace Pinetime { namespace Pinetime {
namespace Drivers { namespace Drivers {

View File

@ -1,25 +1,24 @@
#include <string>
#include "DisplayApp.h" #include "DisplayApp.h"
#include <FreeRTOS.h>
#include <task.h>
#include <libraries/log/nrf_log.h> #include <libraries/log/nrf_log.h>
#include <nrf_font.h> #include "components/battery/BatteryController.h"
#include <queue.h> #include "components/ble/BleController.h"
#include "components/datetime/DateTimeController.h" #include "components/datetime/DateTimeController.h"
#include <drivers/Cst816s.h>
#include "displayapp/screens/Notifications.h"
#include "displayapp/screens/Tile.h"
#include "displayapp/screens/Meter.h"
#include "displayapp/screens/Gauge.h"
#include "displayapp/screens/Brightness.h"
#include "displayapp/screens/SystemInfo.h"
#include "displayapp/screens/Music.h"
#include "components/ble/NotificationManager.h" #include "components/ble/NotificationManager.h"
#include "displayapp/screens/FirmwareUpdate.h"
#include "displayapp/screens/ApplicationList.h" #include "displayapp/screens/ApplicationList.h"
#include "displayapp/screens/Brightness.h"
#include "displayapp/screens/Clock.h"
#include "displayapp/screens/FirmwareUpdate.h"
#include "displayapp/screens/FirmwareValidation.h" #include "displayapp/screens/FirmwareValidation.h"
#include "displayapp/screens/Gauge.h"
#include "displayapp/screens/InfiniPaint.h" #include "displayapp/screens/InfiniPaint.h"
#include "displayapp/screens/Meter.h"
#include "displayapp/screens/Music.h"
#include "displayapp/screens/Notifications.h"
#include "displayapp/screens/SystemInfo.h"
#include "displayapp/screens/Tile.h"
#include "drivers/Cst816s.h"
#include "drivers/St7789.h"
#include "drivers/Watchdog.h"
#include "systemtask/SystemTask.h" #include "systemtask/SystemTask.h"
using namespace Pinetime::Applications; using namespace Pinetime::Applications;

View File

@ -1,28 +1,30 @@
#pragma once #pragma once
#include <FreeRTOS.h> #include <FreeRTOS.h>
#include <task.h>
#include <drivers/St7789.h>
#include <drivers/SpiMaster.h>
#include <bits/unique_ptr.h>
#include <queue.h>
#include "components/gfx/Gfx.h"
#include "components/battery/BatteryController.h"
#include "components/brightness/BrightnessController.h"
#include "components/ble/BleController.h"
#include "components/datetime/DateTimeController.h"
#include "components/ble/NotificationManager.h"
#include "components/firmwarevalidator/FirmwareValidator.h"
#include "drivers/Cst816s.h"
#include "LittleVgl.h"
#include <date/date.h> #include <date/date.h>
#include "displayapp/screens/Clock.h" #include <queue.h>
#include "displayapp/screens/Modal.h" #include <task.h>
#include <drivers/Watchdog.h> #include <memory>
#include "TouchEvents.h"
#include "Apps.h" #include "Apps.h"
#include "LittleVgl.h"
#include "TouchEvents.h"
#include "components/brightness/BrightnessController.h"
#include "components/firmwarevalidator/FirmwareValidator.h"
#include "displayapp/screens/Modal.h"
namespace Pinetime { namespace Pinetime {
namespace Drivers {
class St7789;
class Cst816S;
class WatchdogView;
}
namespace Controllers {
class Battery;
class Ble;
class DateTime;
class NotificationManager;
}
namespace System { namespace System {
class SystemTask; class SystemTask;
}; };

View File

@ -1,15 +1,11 @@
#include <FreeRTOS.h>
#include <projdefs.h>
#include <task.h>
#include <libs/lvgl/src/lv_core/lv_obj.h>
#include <hal/nrf_rtc.h>
#include <libraries/log/nrf_log.h>
#include <libs/lvgl/src/lv_themes/lv_theme.h>
#include <libs/lvgl/src/lv_themes/lv_theme_night.h>
#include "LittleVgl.h" #include "LittleVgl.h"
#include <FreeRTOS.h>
#include <task.h>
//#include <projdefs.h>
#include "drivers/Cst816s.h"
#include "drivers/St7789.h"
using namespace Pinetime::Components; using namespace Pinetime::Components;
extern "C" { extern "C" {

View File

@ -1,12 +1,13 @@
#pragma once #pragma once
#include <libs/lvgl/src/lv_core/lv_style.h> #include <lvgl/lvgl.h>
#include <libs/lvgl/src/lv_themes/lv_theme.h>
#include <libs/lvgl/src/lv_hal/lv_hal.h>
#include <drivers/St7789.h>
#include <drivers/Cst816s.h>
namespace Pinetime { namespace Pinetime {
namespace Drivers {
class Cst816S;
class St7789;
}
namespace Components { namespace Components {
class LittleVgl { class LittleVgl {
public: public:

View File

@ -1,9 +1,10 @@
#include <libs/lvgl/lvgl.h>
#include <displayapp/DisplayApp.h>
#include <functional>
#include "ApplicationList.h" #include "ApplicationList.h"
#include "Tile.h" #include <lvgl/lvgl.h>
#include <array>
#include "Symbols.h" #include "Symbols.h"
#include "Tile.h"
#include "displayapp/Apps.h"
#include "../DisplayApp.h"
using namespace Pinetime::Applications::Screens; using namespace Pinetime::Applications::Screens;

View File

@ -1,14 +1,9 @@
#pragma once #pragma once
#include <functional> #include <memory>
#include <vector>
#include "components/ble/NimbleController.h"
#include "Screen.h" #include "Screen.h"
#include "Label.h"
#include "ScreenList.h" #include "ScreenList.h"
#include "Gauge.h"
#include "Meter.h"
namespace Pinetime { namespace Pinetime {
namespace Applications { namespace Applications {

View File

@ -1,5 +1,6 @@
#include "BatteryIcon.h" #include "BatteryIcon.h"
#include "Symbols.h" #include "Symbols.h"
using namespace Pinetime::Applications::Screens; using namespace Pinetime::Applications::Screens;
const char* BatteryIcon::GetBatteryIcon(float batteryPercent) { const char* BatteryIcon::GetBatteryIcon(float batteryPercent) {

View File

@ -1,7 +1,5 @@
#pragma once #pragma once
#include <libs/lvgl/src/lv_draw/lv_img_decoder.h>
namespace Pinetime { namespace Pinetime {
namespace Applications { namespace Applications {
namespace Screens { namespace Screens {

View File

@ -1,5 +1,5 @@
#include <libs/lvgl/lvgl.h>
#include "Brightness.h" #include "Brightness.h"
#include <lvgl/lvgl.h>
using namespace Pinetime::Applications::Screens; using namespace Pinetime::Applications::Screens;

View File

@ -1,8 +1,9 @@
#pragma once #pragma once
#include <libs/lvgl/src/lv_core/lv_obj.h> #include <lvgl/src/lv_core/lv_obj.h>
#include "components/brightness/BrightnessController.h" #include <cstdint>
#include "Screen.h" #include "Screen.h"
#include "components/brightness/BrightnessController.h"
namespace Pinetime { namespace Pinetime {
namespace Applications { namespace Applications {

View File

@ -1,15 +1,16 @@
#include <cstdio>
#include <libs/date/includes/date/date.h>
#include "components/datetime/DateTimeController.h"
#include <libs/lvgl/lvgl.h>
#include "Clock.h" #include "Clock.h"
#include "../DisplayApp.h"
#include <date/date.h>
#include <lvgl/lvgl.h>
#include <cstdio>
#include "BatteryIcon.h" #include "BatteryIcon.h"
#include "BleIcon.h" #include "BleIcon.h"
#include "Symbols.h"
#include "components/ble/NotificationManager.h"
#include "NotificationIcon.h" #include "NotificationIcon.h"
#include "Symbols.h"
#include "components/battery/BatteryController.h"
#include "components/ble/BleController.h"
#include "components/ble/NotificationManager.h"
#include "../DisplayApp.h"
using namespace Pinetime::Applications::Screens; using namespace Pinetime::Applications::Screens;
extern lv_font_t jetbrains_mono_extrabold_compressed; extern lv_font_t jetbrains_mono_extrabold_compressed;

View File

@ -1,17 +1,19 @@
#pragma once #pragma once
#include <cstdint> #include <lvgl/src/lv_core/lv_obj.h>
#include <chrono> #include <chrono>
#include <cstdint>
#include <memory>
#include "Screen.h" #include "Screen.h"
#include <bits/unique_ptr.h> #include "components/datetime/DateTimeController.h"
#include <libs/lvgl/src/lv_core/lv_style.h>
#include <libs/lvgl/src/lv_core/lv_obj.h>
#include "components/ble/NotificationManager.h"
#include "components/battery/BatteryController.h"
#include "components/ble/BleController.h"
namespace Pinetime { namespace Pinetime {
namespace Controllers {
class Battery;
class Ble;
class NotificationManager;
}
namespace Applications { namespace Applications {
namespace Screens { namespace Screens {
@ -34,7 +36,7 @@ namespace Pinetime {
T value; T value;
bool isUpdated = true; bool isUpdated = true;
}; };
class Clock : public Screen{ class Clock : public Screen {
public: public:
Clock(DisplayApp* app, Clock(DisplayApp* app,
Controllers::DateTime& dateTimeController, Controllers::DateTime& dateTimeController,

View File

@ -1,6 +1,6 @@
#include <libs/lvgl/lvgl.h>
#include <libraries/log/nrf_log.h>
#include "DropDownDemo.h" #include "DropDownDemo.h"
#include <lvgl/lvgl.h>
#include <libraries/log/nrf_log.h>
#include "../DisplayApp.h" #include "../DisplayApp.h"
using namespace Pinetime::Applications::Screens; using namespace Pinetime::Applications::Screens;

View File

@ -2,15 +2,13 @@
#include <cstdint> #include <cstdint>
#include "Screen.h" #include "Screen.h"
#include <bits/unique_ptr.h> #include <lvgl/src/lv_core/lv_obj.h>
#include <libs/lvgl/src/lv_core/lv_style.h>
#include <libs/lvgl/src/lv_core/lv_obj.h>
namespace Pinetime { namespace Pinetime {
namespace Applications { namespace Applications {
namespace Screens { namespace Screens {
class DropDownDemo : public Screen{ class DropDownDemo : public Screen {
public: public:
DropDownDemo(DisplayApp* app); DropDownDemo(DisplayApp* app);
~DropDownDemo() override; ~DropDownDemo() override;

View File

@ -1,5 +1,6 @@
#include <libs/lvgl/lvgl.h>
#include "FirmwareUpdate.h" #include "FirmwareUpdate.h"
#include <lvgl/lvgl.h>
#include "components/ble/BleController.h"
#include "../DisplayApp.h" #include "../DisplayApp.h"
using namespace Pinetime::Applications::Screens; using namespace Pinetime::Applications::Screens;

View File

@ -1,15 +1,12 @@
#pragma once #pragma once
#include <cstdint>
#include <chrono>
#include "Screen.h" #include "Screen.h"
#include <bits/unique_ptr.h> #include <lvgl/src/lv_core/lv_obj.h>
#include <libs/lvgl/src/lv_core/lv_style.h>
#include <libs/lvgl/src/lv_core/lv_obj.h>
#include "components/ble/BleController.h"
namespace Pinetime { namespace Pinetime {
namespace Controllers {
class Ble;
}
namespace Applications { namespace Applications {
namespace Screens { namespace Screens {

View File

@ -1,8 +1,8 @@
#include <libs/lvgl/lvgl.h>
#include "FirmwareValidation.h" #include "FirmwareValidation.h"
#include "../DisplayApp.h" #include <lvgl/lvgl.h>
#include "../../Version.h" #include "Version.h"
#include "components/firmwarevalidator/FirmwareValidator.h" #include "components/firmwarevalidator/FirmwareValidator.h"
#include "../DisplayApp.h"
using namespace Pinetime::Applications::Screens; using namespace Pinetime::Applications::Screens;
extern lv_font_t jetbrains_mono_extrabold_compressed; extern lv_font_t jetbrains_mono_extrabold_compressed;
@ -87,5 +87,3 @@ void FirmwareValidation::OnButtonEvent(lv_obj_t *object, lv_event_t event) {
} }
} }

View File

@ -1,10 +1,7 @@
#pragma once #pragma once
#include <cstdint>
#include "Screen.h" #include "Screen.h"
#include <bits/unique_ptr.h> #include <lvgl/src/lv_core/lv_obj.h>
#include <libs/lvgl/src/lv_core/lv_style.h>
#include <libs/lvgl/src/lv_core/lv_obj.h>
namespace Pinetime { namespace Pinetime {
namespace Controllers { namespace Controllers {

View File

@ -1,4 +1,3 @@
#include <libs/lvgl/lvgl.h>
#include "Gauge.h" #include "Gauge.h"
#include "../DisplayApp.h" #include "../DisplayApp.h"

View File

@ -2,9 +2,7 @@
#include <cstdint> #include <cstdint>
#include "Screen.h" #include "Screen.h"
#include <bits/unique_ptr.h> #include <lvgl/lvgl.h>
#include <libs/lvgl/src/lv_core/lv_style.h>
#include <libs/lvgl/src/lv_core/lv_obj.h>
namespace Pinetime { namespace Pinetime {
namespace Applications { namespace Applications {

View File

@ -1,7 +1,6 @@
#include <libs/lvgl/lvgl.h>
#include <libraries/log/nrf_log.h>
#include "InfiniPaint.h" #include "InfiniPaint.h"
#include "../DisplayApp.h" #include "../DisplayApp.h"
#include "../LittleVgl.h"
using namespace Pinetime::Applications::Screens; using namespace Pinetime::Applications::Screens;
extern lv_font_t jetbrains_mono_extrabold_compressed; extern lv_font_t jetbrains_mono_extrabold_compressed;

View File

@ -1,14 +1,13 @@
#pragma once #pragma once
#include <lvgl/lvgl.h>
#include <cstdint> #include <cstdint>
#include "Screen.h" #include "Screen.h"
#include <bits/unique_ptr.h>
#include <libs/lvgl/src/lv_core/lv_style.h>
#include <libs/lvgl/src/lv_core/lv_obj.h>
#include <drivers/St7789.h>
#include "displayapp/LittleVgl.h"
namespace Pinetime { namespace Pinetime {
namespace Components {
class LittleVgl;
}
namespace Applications { namespace Applications {
namespace Screens { namespace Screens {

View File

@ -1,4 +1,3 @@
#include <libs/lvgl/lvgl.h>
#include "Label.h" #include "Label.h"
using namespace Pinetime::Applications::Screens; using namespace Pinetime::Applications::Screens;

View File

@ -1,6 +1,5 @@
#pragma once #pragma once
#include <vector>
#include "Screen.h" #include "Screen.h"
#include <lvgl/lvgl.h> #include <lvgl/lvgl.h>

View File

@ -1,5 +1,5 @@
#include <libs/lvgl/lvgl.h>
#include "Meter.h" #include "Meter.h"
#include <lvgl/lvgl.h>
#include "../DisplayApp.h" #include "../DisplayApp.h"
using namespace Pinetime::Applications::Screens; using namespace Pinetime::Applications::Screens;

View File

@ -1,11 +1,9 @@
#pragma once #pragma once
#include <cstdint> #include <cstdint>
#include <chrono>
#include "Screen.h" #include "Screen.h"
#include <bits/unique_ptr.h> #include <lvgl/src/lv_core/lv_style.h>
#include <libs/lvgl/src/lv_core/lv_style.h> #include <lvgl/src/lv_core/lv_obj.h>
#include <libs/lvgl/src/lv_core/lv_obj.h>
namespace Pinetime { namespace Pinetime {
namespace Applications { namespace Applications {

View File

@ -1,5 +1,5 @@
#include <libs/lvgl/lvgl.h>
#include "Modal.h" #include "Modal.h"
#include <lvgl/lvgl.h>
#include "../DisplayApp.h" #include "../DisplayApp.h"
using namespace Pinetime::Applications::Screens; using namespace Pinetime::Applications::Screens;

View File

@ -1,11 +1,8 @@
#pragma once #pragma once
#include <cstdint>
#include <chrono>
#include "Screen.h" #include "Screen.h"
#include <bits/unique_ptr.h> #include <lvgl/src/lv_core/lv_style.h>
#include <libs/lvgl/src/lv_core/lv_style.h> #include <lvgl/src/lv_core/lv_obj.h>
#include <libs/lvgl/src/lv_core/lv_obj.h>
namespace Pinetime { namespace Pinetime {
namespace Applications { namespace Applications {

View File

@ -15,9 +15,13 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
#include <libs/lvgl/lvgl.h>
#include "Music.h" #include "Music.h"
#include <cstdint>
#include "../DisplayApp.h"
#include "components/ble/MusicService.h"
#include "displayapp/icons/music/disc.cpp"
#include "displayapp/icons/music/disc_f_1.cpp"
#include "displayapp/icons/music/disc_f_2.cpp"
using namespace Pinetime::Applications::Screens; using namespace Pinetime::Applications::Screens;

View File

@ -17,24 +17,16 @@
*/ */
#pragma once #pragma once
#include <cstdint> #include <FreeRTOS.h>
#include <chrono> #include <lvgl/src/lv_core/lv_obj.h>
#include <string> #include <string>
#include "components/gfx/Gfx.h"
#include "components/battery/BatteryController.h"
#include "components/ble/BleController.h"
#include "components/ble/MusicService.h"
#include "Screen.h" #include "Screen.h"
#include <bits/unique_ptr.h>
#include <libs/lvgl/src/lv_core/lv_style.h>
#include <libs/lvgl/src/lv_core/lv_obj.h>
#include "../../Version.h"
#include "displayapp/icons/music/disc.cpp"
#include "displayapp/icons/music/disc_f_1.cpp"
#include "displayapp/icons/music/disc_f_2.cpp"
namespace Pinetime { namespace Pinetime {
namespace Controllers {
class MusicService;
}
namespace Applications { namespace Applications {
namespace Screens { namespace Screens {
class Music : public Screen { class Music : public Screen {

View File

@ -1,7 +1,5 @@
#include <libs/lvgl/lvgl.h>
#include <displayapp/DisplayApp.h>
#include <functional>
#include "Notifications.h" #include "Notifications.h"
#include <displayapp/DisplayApp.h>
using namespace Pinetime::Applications::Screens; using namespace Pinetime::Applications::Screens;

View File

@ -1,11 +1,10 @@
#pragma once #pragma once
#include <functional> #include <lvgl/lvgl.h>
#include <vector> #include <cstdint>
#include <memory>
#include "Screen.h" #include "Screen.h"
#include "ScreenList.h" #include "components/ble/NotificationManager.h"
namespace Pinetime { namespace Pinetime {
namespace Applications { namespace Applications {

View File

@ -1,10 +1,10 @@
#pragma once #pragma once
#include <vector> #include <array>
#include <functional> #include <functional>
#include "components/ble/NimbleController.h" #include <memory>
#include "Screen.h" #include "Screen.h"
#include "Label.h" #include "../DisplayApp.h"
namespace Pinetime { namespace Pinetime {
namespace Applications { namespace Applications {

View File

@ -1,9 +1,13 @@
#include <libs/lvgl/lvgl.h>
#include <displayapp/DisplayApp.h>
#include <functional>
#include "SystemInfo.h" #include "SystemInfo.h"
#include "../../Version.h" #include <lvgl/lvgl.h>
#include "Tile.h" #include "../DisplayApp.h"
#include "Label.h"
#include "Version.h"
#include "components/battery/BatteryController.h"
#include "components/ble/BleController.h"
#include "components/brightness/BrightnessController.h"
#include "components/datetime/DateTimeController.h"
#include "drivers/Watchdog.h"
using namespace Pinetime::Applications::Screens; using namespace Pinetime::Applications::Screens;

View File

@ -1,17 +1,24 @@
#pragma once #pragma once
#include <functional> #include <memory>
#include <vector>
#include "components/ble/NimbleController.h"
#include "Screen.h" #include "Screen.h"
#include "Label.h"
#include "ScreenList.h" #include "ScreenList.h"
#include "Gauge.h"
#include "Meter.h"
namespace Pinetime { namespace Pinetime {
namespace Controllers {
class DateTime;
class Battery;
class BrightnessController;
class Ble;
}
namespace Drivers {
class WatchdogView;
}
namespace Applications { namespace Applications {
class DisplayApp;
namespace Screens { namespace Screens {
class SystemInfo : public Screen { class SystemInfo : public Screen {
public: public:

View File

@ -1,67 +0,0 @@
#include <cstdio>
#include <libs/date/includes/date/date.h>
#include "components/datetime/DateTimeController.h"
#include <Version.h>
#include <libs/lvgl/src/lv_core/lv_obj.h>
#include <libs/lvgl/src/lv_font/lv_font.h>
#include <libs/lvgl/lvgl.h>
#include <libraries/log/nrf_log.h>
#include "Tab.h"
#include "displayapp/DisplayApp.h"
using namespace Pinetime::Applications::Screens;
extern lv_font_t jetbrains_mono_bold_20;
//static void event_handler(lv_obj_t * obj, lv_event_t event) {
// Tile* screen = static_cast<Tile *>(obj->user_data);
// screen->OnObjectEvent(obj, event);
//}
Tab::Tab(DisplayApp* app, Pinetime::Components::Gfx &gfx) : Screen(app, gfx) {
/*Create a Tab view object*/
lv_obj_t *tabview;
tabview = lv_tabview_create(lv_scr_act(), NULL);
/*Add 3 tabs (the tabs are page (lv_page) and can be scrolled*/
lv_obj_t *tab1 = lv_tabview_add_tab(tabview, "Tab 1");
lv_obj_t *tab2 = lv_tabview_add_tab(tabview, "Tab 2");
lv_obj_t *tab3 = lv_tabview_add_tab(tabview, "Tab 3");
/*Add content to the tabs*/
lv_obj_t * label = lv_label_create(tab1, NULL);
lv_label_set_text(label, "This the first tab\n\n"
"If the content\n"
"of a tab\n"
"become too long\n"
"the it \n"
"automatically\n"
"become\n"
"scrollable.");
label = lv_label_create(tab2, NULL);
lv_label_set_text(label, "Second tab");
label = lv_label_create(tab3, NULL);
lv_label_set_text(label, "Third tab");
}
Tab::~Tab() {
lv_obj_clean(lv_scr_act());
}
void Tab::Refresh(bool fullRefresh) {
}
void Tab::OnObjectEvent(lv_obj_t *obj, lv_event_t event) {
if(event == LV_EVENT_CLICKED) {
NRF_LOG_INFO("Clicked");
}
else if(event == LV_EVENT_VALUE_CHANGED) {
NRF_LOG_INFO("Toggled");
}
}

View File

@ -1,23 +0,0 @@
#pragma once
#include <cstdint>
#include "Screen.h"
#include <bits/unique_ptr.h>
#include <lvgl/src/lv_core/lv_style.h>
namespace Pinetime {
namespace Applications {
namespace Screens {
class Tab : public Screen {
public:
explicit Tab(DisplayApp* app, Components::Gfx& gfx);
~Tab() override;
void Refresh(bool fullRefresh) override;
void OnObjectEvent(lv_obj_t* obj, lv_event_t event);
private:
};
}
}
}

View File

@ -1,11 +1,5 @@
#include <libs/lvgl/src/lv_core/lv_obj.h>
#include <libs/lvgl/src/lv_font/lv_font.h>
#include <libs/lvgl/lvgl.h>
#include "Tile.h" #include "Tile.h"
#include "displayapp/DisplayApp.h" #include "../DisplayApp.h"
#include "Symbols.h"
#include "../../Version.h"
using namespace Pinetime::Applications::Screens; using namespace Pinetime::Applications::Screens;

View File

@ -1,11 +1,11 @@
#pragma once #pragma once
#include <lvgl/lvgl.h>
#include <cstdint> #include <cstdint>
#include "Screen.h" #include <memory>
#include <bits/unique_ptr.h>
#include "Modal.h" #include "Modal.h"
#include <lvgl/src/lv_core/lv_style.h> #include "Screen.h"
#include <displayapp/Apps.h> #include "../Apps.h"
namespace Pinetime { namespace Pinetime {
namespace Applications { namespace Applications {

View File

@ -1,5 +1,6 @@
#pragma once #pragma once
#include <cstddef> #include <cstddef>
#include <cstdint>
namespace Pinetime { namespace Pinetime {
namespace Drivers { namespace Drivers {

View File

@ -1,8 +1,9 @@
#include <FreeRTOS.h>
#include <task.h>
#include <nrfx_log.h>
#include <legacy/nrf_drv_gpiote.h>
#include "Cst816s.h" #include "Cst816s.h"
#include <FreeRTOS.h>
#include <legacy/nrf_drv_gpiote.h>
#include <nrfx_log.h>
#include <task.h>
using namespace Pinetime::Drivers; using namespace Pinetime::Drivers;
/* References : /* References :

View File

@ -1,6 +1,5 @@
#pragma once #pragma once
#include <nrfx_twi.h>
#include "TwiMaster.h" #include "TwiMaster.h"
namespace Pinetime { namespace Pinetime {

View File

@ -1,5 +1,5 @@
#include <hal/nrf_gpio.h>
#include "DebugPins.h" #include "DebugPins.h"
#include <hal/nrf_gpio.h>
#ifdef USE_DEBUG_PINS #ifdef USE_DEBUG_PINS
void debugpins_init() { void debugpins_init() {

View File

@ -1,5 +1,5 @@
#include <mdk/nrf.h>
#include "InternalFlash.h" #include "InternalFlash.h"
#include <mdk/nrf.h>
using namespace Pinetime::Drivers; using namespace Pinetime::Drivers;
void InternalFlash::ErasePage(uint32_t address) { void InternalFlash::ErasePage(uint32_t address) {

View File

@ -1,6 +1,6 @@
#include "Spi.h"
#include <hal/nrf_gpio.h> #include <hal/nrf_gpio.h>
#include <nrfx_log.h> #include <nrfx_log.h>
#include "Spi.h"
using namespace Pinetime::Drivers; using namespace Pinetime::Drivers;

View File

@ -1,12 +1,6 @@
#pragma once #pragma once
#include <FreeRTOS.h>
#include <cstdint> #include <cstdint>
#include <cstddef> #include <cstddef>
#include <array>
#include <atomic>
#include <task.h>
#include "BufferProvider.h"
#include "SpiMaster.h" #include "SpiMaster.h"
namespace Pinetime { namespace Pinetime {

View File

@ -1,10 +1,8 @@
#include <FreeRTOS.h> #include "SpiMaster.h"
#include <hal/nrf_gpio.h> #include <hal/nrf_gpio.h>
#include <hal/nrf_spim.h> #include <hal/nrf_spim.h>
#include "SpiMaster.h"
#include <algorithm>
#include <task.h>
#include <nrfx_log.h> #include <nrfx_log.h>
#include <algorithm>
using namespace Pinetime::Drivers; using namespace Pinetime::Drivers;

View File

@ -1,14 +1,10 @@
#pragma once #pragma once
#include <FreeRTOS.h>
#include <cstdint>
#include <cstddef> #include <cstddef>
#include <array> #include <cstdint>
#include <atomic>
#include <task.h>
#include <semphr.h>
#include "BufferProvider.h" #include <FreeRTOS.h>
#include <semphr.h> #include <semphr.h>
#include <task.h>
namespace Pinetime { namespace Pinetime {
namespace Drivers { namespace Drivers {

View File

@ -1,7 +1,7 @@
#include "SpiNorFlash.h"
#include <hal/nrf_gpio.h> #include <hal/nrf_gpio.h>
#include <libraries/delay/nrf_delay.h> #include <libraries/delay/nrf_delay.h>
#include <libraries/log/nrf_log.h> #include <libraries/log/nrf_log.h>
#include "SpiNorFlash.h"
#include "Spi.h" #include "Spi.h"
using namespace Pinetime::Drivers; using namespace Pinetime::Drivers;

View File

@ -1,5 +1,6 @@
#pragma once #pragma once
#include <cstddef> #include <cstddef>
#include <cstdint>
namespace Pinetime { namespace Pinetime {
namespace Drivers { namespace Drivers {

View File

@ -1,7 +1,7 @@
#include "St7789.h"
#include <hal/nrf_gpio.h> #include <hal/nrf_gpio.h>
#include <libraries/delay/nrf_delay.h> #include <libraries/delay/nrf_delay.h>
#include <nrfx_log.h> #include <nrfx_log.h>
#include "St7789.h"
#include "Spi.h" #include "Spi.h"
using namespace Pinetime::Drivers; using namespace Pinetime::Drivers;

View File

@ -1,5 +1,6 @@
#pragma once #pragma once
#include <cstddef> #include <cstddef>
#include <cstdint>
namespace Pinetime { namespace Pinetime {
namespace Drivers { namespace Drivers {

View File

@ -1,7 +1,7 @@
#include <nrfx_log.h>
#include <hal/nrf_gpio.h>
#include <cstring>
#include "TwiMaster.h" #include "TwiMaster.h"
#include <cstring>
#include <hal/nrf_gpio.h>
#include <nrfx_log.h>
using namespace Pinetime::Drivers; using namespace Pinetime::Drivers;

View File

@ -1,8 +1,8 @@
#pragma once #pragma once
#include <FreeRTOS.h> #include <FreeRTOS.h>
#include <semphr.h> #include <semphr.h>
#include <drivers/include/nrfx_twi.h> #include <drivers/include/nrfx_twi.h> // NRF_TWIM_Type
#include <cstdint>
namespace Pinetime { namespace Pinetime {
namespace Drivers { namespace Drivers {

View File

@ -1,7 +1,5 @@
#include <mdk/nrf52.h>
#include <mdk/nrf52_bitfields.h>
#include <nrf_soc.h>
#include "Watchdog.h" #include "Watchdog.h"
#include <mdk/nrf.h>
using namespace Pinetime::Drivers; using namespace Pinetime::Drivers;

View File

@ -1,4 +1,5 @@
#pragma once #pragma once
#include <cstdint>
namespace Pinetime { namespace Pinetime {
namespace Drivers { namespace Drivers {

View File

@ -1,9 +1,8 @@
#include "NrfLogger.h"
#include <libraries/log/nrf_log.h>
#include <libraries/log/nrf_log_ctrl.h> #include <libraries/log/nrf_log_ctrl.h>
#include <libraries/log/nrf_log_default_backends.h> #include <libraries/log/nrf_log_default_backends.h>
#include <FreeRTOS.h>
#include <task.h>
#include <libraries/log/nrf_log.h>
#include "NrfLogger.h"
using namespace Pinetime::Logging; using namespace Pinetime::Logging;

View File

@ -1,6 +1,9 @@
#pragma once #pragma once
#include "Logger.h" #include "Logger.h"
#include <FreeRTOS.h>
#include <task.h>
namespace Pinetime { namespace Pinetime {
namespace Logging{ namespace Logging{
class NrfLogger : public Logger { class NrfLogger : public Logger {

View File

@ -1,32 +1,44 @@
// nrf
#include <hal/nrf_rtc.h>
#include <hal/nrf_wdt.h>
#include <legacy/nrf_drv_clock.h>
#include <libraries/gpiote/app_gpiote.h>
#include <libraries/timer/app_timer.h>
#include <softdevice/common/nrf_sdh.h>
// nimble
#define min // workaround: nimble's min/max macros conflict with libstdc++
#define max
#include <controller/ble_ll.h>
#include <host/ble_hs.h>
#include <host/util/util.h>
#include <nimble/nimble_port.h>
#include <nimble/nimble_port_freertos.h>
#include <nimble/npl_freertos.h>
#include <os/os_cputime.h>
#include <services/gap/ble_svc_gap.h>
#include <transport/ram/ble_hci_ram.h>
#undef max
#undef min
// FreeRTOS
#include <FreeRTOS.h> #include <FreeRTOS.h>
#include <task.h> #include <task.h>
#include <timers.h> #include <timers.h>
#include <legacy/nrf_drv_clock.h>
#include <hal/nrf_rtc.h>
#include <hal/nrf_wdt.h>
#include <os/os_cputime.h>
#include <libraries/timer/app_timer.h>
#include <libraries/gpiote/app_gpiote.h>
#include "displayapp/DisplayApp.h"
#include <softdevice/common/nrf_sdh.h>
#include "components/datetime/DateTimeController.h"
#include "components/battery/BatteryController.h" #include "components/battery/BatteryController.h"
#include "components/ble/BleController.h" #include "components/ble/BleController.h"
#include "components/ble/NotificationManager.h" #include "components/ble/NotificationManager.h"
#include <drivers/St7789.h> #include "components/datetime/DateTimeController.h"
#include <drivers/SpiMaster.h> #include "displayapp/DisplayApp.h"
#include <drivers/Spi.h>
#include "displayapp/LittleVgl.h" #include "displayapp/LittleVgl.h"
#include <systemtask/SystemTask.h> #include "drivers/Spi.h"
#include <nimble/nimble_port_freertos.h> #include "drivers/SpiMaster.h"
#include <nimble/npl_freertos.h> #include "drivers/SpiNorFlash.h"
#include <nimble/nimble_port.h> #include "drivers/St7789.h"
#include <host/ble_hs.h> #include "drivers/TwiMaster.h"
#include <controller/ble_ll.h> #include "drivers/Cst816s.h"
#include <transport/ram/ble_hci_ram.h> #include "systemtask/SystemTask.h"
#include <host/util/util.h>
#include <services/gap/ble_svc_gap.h>
#if NRF_LOG_ENABLED #if NRF_LOG_ENABLED
#include "logging/NrfLogger.h" #include "logging/NrfLogger.h"

View File

@ -2,6 +2,7 @@
#include <FreeRTOS.h> #include <FreeRTOS.h>
#include <timers.h> #include <timers.h>
#include <nrfx_gpiote.h>
void nrfx_gpiote_evt_handler(nrfx_gpiote_pin_t pin, nrf_gpiote_polarity_t action); void nrfx_gpiote_evt_handler(nrfx_gpiote_pin_t pin, nrf_gpiote_polarity_t action);
void DebounceTimerCallback(TimerHandle_t xTimer); void DebounceTimerCallback(TimerHandle_t xTimer);

View File

@ -1,19 +1,27 @@
#include <libraries/log/nrf_log.h> #include "SystemTask.h"
#include <libraries/gpiote/app_gpiote.h> #define min // workaround: nimble's min/max macros conflict with libstdc++
#include <drivers/Cst816s.h> #define max
#include "displayapp/LittleVgl.h" #include <host/ble_gap.h>
#include <hal/nrf_rtc.h>
#include "components/ble/NotificationManager.h"
#include <host/ble_gatt.h> #include <host/ble_gatt.h>
#include <host/ble_hs_adv.h> #include <host/ble_hs_adv.h>
#include "SystemTask.h"
#include <nimble/hci_common.h>
#include <host/ble_gap.h>
#include <host/util/util.h> #include <host/util/util.h>
#include <drivers/InternalFlash.h> #include <nimble/hci_common.h>
#undef max
#undef min
#include <hal/nrf_rtc.h>
#include <libraries/gpiote/app_gpiote.h>
#include <libraries/log/nrf_log.h>
#include "BootloaderVersion.h"
#include "components/ble/BleController.h"
#include "displayapp/LittleVgl.h"
#include "drivers/Cst816s.h"
#include "drivers/St7789.h"
#include "drivers/InternalFlash.h"
#include "drivers/SpiMaster.h"
#include "drivers/SpiNorFlash.h"
#include "drivers/TwiMaster.h"
#include "main.h" #include "main.h"
#include "components/ble/NimbleController.h"
#include "../BootloaderVersion.h"
using namespace Pinetime::System; using namespace Pinetime::System;

View File

@ -4,17 +4,23 @@
#include <FreeRTOS.h> #include <FreeRTOS.h>
#include <task.h> #include <task.h>
#include <drivers/SpiMaster.h> #include <timers.h>
#include <drivers/St7789.h>
#include "components/battery/BatteryController.h"
#include "displayapp/DisplayApp.h"
#include <drivers/Watchdog.h>
#include <drivers/SpiNorFlash.h>
#include "SystemMonitor.h" #include "SystemMonitor.h"
#include "components/battery/BatteryController.h"
#include "components/ble/NimbleController.h" #include "components/ble/NimbleController.h"
#include "timers.h" #include "components/ble/NotificationManager.h"
#include "displayapp/DisplayApp.h"
#include "drivers/Watchdog.h"
namespace Pinetime { namespace Pinetime {
namespace Drivers {
class Cst816S;
class SpiMaster;
class SpiNorFlash;
class St7789;
class TwiMaster;
}
namespace System { namespace System {
class SystemTask { class SystemTask {
public: public: