Closed martinwork closed 11 months ago
Oops. Caused by my own unfamiliarity with the sleep hooks, this should now be fixed in master
, with the inclusion of a deactivateMic()
and activateMic()
calls on the required sides of a wake event.
This will however briefly wake the mic when waking the board, but it is immediately shut down by the demand-wake code.
This project sends sound level to serial. Press B to enter sleep. Press A to wake https://makecode.microbit.org/_gyDebV9CpUgF
In MakeCode beta the mic light sometimes stays off when woken from sleep. Then the sound levels reported are low.
I noticed a compiler warning that the new MicroBitAudio::deepSleepCallback does not return a value. https://github.com/lancaster-university/codal-microbit-v2/blob/master/source/MicroBitAudio.cpp#L231
Note that this is an override of the base class deepSleepCallback, that calls setSleep, so I don't think MicroBitAudio::setSleep is called now. Also note deepSleepCallback is called when waking up as well as when going to sleep..