From cdb033ac2bb614806c46f768362bcf69c7816b72 Mon Sep 17 00:00:00 2001 From: Joe Finney Date: Thu, 28 Nov 2024 17:01:37 +0000 Subject: [PATCH] Bugfix minor errors in pipeline --- model/MicroBit.cpp | 1 - source/MicroBitAudio.cpp | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/model/MicroBit.cpp b/model/MicroBit.cpp index 7ebc8738..36195368 100644 --- a/model/MicroBit.cpp +++ b/model/MicroBit.cpp @@ -301,7 +301,6 @@ int MicroBit::init() // before any user code begins running. sleep(10); - return DEVICE_OK; } diff --git a/source/MicroBitAudio.cpp b/source/MicroBitAudio.cpp index 23aaa2ea..dee0695a 100644 --- a/source/MicroBitAudio.cpp +++ b/source/MicroBitAudio.cpp @@ -91,10 +91,16 @@ MicroBitAudio::MicroBitAudio(NRF52Pin &pin, NRF52Pin &speaker, NRF52ADC &adc, NR void MicroBitAudio::periodicCallback() { if (mic->isEnabled() && !micEnabled) + { + DMESG("MicroBitAudio::periodicCallback: activateMic()..."); activateMic(); + } if (!mic->isEnabled() && micEnabled) + { + DMESG("MicroBitAudio::periodicCallback: deactivateMic()..."); deactivateMic(); + } } void MicroBitAudio::activateMic(){ @@ -106,7 +112,6 @@ void MicroBitAudio::activateMic(){ void MicroBitAudio::deactivateMic(){ this->micEnabled = false; - //mic->disable(); runmic.setDigitalValue(0); runmic.setHighDrive(false); }