#90 illustrated out that even though 3 pins have the required pull ups
to perform resistive “touch” sensing, developers may want to attach
their own pull ups and use MicroBitPins as resistive inputs more
generally.
This patch removes PIN_CAPABILITY_TOUCH, as all pins with
PIN_CAPABILITY_DIGITAL can become a resistive input.
N.b. In order to utilise pins used by the display, the display MUST be
disabled.
Ammended basic gesture recogniser to correclty generate threshold events for
high G forces (3G, 6G and 8G threshold events).
Also refined semantics such that events for any given impulse will be
generated for ALL thresholds below that below. e.g a 7G impulse will now raise
both the 3G and 6G threshold events.
This new member function allows the configuration of the pull currently
applied to the MicroBitPin instance. This member function only has
affect when the MicroBitPin instance is in a digital input mode.
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 an off by one error when storing the key of the key value
pair, where the null terminator was dropped. This would mean that if
the returned key of the KeyValuePair were used, it would cause a number
of issues.
Another issue raised was the copying a random 48 bytes from memory
regardless of the position of memory in the stack. If the memory was
smaller than 48 bytes, and existed at the top of the stack, this could
have dire consequences. As a result, MicroBitStorage now accepts a size
parameter which informs the number of bytes to be copied into flash.
#130
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.