summaryrefslogtreecommitdiff
path: root/src/SystemTask
diff options
context:
space:
mode:
Diffstat (limited to 'src/SystemTask')
-rw-r--r--src/SystemTask/SystemTask.cpp19
-rw-r--r--src/SystemTask/SystemTask.h2
2 files changed, 15 insertions, 6 deletions
diff --git a/src/SystemTask/SystemTask.cpp b/src/SystemTask/SystemTask.cpp
index e65abb61..fc37ecb2 100644
--- a/src/SystemTask/SystemTask.cpp
+++ b/src/SystemTask/SystemTask.cpp
@@ -3,11 +3,15 @@
#include <drivers/Cst816s.h>
#include <DisplayApp/LittleVgl.h>
#include <hal/nrf_rtc.h>
-#include <BLE/BleManager.h>
-#include <softdevice/common/nrf_sdh_freertos.h>
#include <Components/Ble/NotificationManager.h>
+#include <host/ble_gatt.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 "../main.h"
+
using namespace Pinetime::System;
SystemTask::SystemTask(Drivers::SpiMaster &spi, Drivers::St7789 &lcd, Drivers::Cst816S &touchPanel,
@@ -17,7 +21,8 @@ SystemTask::SystemTask(Drivers::SpiMaster &spi, Drivers::St7789 &lcd, Drivers::C
Pinetime::Controllers::NotificationManager& notificationManager) :
spi{spi}, lcd{lcd}, touchPanel{touchPanel}, lvgl{lvgl}, batteryController{batteryController},
bleController{bleController}, dateTimeController{dateTimeController},
- watchdog{}, watchdogView{watchdog}, notificationManager{notificationManager} {
+ watchdog{}, watchdogView{watchdog}, notificationManager{notificationManager},
+ nimbleController(*this, bleController,dateTimeController, notificationManager) {
systemTaksMsgQueue = xQueueCreate(10, 1);
}
@@ -37,9 +42,11 @@ void SystemTask::Work() {
watchdog.Start();
NRF_LOG_INFO("Last reset reason : %s", Pinetime::Drivers::Watchdog::ResetReasonToString(watchdog.ResetReason()));
APP_GPIOTE_INIT(2);
- bool erase_bonds=true;
- ble_manager_init_peer_manager();
- nrf_sdh_freertos_init(ble_manager_start_advertising, &erase_bonds);
+
+/* BLE */
+ nimbleController.Init();
+ nimbleController.StartAdvertising();
+/* /BLE*/
spi.Init();
lcd.Init();
diff --git a/src/SystemTask/SystemTask.h b/src/SystemTask/SystemTask.h
index a1ba277a..5eba391b 100644
--- a/src/SystemTask/SystemTask.h
+++ b/src/SystemTask/SystemTask.h
@@ -8,6 +8,7 @@
#include <Components/Battery/BatteryController.h>
#include <DisplayApp/DisplayApp.h>
#include <drivers/Watchdog.h>
+#include <Components/Ble/NimbleController.h>
namespace Pinetime {
namespace System {
@@ -44,6 +45,7 @@ namespace Pinetime {
Pinetime::Drivers::Watchdog watchdog;
Pinetime::Drivers::WatchdogView watchdogView;
Pinetime::Controllers::NotificationManager& notificationManager;
+ Pinetime::Controllers::NimbleController nimbleController;
static constexpr uint8_t pinSpiSck = 2;