diff options
author | Jean-François Milants <jf@codingfield.com> | 2021-04-09 21:17:03 +0200 |
---|---|---|
committer | Jean-François Milants <jf@codingfield.com> | 2021-04-09 21:17:03 +0200 |
commit | eb769fb60ecb8f96ecf6901082ec3f0610842af8 (patch) | |
tree | c26870103f8baaa933399cfb86cca25aa7e60d8b /src/main.cpp | |
parent | 57b4c3f0edc6acfa31bd2160abdcd6091920ba63 (diff) | |
parent | 15b3b8e282dd5b2132b0095716cd9d88740d4579 (diff) |
Merge branch 'motion-sensor' into develop
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp index ed00844c..9470bdb9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -26,6 +26,7 @@ #include <task.h> #include <timers.h> #include <drivers/Hrs3300.h> +#include <drivers/Bma421.h> #include "components/battery/BatteryController.h" #include "components/ble/BleController.h" @@ -60,6 +61,7 @@ static constexpr uint8_t pinLcdDataCommand = 18; static constexpr uint8_t pinTwiScl = 7; static constexpr uint8_t pinTwiSda = 6; static constexpr uint8_t touchPanelTwiAddress = 0x15; +static constexpr uint8_t motionSensorTwiAddress = 0x18; static constexpr uint8_t heartRateSensorTwiAddress = 0x44; Pinetime::Drivers::SpiMaster spi{Pinetime::Drivers::SpiMaster::SpiModule::SPI0, { @@ -98,14 +100,13 @@ static constexpr bool isFactory = false; Pinetime::Components::LittleVgl lvgl {lcd, touchPanel}; #endif - +Pinetime::Drivers::Bma421 motionSensor{twiMaster, motionSensorTwiAddress}; Pinetime::Drivers::Hrs3300 heartRateSensor {twiMaster, heartRateSensorTwiAddress}; TimerHandle_t debounceTimer; Pinetime::Controllers::Battery batteryController; Pinetime::Controllers::Ble bleController; -Pinetime::Controllers::DateTime dateTimeController; void ble_manager_set_ble_connection_callback(void (*connection)()); void ble_manager_set_ble_disconnection_callback(void (*disconnection)()); static constexpr uint8_t pinTouchIrq = 28; @@ -257,7 +258,7 @@ int main(void) { debounceTimer = xTimerCreate ("debounceTimer", 200, pdFALSE, (void *) 0, DebounceTimerCallback); systemTask = std::make_unique<Pinetime::System::SystemTask>(spi, lcd, spiNorFlash, twiMaster, touchPanel, lvgl, batteryController, bleController, - dateTimeController, motorController, heartRateSensor, settingsController); + motorController, heartRateSensor, motionSensor, settingsController); systemTask->Start(); nimble_port_init(); |