diff options
| author | JF002 <JF002@users.noreply.github.com> | 2021-01-20 20:11:56 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-20 20:11:56 (GMT) |
| commit | a0f2fa8469f3a2c0f5f2f914ad174029da321cc0 (patch) | |
| tree | 4ac5f59cd088aea9af51d2d183376de279808e63 /src/main.cpp | |
| parent | 35d4f6d4875b68ff8fdecb436e3bc0a6f91099f3 (diff) | |
| parent | 68674cec53e2e2add1c0a0b109e5a0e7d9ed5479 (diff) | |
Merge pull request #169 from JF002/heartRateSensor
Heart rate sensor
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index 3505704..3b993ee 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -25,6 +25,7 @@ #include <FreeRTOS.h> #include <task.h> #include <timers.h> +#include <drivers/Hrs3300.h> #include "components/battery/BatteryController.h" #include "components/ble/BleController.h" @@ -57,6 +58,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 heartRateSensorTwiAddress = 0x44; Pinetime::Drivers::SpiMaster spi{Pinetime::Drivers::SpiMaster::SpiModule::SPI0, { Pinetime::Drivers::SpiMaster::BitOrder::Msb_Lsb, @@ -84,6 +86,8 @@ Pinetime::Drivers::TwiMaster twiMaster{Pinetime::Drivers::TwiMaster::Modules::TW Pinetime::Drivers::Cst816S touchPanel {twiMaster, touchPanelTwiAddress}; Pinetime::Components::LittleVgl lvgl {lcd, touchPanel}; +Pinetime::Drivers::Hrs3300 heartRateSensor {twiMaster, heartRateSensorTwiAddress}; + TimerHandle_t debounceTimer; Pinetime::Controllers::Battery batteryController; @@ -237,7 +241,7 @@ int main(void) { debounceTimer = xTimerCreate ("debounceTimer", 200, pdFALSE, (void *) 0, DebounceTimerCallback); systemTask.reset(new Pinetime::System::SystemTask(spi, lcd, spiNorFlash, twiMaster, touchPanel, lvgl, batteryController, bleController, - dateTimeController, notificationManager)); + dateTimeController, notificationManager, heartRateSensor)); systemTask->Start(); nimble_port_init(); |
