Commit graph

717 commits

Author SHA1 Message Date
Martin Woolley
6c4fa882a3 Added PWM Control characteristic to the IO Pin Service 2016-08-31 12:11:26 +01:00
Martin Woolley
383b8b18b3 Added PWM Control characteristic to the IO Pin Service 2016-08-31 12:09:20 +01:00
Michal Moskal
1942b2840b Make sure there is only one empty string 2016-08-30 15:30:01 +02:00
James Devine
7c020d14bc Merge pull request #190 from stigbjorlykke/malloc-doc
microbit-dal: fix malloc documentation
2016-07-31 18:09:17 +01:00
James Devine
d35f050d7c Merge pull request #188 from stigbjorlykke/master
microbit-dal: minor spelling corrections
2016-07-31 18:09:02 +01:00
Stig Bjørlykke
e2ec58b434 microbit-dal: fix malloc documentation 2016-07-30 22:42:19 +02:00
Stig Bjørlykke
250780f1f5 microbit-dal: minor spelling corrections 2016-07-30 14:59:37 +02:00
James Devine
9b1bac5c6a Merge pull request #186 from bluetooth-mdw/master
Interrupt animation when text or pattern written to the BLE LED service
2016-07-27 10:47:01 +01:00
Martin Woolley
cfa662de1b Fixed indents 2016-07-27 06:48:03 +01:00
Martin Woolley
6e4dc2d2d9 Interrupt animation when text or pattern written to the BLE LED service 2016-07-25 11:24:37 +01:00
Joe Finney
ff547977af microbit: Removed dependency on microbit target for MicroBitDisplay
- removed ROW1 and COL1 dependencies that are defined in the bbc-microbit
   family of mbed targets, so that microbit-dal can be compiled for other mbed
   targets. #172

 - removed legacy reference to the default microbitMatrixMap in
   MicroBitDisplay, in favour of the map configured through the constructor.
2016-07-05 16:37:31 +01:00
James Devine
b169a98e9a Merge pull request #176 from whs-che/master
Protection from ISR added to queueDepth counter (#175 )
2016-07-01 11:23:30 +01:00
Charles Hemming
4fd5b0b62e Protection from ISR added to queueDepth counter (#175 ) 2016-06-30 19:09:42 +01:00
James Devine
862528bb93 microbit-dal: minor spelling corrections
Courtesy of @gbaman
2016-06-04 00:39:00 +01:00
James Devine
c028238147 microbit-dal: moved to v2.0.0-rc4 2016-06-04 00:10:33 +01:00
James Devine
05c03b06fa microbit-dal: added validation to send [#151] 2016-06-04 00:06:05 +01:00
Joe Finney
a962befe74 Merge pull request #159 from lancaster-university/bugfix-145-shake-hard-to-trigger
Bugfix 145 shake hard to trigger
2016-06-03 23:11:48 +01:00
Joe Finney
00674e3457 microbit: Tuning and furhter debounce of SHAKE gesture
- Added timeout code to prevent over-generation of SHAKE events.
 - Tuning of SHAKE detection parameters to align sensitivity with existing
   microbit.co.uk algorithm
2016-06-03 23:06:22 +01:00
Joe Finney
07b6f7f6b6 microbit: CRC check bugfix to MicroBitRadio #150
Integrated @whs-che patch as documented in #150, which prevents packets with a
failed CRC checksum from being processed.
2016-06-03 22:43:23 +01:00
Joe Finney
f214bc9625 Merge pull request #158 from lancaster-university/156-readDigitalValuePullOverload
microbit: Added getDigitalValue overload for PullMode #156
2016-06-03 22:31:47 +01:00
Joe Finney
4cf48035d5 microbit: Added getDigitalValue overload for PullMode #156
- Introduced an overload to MicroBitIOPin::getDigitalValue() to permit the
setting of a specific pull mode at the time of reading.

 - Bugfix of MicroBitIOPin::setPull() to persist preferred pull settings

 - Added configuration options to allow the default PullMode to be set via
   compile time option through MicroBitConfig.h or YOTTA_CONFIG
2016-06-03 21:48:31 +01:00
James Devine
179b32fef4 microbit-dal: BUGFIX serial.redirect() [#149]
Removed a call to serial_free() that removed state for the tx and rx
interrupts, without tearing down any configured interrupts.
2016-05-27 14:19:00 +01:00
James Devine
64042e4a5e microbit-dal: BUGFIX cast in MicroBitSerial from int to char
There was an unnecessary cast in MicroBitSerial.read that meant error
codes would never be returned to the user application, this has now
been removed.
2016-05-26 16:23:53 +01:00
James Devine
ee2af2c489 microbit-dal: MicroBitSerial +1 to buffer sizes, to give usable buffer of the size requested 2016-05-25 17:04:59 +01:00
James Devine
158eb43b5b microbit-dal: MicroBitSerial.[eventOn, eventAfter] clarity
The documentation for MicroBitSerial.[eventOn, eventAfter] is now
clearer on what events are generated.
2016-05-25 17:01:14 +01:00
James Devine
bf58aac76a microbit-dal: Added send modes to the UART service. [#146]
Added a blocking send to the UART service for the case when the bytes
to transmit is greater than the size of the transmission buffer.

The characteristics have now diverged from the BLE_API’s
implementation, and are now more semantic.

Send now returns an error code if there is no device connected, or
indications have not been enabled.

Debug statements have also been removed.
2016-05-25 16:57:36 +01:00
James Devine
94b4a29a7b microbit-dal: BUGFIX when using the nosd target
When using the nosd target, a hard fault would be generated if soft
device wasn’t in use.
2016-05-25 16:53:00 +01:00
James Devine
a3615605e3 microbit-dal: suppressed warning when the information service is disabled. 2016-05-25 16:51:02 +01:00
Joe Finney
e53abf3091 microbit: Updates to shake gesture recogniser to increase sensitivity [issue #145]
- Code cleanup of shake recogniser
- Increased sensitivity of shake gesture
- SHAKE event now raised on each shake detected
2016-05-14 11:33:48 +01:00
James Devine
9dbe43f0cb microbit-dal: BUGFIX for wait[_us,_ms] in an ISR.
Previously if a user used wait[_us,_ms] in interrupt context,
the device would hang indefinitely due to a previous patch
in the mbed classic library.

This commit updates the reference to mbed-classic, which has
the appropriate fix.
2016-05-13 16:59:48 +01:00
Joe Finney
3d9283b947 Merge branch 'master' of https://www.github.com/lancaster-university/microbit-dal 2016-05-13 16:43:52 +01:00
James Devine
51138b3d54 microbit-dal: removed OpenDrain from MicroBitPin setPull [issue #144] 2016-05-13 11:17:30 +01:00
Brendan Moran
8468823e21 Convert add operator to a friend operator
By replacing the addition operator with a friend operator, order of
operations doesn’t matter, provided that at least one argument is a
ManagedString.

```C++
ManagedString a = "A";           // OK
ManagedString b = a + ", " + 2;  // OK
ManagedString c = "a" + a + 2;   // OK
ManagedString d = 1 + "," + 2;   // FAILS
```
2016-05-12 15:06:01 +01:00
James Devine
d887bbf670 Merge pull request #142 from bremoran/master
Add missing const qualifier from add operator
2016-05-12 12:27:10 +01:00
Brendan Moran
d8c083d49c Add missing const qualifier from add operator
This change permits more friendly use of the type such as:

```C++
ManagedString s = "A";
ManagedString b = s + ", " + 2;
```
2016-05-12 10:54:09 +01:00
James Devine
af46028260 microbit-dal: Moved from v2.0.0-rc2 to v2.0.0-rc3. 2016-05-11 13:52:28 +01:00
James Devine
ed95d8197d Merge pull request #137 from lancaster-university/pin-events
Increased granularity of system timer.

Added events for Rise, Fall, Pulse HI and Pulse LO.

Pulse HI/LO events give the time that the pin was HI or LO for using the timestamp field of the MicroBitEvent.

Added setPull() to configure the pull of the pin when in a digital input mode.
2016-05-11 13:49:46 +01:00
James Devine
dc9b007895 microbit-dal: added comparison to MicroBitStorage to prevent overwriting with duplicate data. [issue #140]
Issue #140 highlighted the fact there would be multiple writes of the
same data when storing calibration information.

This patch introduces a memcmp before initiating the storage of
KeyValuePairs in the “put” member function.
2016-05-11 13:33:20 +01:00
James Devine
deac034189 microbit-dal: panic now accepts codes in the range 0 - 999 [issue #129 ]
Issue #129 illustrated that panic is capable of accepting numbers in
the range 0-999 and should therefore not have an arbitrary range of
0-255.

Additionally, this commit introduces gaps between consecutive numbers
of the same value e.g. 999. As a result, the speed of panic has also
been reduced.
2016-05-11 12:58:21 +01:00
James Devine
3b587e14ae microbit-dal: serial SYNC_SLEEP / SYNC_SPINWAIT modes transmit all characters [issue #141]
In SYNC_SLEEP and SYNC_SPINWAIT modes the maximum length that could be
sent was always dictated by the buffer size.

This was incorrect as these two modes should wait until all characters
have been transmitted from the given buffer before returning control to
the user.

ASYNC mode will still return immediately after copying the number of
bytes available in the TX buffer.
2016-05-10 17:46:35 +01:00
James Devine
e935380685 microbit-dal: All pins are now capable of becoming a "touch" input [issue #90]
#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.
2016-05-09 12:25:48 +01:00
Joe Finney
c45eba9bdb microbit: Removed unnecessary Managedstring() conversions 2016-05-04 17:12:57 +01:00
Joe Finney
eead32096b microbit: reuse variables in recalculatePitchRoll [issue #116]
Removed redundant function calls.
2016-04-29 10:47:44 +01:00
Joe Finney
ece079c75f microbit: FREEFALL gesture event is now damped
After further testing, dmaping is required on FREEFALL event (but not impulse
events) to avoid false positives.
2016-04-29 10:39:28 +01:00
Joe Finney
e0369cab6b microbit: Removed legacy isIdleCallbackNeeded() method. [issue #138]
This function has been deprecated, so now removed for v2.0.0 release.
2016-04-29 10:28:36 +01:00
Joe Finney
d2319f6d30 microbit: Added support for freefall event
Replaced this functionality after testing showed funcitonality had been
accidentally removed.
2016-04-28 22:54:08 +01:00
Joe Finney
682063dc7b microbit: Replaced BasicGestures enum with #define equivalent [issue #106] 2016-04-28 22:40:41 +01:00
Joe Finney
b5846f065a microbit: Fixed unreachable High-G gesture events [issue #109]
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.
2016-04-28 22:10:19 +01:00
Joe Finney
7443b78361 Fix typos 2016-04-28 09:25:38 +01:00
James Devine
4e71d61347 microbit-dal: Added setPull to MicroBitPin
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.
2016-04-27 13:59:25 +01:00