The serial baud rate is set duing construction of the uBit object. We
don't need to do it again, and especially with fixed values that can't
be overridden.
Uisng libc's implementation is likely to be safer than rolling our own. At least
the failure modes are well documented. (glibc's implementation of rand() is
actually not bad).
The LFSR used only provides 1 bit of random data each time it is cycled.
This implementation generates the minimum number of bits needed. Further
it discards numbers that are bigger than required and re-calculates -
this keeps the distribution flat.
If BLE is connected when performing a hard reset, attempt to disconnect
first to allow the remote peer to handle the disconnect gracefully
without haing to wait for a supervision timeout.
- refactored BLE funcitonality into BLEManager class.
- added security requirements standard BLE profile services.
- updated bluezone pairing process to use BLE passkey exchange.
Also recalibrated loop timers in MicroBitDisplay::Error(), as used by panic()...
strange these now seem off by several orders of magnitude.
TODO: Ensure CPU is running at correct internal frequency with an oscilloscope test...
Whilst a little more invasive change than the previous warnings
supression this is more correct and more obvious as to what's being done,
and what warnigns will remain in place for the rest of the comilation
unit.
Unfortunately we can't turn it off just while nrf_soc.h is being included
as the way the defines are used the compiler can't tell the parameters
are unused until the end of the compilation unit. So we can't use the
more normal
as that pops the supression too early.
WARNING: including nrf_soc.h will turn off unused-function warnings for
the rest of the compilation unit - see included nrf_svc.h
- Enures an event listener is not deleted whilst a fiber is activiely processing a queue
- Added support for resurrection of event listeners in cases where identical listeners are removed/added repetitively.
- Add maximum depth for event queues, to prevent buggy scripts causing total memory exhaustion.
- Suppress generation of A/B click events when A+B click is generated
- preservation of event ordering on messagebus for resursive event generation cases.
- bugfix of message bus processing to prevent occasional dual processing of events
- bugfix MicroBitDisplay to behave correctly when delay parameter is zero.