summaryrefslogtreecommitdiff
path: root/src/drivers/TwiMaster.h
diff options
context:
space:
mode:
authorJean-François Milants <jf@codingfield.com>2021-06-12 10:58:28 +0200
committerJean-François Milants <jf@codingfield.com>2021-06-12 10:58:28 +0200
commit6d524ebea2c97e309633d5e01c3a1e37c182f27d (patch)
tree3f9c7f96f0fab64f581035c72480596a4cc4db43 /src/drivers/TwiMaster.h
parentb1925ff28638dd4b8400c4d0c49d796d8990b1af (diff)
Move most of the code from the constructor of the objects statically initialized in main() into Start()/Init() functions to avoid Static Initialization Order Fiasco (https://en.cppreference.com/w/cpp/language/siof). See https://github.com/JF002/InfiniTime/pull/415#issuecomment-859004238.
Diffstat (limited to 'src/drivers/TwiMaster.h')
-rw-r--r--src/drivers/TwiMaster.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/drivers/TwiMaster.h b/src/drivers/TwiMaster.h
index 1c0648a2..6175b99b 100644
--- a/src/drivers/TwiMaster.h
+++ b/src/drivers/TwiMaster.h
@@ -31,7 +31,7 @@ namespace Pinetime {
ErrorCodes Write(uint8_t deviceAddress, const uint8_t* data, size_t size, bool stop);
void FixHwFreezed();
NRF_TWIM_Type* twiBaseAddress;
- SemaphoreHandle_t mutex;
+ SemaphoreHandle_t mutex = nullptr;
const Modules module;
const Parameters params;
static constexpr uint8_t maxDataSize {16};