Commit graph

371 commits

Author SHA1 Message Date
Joe Finney
9218e647e0 microbit: Refactor of periodc timer callbacks
- 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.
2016-03-10 17:01:17 +00:00
Joe Finney
8a06a4e3be microbit: Introduced microbitDevice.[h,cpp] to hold platform specific low
level functionality
2016-03-10 12:02:17 +00:00
Joe Finney
000351b599 Factored idle/interrupt callback events out of MicroBit.cpp 2016-03-10 12:02:15 +00:00
Joe Finney
5231b5f526 First cut at a build without a global MicroBit singleton 2016-03-10 12:02:13 +00:00
Joe Finney
fdbc41d6b6 version v1.4.17 2016-03-08 19:24:33 +00:00
Joe Finney
b7f260074c Merge branch 'servo-fix' 2016-03-08 19:14:42 +00:00
James Devine
01377ca295 microbit: changes to the default servo range
Previously the range of the servo API was incorrect and would only
translate to a range 0 degrees - 90 degrees in the real world.

This patch updates the #defines used in the servo api default
calculation to calibrate for the intended range of 0 - 180 degrees.

This was all due to working from a specification that applied to a
subset of servos.
2016-03-08 19:14:19 +00:00
James Devine
77e7fdc71f microbit-dal: updated comments to reflect changes to the constants.
The comments for the setServoValue member function have been updated to reflect changes in the default Range and Center from the previous commit.
2016-03-07 13:59:24 +00:00
James Devine
f9e47bfbb7 version v1.4.16 2016-02-29 17:30:39 +00:00
James Devine
cfbf122eb1 microbit-dal: reverted changes to the servo API behaviour
At the request of @markjoyce, the changes to the servo API have been reverted pending BBC approval.

https://github.com/bbc/microbit-extras/issues/2863
2016-02-29 17:28:05 +00:00
James Devine
9af7a4fadf microbit-dal: ammended accidental change to default TX_POWER 2016-02-26 17:22:39 +00:00
Joe Finney
27ffb0b91c Merge branch 'ram-efficient-multibutton' 2016-02-26 16:33:55 +00:00
Joe Finney
2f4e542fee Merge branch 'radio-recv-bug-94' 2016-02-26 16:33:28 +00:00
Joe Finney
caa4924336 microbit: Added validation case in MicroBitRadioDatagram::recv()
Introduced missed validation case in MicroBitRadioDatagram::recv().
Added PacketBuffer::EmptyPacket as a NULL reference.
2016-02-26 16:27:13 +00:00
James Devine
cf34eacd94 Merge branch 'servo-fix'
closes https://github.com/bbc/microbit-extras/issues/2863
2016-02-26 16:03:27 +00:00
James Devine
e115e5af8d microbit-dal: BUGFIX maintain cccd state when service changed fails
Previously, we would rely on service changed to complete successfully
to signify a successful cccd state restore.

However, android doesn’t register for service_changed notifications,
and as a result sd_ble_gatts_service_changed always returns an error.

This meant that cccds would be erased when the complete flag was not
one, which would have been all the time.
2016-02-26 15:45:15 +00:00
Joe Finney
d3922d21e9 microbit: Aligning MicroBitButton and MicroBitMultiButton APIs
Updates to MicroBitButton and MicroBitMultiButton to align the API through
which CLICK events are filtered. Also, updates to the mechanism through which
buttonA and buttonB CLICK/LONG_CLICK events are filtered by
MicroBitMultiButotn to reduce RAM footprint.

No changes to external behaviour of these classes.
2016-02-26 15:42:57 +00:00
James Devine
5505fc6687 microbit-dal: fixed android waiting after DFU mode initiated
This commit introduces a wait_ms before entering DFU mode to allow soft
device to communicate to an android handset that the current connection
should be terminated.
2016-02-26 15:24:35 +00:00
James Devine
3019e34dd9 microbit: BLE fixes
This commit addresses a number of outstanding issues:

* whitelisting behaviour, form the nrf51-sdk, where an address and an
irk were added to the whitelist

* bond management bugs, from the nrf51-sdk, where one device would
replace another.

closes #57, closes #56, closes #58, closes #59, closes #44, closes #60
2016-02-26 15:21:30 +00:00
James Devine
aa7ce13e58 microbit: changes to the default servo range
Previously the range of the servo API was incorrect and would only
translate to a range 0 degrees - 90 degrees in the real world.

This patch updates the #defines used in the servo api default
calculation to calibrate for the intended range of 0 - 180 degrees.

This was all due to working from a specification that applied to a
subset of servos.
2016-02-22 15:34:27 +00:00
Joe Finney
6900bd8415 microbit: BUGFIX supporting repairing of the same device #2829
Re-pairing the same BLE device under SoftDevice 8.0 Nordic SDK 10 appears to
add a second entry to the bonding table when private resolvable addresses are
used by the central device. This adversely affects whitelisting, as only the
first added matching entry will be succesfully added to the whitelist. i.e. A
central device will no longer be able to connect to a micro:bit after pairing
a second time as the older bond will take prescedence.

Althoguh reported to Nordic, a long term fix is not immediately forthcoming.
This patch applies a workaround, by simply reversing the order of the
whitelist before use. As the list is maintained in the order of insertion,
reversing the list guarantees that the entry added to the whitelist will be
the most recently bonded one for any given peer.
2016-02-12 18:54:19 +00:00
Joe Finney
30ec004dc7 WIP: Working IOS pairing with service changed notification
n.b. changes to microBitConfig may need reverting
2016-02-11 21:58:07 +00:00
Joe Finney
3b25fe81ac WIP: Updates to IOS support 2016-02-10 18:12:31 +00:00
Joe Finney
5ec546980b version v1.4.15 2016-02-09 01:14:38 +00:00
Joe Finney
a61113f950 Merge branch 'rssi' 2016-02-09 01:09:36 +00:00
Joe Finney
2f6d405e81 microbit: Introduced managed type for packet buffers.
Introduce PacketBuffer as a mutable reference counted type Radio operations
Updated send() and recv() to use PacketBuffer rather than ManagedString
2016-02-09 01:04:57 +00:00
Joe Finney
eca55e279d Merge pull request #93 from lancaster-university/pin-updates
Pin updates
2016-02-08 16:55:34 +00:00
Joe Finney
bb8efa9f1e microbit: Default NLE transmission morefor OPEN mode set to 0dbm
Update to MicroBitConfig.h such that the MICROBIT_BLE_OPEN option now also
sets the radio transmission power to its hardware default (0dbm),
rather than the child protection setting (-30dbm).
2016-02-08 16:11:50 +00:00
Joe Finney
34d4af0f12 Merge branch 'bug-panic-timeout-2440' 2016-02-08 14:41:35 +00:00
Joe Finney
72d14be1d4 microbit: Added ability to define how long a device will remain in panic
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.
2016-02-08 14:37:43 +00:00
Joe Finney
db2e9118e4 Merge branch 'bug-racing-buttons-2734' 2016-02-08 13:54:33 +00:00
Joe Finney
c1ae235ebd microbit: On demand suppression on button click events.
MicroBitMultiButton now provides an indication to MicroBitButton instances when an application is actively utilising that button as part of a button group. This
permits that MicroBitButton to more accurately filter events, and provide a
consistent abstraction.

More specifically, this patch:

 - Extends the MessageBus functionality to indicate when listeners are
   attached to events. This allows components to perform on demand tailoring
   of their behaviour.

 - Extends MicroBitMultiButton to indicate to relevant MicroBitButton
   instances when they are part of a button group.

 - Extends MicroBitButton to perform filtering of button events dynamically
   (rather than statically) when part of a MultiButton group.

 - Code cleanup of static functions that are more cleanly implemented as
   methods.
2016-02-08 13:31:48 +00:00
Joe Finney
dda8598513 microbit: Added support for configurable GATT table size
Updates to MicroBitConfig options and initialisaiton code of the BLE stack to
allow Soft Device's GATT table to be of a given size. If this size is smaller
then the default, the runtime will reclaim that that memory as heap storage.
2016-02-08 00:57:20 +00:00
Joe Finney
260c05782e Merge branch 'ble-bondtable-size-fix' 2016-02-07 20:43:02 +00:00
Joe Finney
ecf0bea87c microbit: Update module version dependencies 2016-02-07 20:41:38 +00:00
Joe Finney
8e3e061bec microbit: BUGFIX Fixed incorrect bond table entry count
The nordic implementation of the mbed whitelist API introduces entries into
the table that are not bonds. This patch corrects an assumption in
microbit-dal that the number of entries in the bond table table corellates
with the number of bonds.
2016-02-07 19:59:56 +00:00
Joe Finney
b851e8cd1b Merge branch 'ble-security-config-option' 2016-02-06 23:38:13 +00:00
Joe Finney
2e6459404b microbit: Added configuration to enable/disable BLE security
The BLE security options mandated for child protection can be highly
detrimental to the development process for new BLE services. This patch
introduces a configuration option to disable BLE security for this purpose.
Default BLE security settings remain unchanged.
2016-02-06 23:34:10 +00:00
James Devine
e34971902f microbit: swapped capabilities for changes to pin mappings
In the previous commit, we swapped 2 pins around, but the capabilities
for those pins were not updated.

This commit updates those capabilities.
2016-02-05 14:02:08 +00:00
James Devine
982edaf988 microbit: corrected pin mappings
Swapped the mappings for BUTTON_A and COL2 around
to match the device mappings in the latest revision
of hardware.

Closes #92
2016-02-05 12:02:21 +00:00
James Devine
af13c940c1 microbit: add RSSI to MicroBitRadio
Added the ability to capture the RSSI value, and an accessor and
mutator for the last received RSSI value.
2016-02-04 03:45:57 +00:00
James Devine
ffc217e7ac microbit: fixed formatting issues in MicroBitRadio
Removed trailing whitespace.
2016-02-04 03:44:25 +00:00
Joe Finney
a255711e8f version v1.4.14 2016-02-03 14:48:50 +00:00
Joe Finney
0625d4bf1b version v1.4.13 2016-02-03 14:44:55 +00:00
Joe Finney
9d039fd9be microbit: BUGFIX Corrected length calculation for validation case
Incorreclty calculated payload bug also addressed here.
2016-02-03 14:41:45 +00:00
Joe Finney
5cb265c158 microbit: BUGFIX: Length field of datagram receive now correct
Datagram receive code incorrectly calculated the payload length, resulting in
packets being delivered to applications that were two bytes shorter than they
should be.
2016-02-03 14:35:12 +00:00
James Devine
5a30b3c0b3 version v1.4.12 2016-02-02 21:53:51 +00:00
James Devine
6f1630f409 microbit: reverted change to ble-nrf51822 module
Reverted changes to the ble-nrf51822 that caused some
incompatibility issues.
2016-02-02 21:52:12 +00:00
James Devine
41447b634d Merge pull request #89 from lancaster-university/ble-ccccd-persist
Basic Persistent Storage
2016-02-02 21:50:33 +00:00
James Devine
c9702aacb0 Merge pull request #88 from lancaster-university/ticker_improvements
Ticker improvements
2016-02-02 21:50:20 +00:00