-
-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Labels
type: imperfectionPerceived defect in any part of projectPerceived defect in any part of project
Description
Describe the Problem
An alternative delay function is provided as part of the ArduinoBHY2 library. Defined as follows:
nicla-sense-me-fw/Arduino_BHY2/src/Arduino_BHY2.cpp
Lines 156 to 166 in b442527
| void Arduino_BHY2::delay(unsigned long ms) | |
| { | |
| unsigned long start = millis(); | |
| unsigned long elapsed = 0; | |
| if (_niclaConfig & NICLA_BLE) { | |
| while (elapsed < ms) { | |
| bleHandler.poll(ms - elapsed); | |
| elapsed = millis() - start; | |
| } | |
| } | |
| } |
The while segment is only activated when the NiclaConfig enumerator is set to NICLA_BLE.
nicla-sense-me-fw/Arduino_BHY2/src/Arduino_BHY2.h
Lines 34 to 39 in b442527
| enum NiclaConfig { | |
| NICLA_I2C = 0x1, /*!< I2C */ | |
| NICLA_BLE = 0x2, /*!< Bluetooth via ANNA-B112 module */ | |
| NICLA_BLE_AND_I2C = NICLA_I2C | NICLA_BLE, /*!< Enable I2C and BLE simultaneously */ | |
| NICLA_STANDALONE = 0x4 /*!< Operate in standalone, without external data transfer */ | |
| }; |
Expected behaviour
🙂 While loop does not rely on the bleHandler class
🙂 Regardless of the NiclaConfig enumeration, the delay loop will operate as intended.
Metadata
Metadata
Assignees
Labels
type: imperfectionPerceived defect in any part of projectPerceived defect in any part of project