Commit graph

368 commits

Author SHA1 Message Date
Jonathan Protzenko
e258a52c79 My CMake skills are weak... properly implement the GCC/ARMCC switch for the S
file.
2015-08-24 10:55:22 -07:00
Jonathan Protzenko
8491b558e0 CMake tweak 2015-08-24 10:49:25 -07:00
Jonathan Protzenko
63b62e533f A version of microbit-dal that builds with both gcc and armcc.
Check in the CMakeLists.txt with a custom hook so that the library can build
with both compilers regardless.
2015-08-24 10:33:30 -07:00
Joe Finney
42f43b2255 Merge branch 'master' of https://github.com/lancaster-university/microbit-dal 2015-08-19 23:48:36 +01:00
Joe Finney
0fec4ae87c microbit: BUGFIX - Input validation in MicroBitDisplay::setBrightness()
Updates to MicroBitDisplay::setBrightness() to perform a NOP for out of bound parameters.
This aligns the functionality of the runtime with the TD simulator.
2015-08-19 23:36:17 +01:00
Joe Finney
58d24ab0a8 microbit: Updated MicroBitMessageBus to use fork_on_block functionality
Updates the MicroBitMessageBus implementation to use fork_on_block() calls rather
than create_fiber() calls when servicing events. This provides greater optimisation
for non-blocking event handlers.

More specifically, this update:

 - Replaces calls to create_fiber() ith fork_on_block during event send operations.
 - Adds a queue of events, to ensure events generated from interrupt context are not serviced in interrupt context.
 - Registers a listener with the idle process to empty the event queue.
2015-08-19 23:35:45 +01:00
Joe Finney
f4b8a1a272 microbit: Added fork_on_block functionality to fiber scheduler
The microbit fiber scheduler is often used to service event handlers by the microbit message bus.
This provides a very elegant decoupling of user code from system code, interrupt handlers and
also allows users to make blocking calls within event handlers. However, many event handlers are
non-blocking, so launching a dedicated fiber is wasteful in terms of time and SRAM.

This patch adds fork_on_block() to the scheduler. Inspired by the UNIX copy_on_write
technique, this optimisation is semantically equivalent to a create_fiber() call, but will first attempt
to execute the given function in the context of the currently running fiber, and *only* create a fiber
if the given code attempts a blocking operation.

More specifically, this update:

 - adds fork_on_block() functions for parameterised and non-parameterised functions.
 - adds fields to the fiber context to record the status of parent/child fibers.
 - adds optimised ASM functions to store and restore Cortex M0 register context.
 - adds a utility function to determine if the processor is executing in interrupt context.
 - updates to sleep() and wait_for_event() to handle fork_on_block semantics.
 - minor code optimsations within the scheduler.
2015-08-19 23:27:26 +01:00
Jonathan Protzenko
eaccb3cb4d Merge branch 'master' into gcc 2015-08-18 17:49:24 -07:00
Jonathan Protzenko
c4656ca855 Add a missing operator to ManagedType. 2015-08-18 17:49:08 -07:00
Jonathan Protzenko
e0820b5cc2 Merge branch 'master' into gcc 2015-08-14 15:51:23 -07:00
Jonathan Protzenko
6e65c33e88 Expose PinName for PWM purposes. 2015-08-14 15:51:16 -07:00
Jonathan Protzenko
753d6965f5 New gcc branch 2015-08-14 15:07:35 -07:00
James Devine
7e8e6778d7 microbit-dal: Added readme.md
This read me describes the process of getting the microbit environment working with yotta.
2015-08-14 17:29:00 +01:00
James Devine
3ef5901c5b microbit-dal: added a reset mechanism to uBit
Users can now call uBit.reset() to reset the device.
2015-08-14 16:51:45 +01:00
James Devine
d7b3ba9dab microbit-dal: Fixed a bug on printing a character with a delay
Previously when a blocking print finished, the animatemode was not
reset, which meant sometimes there would be a race condition.
2015-08-14 01:06:41 +01:00
James Devine
f8ebfc69fb microbit-dal: added #define to determine BLE usage
NO_BLE can now be defined to determine whether ble
will be brought up or not at initialisation of uBit.
This is especially useful for two new Yotta targets:
bbc-microbit-classic-gcc-nosd,
bbc-microbit-classic-armcc-nosd, which do not use
softdevice.
2015-08-13 00:49:48 +01:00
James Devine
0552741cf1 microbit-dal: updated module.json
Updated module.json to point to lancaster-university organisation
repos.
2015-08-12 16:08:02 +01:00
James Devine
538e1c48bd microbit-dal: Initial Commit
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.
2015-08-12 11:53:41 +01:00