First integration of the motion sensor (bma 421) : step counting + wake on wrist rotation + app to see the value of the 3 axis in "real time".
This commit is contained in:
@@ -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,7 +100,7 @@ static constexpr bool isFactory = false;
|
||||
Pinetime::Components::LittleVgl lvgl {lcd, touchPanel};
|
||||
#endif
|
||||
|
||||
|
||||
Pinetime::Drivers::Bma421 motionSensor{twiMaster, motionSensorTwiAddress};
|
||||
Pinetime::Drivers::Hrs3300 heartRateSensor {twiMaster, heartRateSensorTwiAddress};
|
||||
|
||||
|
||||
@@ -257,7 +259,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);
|
||||
dateTimeController, motorController, heartRateSensor, motionSensor, settingsController);
|
||||
systemTask->Start();
|
||||
nimble_port_init();
|
||||
|
||||
|
Reference in New Issue
Block a user