summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorJean-François Milants <jf@codingfield.com>2021-01-10 17:57:26 +0100
committerJean-François Milants <jf@codingfield.com>2021-01-10 17:57:26 +0100
commit1a582815ba218d2a9047abae92b9f33a3301ffd5 (patch)
tree18aa0aeba146d990a0302f4840e870cad1c4ad6f /src/main.cpp
parent50ae0ae5e073ac48652e6c26549f9b19655e8da3 (diff)
First implementation of the HR sensor using 100% foss code (ported from waspos)
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 35057045..3b993ee9 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();