Commit graph

368 commits

Author SHA1 Message Date
Joe Finney
fd79b2850f microbit: Added explicit version references for module dependencies 2016-01-05 16:53:23 +00:00
Joe Finney
b54cfa1ab6 version v1.4.1 2016-01-05 16:35:37 +00:00
Joe Finney
80b31681c1 Merge branch 'basic-gestures' 2016-01-05 16:32:04 +00:00
Joe Finney
3416e54a36 microbit: increase sensitivity of freefall detection
Freefall now detected when the net force on the device drops below 0.4g,
rather than 0.2g as previously defined. This improves sensitivity, without
generating false positives under common use.

Also correction of minor typos / layout errors.
2016-01-05 16:23:47 +00:00
Joe Finney
17632adafa Merge branch 'master' into basic-gestures 2016-01-05 15:50:53 +00:00
Joe Finney
d3587d888c microbit: code scrub of MicroBitAccelerometer gesture recognition code
- updated acceleration threshold event names to reflect numeric values e.g.
    GESTURE_3G, GESTURE_6G, GESTURE_8G.
  - Add scoping to elements of SimpleGesture enum.
  - Code scrub of code layout caused by editor with incorrect configuration.
  - rename of internal state variables and functions to better reflect use.
  - added clarification to some comments.
2016-01-05 15:44:57 +00:00
Joe Finney
d8651d9129 version v1.4.0 2016-01-05 10:45:13 +00:00
Joe Finney
3c314794f0 Merge branch 'secure-ble' 2016-01-05 01:28:49 +00:00
Joe Finney
413e6a2116 microbit: removed sample hex file used for testing 2016-01-05 01:27:19 +00:00
Joe Finney
55601f3e0e Merge branch 'master' into secure-ble 2016-01-05 01:25:52 +00:00
Joe Finney
fd27a78f0c Merge branch 'remay-ble-disconnect-on-reset' into secure-ble 2016-01-05 00:14:29 +00:00
Joe Finney
6763a9ba6c Merge branch 'ble-disconnect-on-reset' of https://github.com/remay/microbit-dal into remay-ble-disconnect-on-reset 2016-01-05 00:13:26 +00:00
Joe Finney
e1f75b2c4c microbit: Added read capability to MicroBitDFUService::ControlPoint characteristic
Whilst Android devices permit explicit initiation of the BLE pairing process,
IOS based devices are only  capable of implicit initiation of pairing based
on accessing a protected characteristic. Adding read capability to the
ControlPoint characteristic provides a safe and convenient way for IOS devices
to initiate pairing.
2016-01-04 23:41:22 +00:00
Joe Finney
7a71b58bd4 microbit: Revert explicit use of public addresses in pairing mode 2016-01-04 23:06:48 +00:00
Joe Finney
203246b975 WIP: Revert to public addresses pending further debug 2015-12-18 12:27:08 +00:00
Joe Finney
c7ea0af6fe WIP: Analysing correct use of private resolvable addresses 2015-12-17 14:27:57 +00:00
Joe Finney
de28387ff3 version v1.3.10 2015-12-11 04:57:31 +00:00
Joe Finney
14831ac9b9 Updates to BLE 2.1.11 / ble-nrf51822 2.2.3
Minor amends:
  - bleDisconnectionCallback signature change
  - bleSetAdvertisingInterval now takes milliseconds as a parameter
  - event based invocation of DFU bootloader
2015-12-11 04:57:06 +00:00
Joe Finney
6d610f049a microbit: Updates to Pairing Mode to improve the user experience
More specifically:

- BLUEZONE mode renamed to PairingMode (by popular request).
- Added timeout of 90 seconds before automatic device reboot.
- Move from a scroll to a print based algorithm to improve the amount of time key is displayed fully.
- Added compulsory 'click to bond' button press.
- Improved response time of tick/cross being displayed.
2015-12-11 03:43:18 +00:00
Joe Finney
5a9f5d42bd microbit: Updates to enable anonymous advertising during normal operation
Changes to default BLE name. During normal operation, all micro:bits now have the same name: BBC micro:bit
When pairing mode (AKA BLUEZONE) is entered, device name details re appended as before, to give BBC micro:bit [<name>]

This is to provide a degree of anonymity to users, to make tracking of kids more difficult.
2015-12-11 02:09:31 +00:00
Joe Finney
e042a55522 microbit: Added compile time option to enabe support for BLE private resolvable addresses.
Introduced MICROBIT_BLE_PRIVATE_ADDRESSES configuration option.
Disabled by default, as it did not resolve binds correctly on Android 4.4.2
2015-12-11 01:38:22 +00:00
Joe Finney
6f5ad99aa2 BUGFIX: Enabled BLE_COMMON_OPT_RADIO_CPU_MUTEX option
This option is now configured when the BLE stack is initialised. This ensures that SoftDevice is never
starved of CPU during periods of criticality. This does lock out the CPU for application use, but prevents
MIC failures caused by __disable_irq() operations (as found in the mbed Ticker API for example).
2015-12-11 01:16:48 +00:00
Joe Finney
b6ca1365f7 microbit: Added explicit BLE disconnection requests on DFU and soft reset 2015-12-11 00:55:33 +00:00
Joe Finney
1e5d5c8dcf Updates to BLE 2.1.11 / ble-nrf51822 2.2.3
Minor amends:
  - bleDisconnectionCallback signature change
  - bleSetAdvertisingInterval now takes milliseconds as a parameter
  - event based invocation of DFU bootloader
2015-12-11 00:24:21 +00:00
Joe Finney
1b18ac8641 microbit: Added basic gesture recognition into MicroBitAccelerometer
The following postures of the device are now detected:
- TILT_UP
- TILT_DOWN
- TILT_LEFT
- TILT_RIGHT
- FACE_UP
- FACE_DOWN

In addition, the following gestures are inferred:

- NONE
- SHAKE
- FREEFALL
- WHEEE (>=3g)
- SICK (>=5g)
- UNCONSCIOUS (>=8g)

Events are now triggered on the MessageBus upon the transition from one posture/gesture to another,
and a synchronous getGesture() method is now also provided to interogate the last gesture recognised.

I should be noted that the default accelerator range of +/-2g will be insufficient to detect some of
the events noted above, and MicroBitAccelerometer::setRange() should be used to increase the range
if required.
2015-12-03 15:11:31 +00:00
Joe Finney
2327ad44ff version v1.3.9 2015-11-30 00:54:49 +00:00
Joe Finney
462ba8fe45 Merge branch 'remay-fix-random' 2015-11-30 00:54:34 +00:00
Joe Finney
f0cbfb4c50 microbit: Default display brightness changed to 100%
Feedback from trials showed that this improved daylight visibility, especially for the first programs before kids have
discovered brightness APIs.
2015-11-30 00:51:26 +00:00
Joe Finney
f5cf8f2dd4 microbit: Minor optimisations to patch
- LFSR generated values in a subset of the range requested (rounded to the nearest lower power of 2).
   Corrected by increasing the number of bits usedby one, such that it now generated st least the power of 2 greater.

 - replaced enable/disable of interrupts with a local snapshot of randomValue. Much of the nordic software is sensitive to interrupt timings,
   so best avoided where possible. Chance of race condition is low, and effect is minimal (duplicate number returned).
2015-11-30 00:43:24 +00:00
Joe Finney
958136673f Merge branch 'fix-random' of https://github.com/remay/microbit-dal into remay-fix-random 2015-11-29 23:43:46 +00:00
Joe Finney
ae93079a65 code cleanup 2015-11-25 21:21:04 +00:00
Joe Finney
6d1004fb28 Updates to DFU service to align with BLE standard BLE security
- Removed flashcode base authorization
- silenced unused parameter in MicroBitHeapAllocator
- bugfixed BLUEZONE mode so that sensor data is still available via BLE
2015-11-20 11:32:42 +00:00
Robert May
051575d911 Tidy up gcc -Wall fixes. 2015-11-18 23:13:57 +00:00
Robert May
de681e68c3 Add diagnostic message to yotta/cmake output to remind us that we have silenced warnings. 2015-11-18 23:04:59 +00:00
Robert May
6c330079b1 Remove unnecessary uBit.serial.baud() calls
The serial baud rate is set duing construction of the uBit object.  We
don't need to do it again, and especially with fixed values that can't
be overridden.
2015-11-18 22:50:19 +00:00
Robert May
5333729644 Revert "Cchange random() to use libc srand()/rand()"
This reverts commit db5227872a.

return to using our own random implementation.
2015-11-18 15:50:44 +00:00
Robert May
db5227872a Cchange random() to use libc srand()/rand()
Uisng libc's implementation is likely to be safer than rolling our own.  At least
the failure modes are well documented. (glibc's implementation of rand() is
actually not bad).
2015-11-18 14:15:17 +00:00
Robert May
1bb4377c8c Combine loops and fix max returned value. 2015-11-18 12:08:34 +00:00
Michal Moskal
d5dfdbcc5e version v1.3.8 2015-11-17 15:57:59 -08:00
Michal Moskal
845bf4838c Fix allocation size for ImageData (the header is 6, not 4 bytes long) 2015-11-17 15:57:19 -08:00
Robert May
901faaeec7 reset variable m in the correct place. 2015-11-17 18:51:10 +00:00
Robert May
892689c54a Fix Microbit::random() to be random
The LFSR used only provides 1 bit of random data each time it is cycled.
This implementation generates the minimum number of bits needed.  Further
it discards numbers that are bigger than required and re-calculates -
this keeps the distribution flat.
2015-11-17 18:33:34 +00:00
Joe Finney
af0c0a4082 version v1.3.7 2015-11-17 17:22:41 +00:00
Joe Finney
b6379aab7b Merge branch 'flatstring' 2015-11-17 17:22:21 +00:00
Joe Finney
b44095f0c5 BUGFIX: String comparison operations
Corrected response of < and > operations where substrings are compared.
2015-11-17 17:20:30 +00:00
Joe Finney
9b5fa0fcfc minor bugfixes in MICROBIT_HEAP_DEBUG 2015-11-17 16:58:42 +00:00
Robert May
51ea69201e Disconnect BLE before hard reset
If BLE is connected when performing a hard reset, attempt to disconnect
first to allow the remote peer to handle the disconnect gracefully
without haing to wait for a supervision timeout.
2015-11-17 13:12:27 +00:00
Joe Finney
3bf4fb0bdb updated sample including bugfix of nordic/mbed BLE_API glue layer 2015-11-16 17:07:47 +00:00
Joe Finney
f34fc4dffc microbit: added sample hex file for testing 2015-11-16 14:04:32 +00:00
Joe Finney
ac381fa5dc microbit: Alpha version of standard BLE MITM passkey security
- refactored BLE funcitonality into BLEManager class.
- added security requirements standard BLE profile services.
- updated bluezone pairing process to use BLE passkey exchange.
2015-11-16 13:44:27 +00:00