diff options
author | JF002 <JF002@users.noreply.github.com> | 2020-05-16 16:15:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-16 16:15:38 +0200 |
commit | d58f57b1b5a616debf893f209f1d96cac101489e (patch) | |
tree | 9df19606a2615586bb533d39fb42c84be8774092 /src/SystemTask/SystemTask.cpp | |
parent | 24a1f87a78584d3b67f07ea7972ea0d8e1f8167c (diff) | |
parent | d6c6ac4cf5801e17caf7bfc0878423703ed0413b (diff) |
Merge pull request #30 from JF002/nimble
Nimble
Diffstat (limited to 'src/SystemTask/SystemTask.cpp')
-rw-r--r-- | src/SystemTask/SystemTask.cpp | 19 |
1 files changed, 13 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(); |