Added rise, fall, pulse HI and LO events.
The pulse Hi and LO event timestamp given in the MicroBitEvent is the
duration for which the input was HI or LO for.
eventOn(int eventType) is used to configure the events generated
from the pin instance.
Added an mbed Timer instance to maintain a microsecond level timestamp.
Added a function system_timer_current_time_us() which now returns the
time since power on in microseconds.
MicroBitEvents now call system_timer_current_time_us() giving
microsecond level timestamps.
There was a perspective mismatch with the UART service, where the
actual buffer size given in the constructor, did not reflect the size
of the user buffer that was available to the application. This was not
documented, and hence cause confusion. The patch applied in this
commit, increments the given buffer sizes by one, so that the
application buffer has the available size given in the constructor.
Additionally, some configuration options were lost during the component
refactor, these have now been restored.
fiber_wake_on_event used to crash after forking a FOB fiber.
It would attempt to obtain a new fiber context, and would place it on the wait queue.
Then when that fiber was paged in, the context of that fiber would not have been
initialised, as the function presumed schedule would be called immediately after
fiber initialisation.
This patch catches that edge case.
The MicroBitDisplay::animate() and MicroBitDisplayAnimateAsync() function both
assumed that the display should be cleared once the requested animation was
complete.
This patch allows the user to control this funcitonality through an
addiitonal, optional boolean parameter to the animate() and animateAsync()
functions.
MicroBitradio::enable() would reset the group ID of the radio to the default
value on each call. Updated to do this only once at object initialisation time.
MicroBitRadio::disable neglected to reset the internal status flag indicating
that the radio has bene initialised, which prevent subsequent enable()
operations completing properly.
The default THREADING_MODE for event handlers is typically set to run through
the scheduler. However, it is possible to create and operate a MessageBus without the scheduler being initialised.
This patch changes the behaviour of the MessageBus to treat all registered
listeners as MESSAGE_BUS_LISTENER_IMMEDIATE (i.e. directly called) if no
scheduler is present. This default allows for a more user friendly experience
in this case.
There was no common place to track event codes used in Events intended
for the shared channel using the ID MICROBIT_ID_NOTIFY. This commit
adds a common place for these Event codes.
There was a bug with Bluetooth pairing. If a user were to bond with the
micro:bit, and the KeyValueStore region had not been configured, the
class would attempt to write to flash in interrupt context, which
conflicted with soft device.
The fix is to do this initialisation in the constructor for
MicroBitStorage.
Added condition into MicroBitMessageBus::process(), such that all event
listeners are diretly invoked if no scheduler is present.
This provides a best effort base case for builds running without a scheduler.
Updated parameter of scheduler_init() to accpet a reference to an EventModel,
rather than a pointer. This is simply to promote consistency with the other
components.
module.json has now been updated to include changes to the interrupt
priority of the system ticker, as there were some interoperability
issues with the nordic softdevice stack.
- Introduction of core, drivers, types and bluetooth folders in source and inc
- Added all inc subfolfers to the search path
- Removed MicroBit.cpp and MicroBit.h (yay!)
MicroBitImage::paste() now assumes the image to be pasted should be positioned
at the top left of the image by default, with no transparency.
MicroBitImage::print() now assumes the char to be printed should be positioned
at the top left of the image by default.
The C type system connaot easily distinguish integer literals from character
literals. To promote a simpler API, the print() overload for numeric values
has been replaced with an explicit printChar() method.
Print operation on single byte strings have been ammended to act consistently
with printing a single digit.