- Factored periodic timer funcitonality out of fiber scheduler and into a new SystemTimer module module.
- Enapsulated "ticks" variable within SystemTimer module, with accessor funciton.
- Added accessor/mutator functions to get and set the tick period.
- Added a class wrapper to permit periodic callbacks to both C and C++
functions.
- Updated all references in microbit-dal to use this refactored API.
before resetting
Requests made for an optional timeout function to define the period of time in
which the device will remain in a panic state. This patch introduces a
setErrorTimeout() method with this functionality.
The impact of the pixels at lower values was not distinct enough
this commit adds a blocking wait for the first two timings for
greyscale.
Additionally, this commit modifies the timings const array to
take into account the time taken for renderGreyscale to execute.
Previously the DAL relied upon an implementation of a timer that
was very imprecise and lacked resolution, this commit adds a reference
to a frozen repo with us_ticker.c modifications, so that a higher resolution
timer is utilised.
This fixes#13 (finally), and also fixes lower brightness levels when using
DISPLAY_MODE_BLACK_AND_WHITE to not cause a device lockup.
Missed a zero in a previous commit, that caused a system lockup due to
a missed timer event.
This commit also changes the minimum display brightness to 4, to also
minimise another feature that needs fixing in the future, where the
timer does not interrupt in the expected time frame.
Previously, to light sense a user would have to configure a
MicroBitLightSensor instance themselves, and flip the display mode
manually. This is difficult in languages that target our API.
This commit resolves that by adding a new method readLightLevel which
flips the display mode, and instantiates a light sensor.
When changing the mode, the tickSpeed is also modified to reduce
artefacts on the display.
This commit adds a mutator that dynamically reconfigures the
systemTicker to call systemTick at a different period to the default.
The accessor returns the current tick speed in milliseconds.
The accessor is now also used in scheduler_tick to keep timing as
accurate as possible.
MICROBIT_DISPLAY_REFRESH_PERIOD has now been removed, and replaced with
MICROBIT_DEFAULT_TICK_PERIOD.
This commit introduces a new display mode,
DISPLAY_MODE_BLACK_AND_WHITE_LIGHT_SENSE, where the 4th render in
every “frame” is dropped allowing for other components that use the
display to use this dropped frame for processing. This is in
preparation for Light Sensing on the 5x5 LED matrix.
An accessor has also been added to MicroBitDisplay to check the current
display mode!
See bbc/microbit-extras/issues/#1100 or lancaster-university/microbit-dal/issues/5 for full details.
Summary:
A stride of 0 would lock the calling fiber indefinitely, which was not the expected behaviour
for many people.
This update fixes this issue in both animate and scroll, returning immediately when there is
a stride of zero.
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.
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...
- 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.
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.
Updates to MicroBitDisplay::setBrightness() to perform a NOP for out of bound parameters.
This aligns the functionality of the runtime with the TD simulator.
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.