issue #73 highlighted an issue whereby the destruction of an instance
registered as an idle or system component, would result in a hardfault.
This was due to not deregistering idle or system callbacks.
This patch has been applied to all components currently in use by the
idle or system callbacks.
NOP/clamping behaviour out of teh micro:bit runtime and into the glue layers of higher level
languages.
- Updates to many functions to provide explicut return codes.
- Updates to many functions to remove heuristic calidation (NOP/clamping/defaults)
- Updates to ErrorNo.h to provide clearer return values, and place return values in a better scope
- Updates to MicroBitDisplay to use enums where appropriate.
Updates to change the behaviour of the scroll/print/animate faily of function away
from being pre-emtive and instead prroviding queing behaviour.
Minor updates to provide complete sets of async equivalent operations
Updates to the scheduler to provide wait/notify/waitone semantics.
Previous to this patch an explicit constructor was provided for creating
MatrixPoint instances, which meant that such objects could not be put in
ROM (since they needed to be constructed at runtime).
By using the defualt construction method for structs the MatrixPoint map
is now compiled into the rodata section, hence freeing up RAM.
Saves: 4 bytes data, 56 bytes bss, 148 bytes code.
MessageBus handlers can now have one of four concurrency modes for the eventuality
of an event being raised whilst a previous event is still being processed. An additional
(optional) parameter is provided to the listen() functions to allow this to be selected
on a per event handler basis. The permissable options are:
MESSAGE_BUS_LISTENER_REENTRANT:
The event handler is fired with the new event, regardless of whether or not
a previous event is still be processed by that handler.
MESSAGE_BUS_LISTENER_QUEUE_IF_BUSY:
The new event is queued until such a time as the previous event has completed
execution. The new event is then processed. This option does not preclude the
processing of the new event by other event handlers.
MESSAGE_BUS_LISTENER_DROP_IF_BUSY:
The new event is dropped, and will never be processed the the event handler.
This option does not preclude the processing of the new event by other event handlers.
MESSAGE_BUS_LISTENER_NONBLOCKING:
The event handler is self-declaring that it never blocks. This flag is used purely
for optimisation, as it permits direct execution of the event hadnelr without inducing
any overhead from the scheduler.
In addition, the following minor revisions were made in this release:
* Cleanup of the #include dependencies contained in the microbit-dal .h files
* Bugfix to the scheduler block on event matching code.
* Introduced a MICROBIT_ID_ALERT MessageBus channel, for general purpose eventing using nonces.
All options defined in MicroBitConfig are now set IFF they already do not have a value.
This allows external configuration of these options much more cleanly. Additional macros
also defined to provide clean implementation for boolean configuration switches.
Also some minor bugfixes:
- Correction of typo of "Microbit.h" => "MicroBit.h"
- Fixed heap corruption bug on gcc as a result of a debug printf in an unsafe context.
This is the first commit of the microbit-dal on GitHub.
This repository contains the runtime, which is a light
weight operating system developed by Lancaster University.