forked from lancaster-university/microbit-dal
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from calliope-mini/merge-upstream
Merge upstream into master, confirmed by Calliope Team
- Loading branch information
Showing
64 changed files
with
6,310 additions
and
5,981 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ build | |
yotta_modules | ||
yotta_targets | ||
*.swp | ||
*~ | ||
Makefile | ||
.idea | ||
*.iml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
This file highlights all notable changes between tagged releases on the master branch of this repository, in the form of release notes. | ||
|
||
For a more detailed treatment of changes, please see the commit history of the github repository containing this file. | ||
|
||
Version 2.1.1 (23/11/19 [email protected]) | ||
- Partial flashing is no longer a default service in C++ builds | ||
- Make microbit_heap_print() available globally | ||
- Remove unused MicroBitPin objects | ||
- Add capability to set radio upper and lower frequency bands in yotta config | ||
- Fix radio power in C++ builds | ||
|
||
Version 2.1.0 (18/10/18 [email protected]) | ||
- Refactor of motion sensor devices to support a range of accelerometer/magnetometer | ||
sensors through abstract high level classes and concrete device specific subclasses. | ||
- Introduction of resusable 3D coordinate space transformation code. | ||
- Autodetection algorithm for I2C based accelerometer/magnetometer sensors. | ||
- Add support for LSM303 accelerometer/magnetometer sensor. | ||
- Add support for FXOS8700 accelerometer/magnetometer sensor. | ||
- Update compass calibration UX to gather more samples during calibration | ||
in order to improve accuracy. The algorithm now asks the user to "tilt to | ||
fill the screen" with pixels, rather than 'draw a circle' of pixels. | ||
- More resilient compass calibration algorithm based on iterative | ||
approximation that provides more accurate calibration in the presence of | ||
local magnetic fileds, such as those caused by a battery pack. | ||
- Updates to heap memory allocator. The MicroBitHeapAllocator now replaces | ||
the GNU libc heap allocator, rather than exisitng in parallel with it, in | ||
order to reduce memory fragmentation and ensure that all allocations | ||
benefit from multiple heap region support and interrupt safety. | ||
- Added new bluetooth partial flashing service, that allows rapid | ||
reprogramming of the micro:bit over bluetooth in the common case. | ||
- Improved graphics for bluetooth pairing mode. | ||
- Support to allow explicit launch of conmpass calibration algorithm via BLE characteristic. | ||
- Support for integrated hardware quadrature decoder | ||
|
||
- Minor bug fixes/code optimisations including: | ||
- the message bus event routing code to support multiple event listeners | ||
with the same id, value and context. | ||
- accelerometer pitch measurement algorithm now has a full 0..360 degree range. | ||
- Support for SHAKE gesture recognition in tight loops. | ||
- prevent device lockups when routing UART pins to the edge connector. | ||
- support for changing RADIO frequency whilst active. | ||
- accurate configurations for optional SoftDevice S130v2. | ||
|
||
Version 2.0.0 | ||
Initial Open Source Release | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
/* | ||
The MIT License (MIT) | ||
This class has been written by Sam Kent for the Microbit Educational Foundation. | ||
Permission is hereby granted, free of charge, to any person obtaining a | ||
copy of this software and associated documentation files (the "Software"), | ||
to deal in the Software without restriction, including without limitation | ||
the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
and/or sell copies of the Software, and to permit persons to whom the | ||
Software is furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
#ifndef MICROBIT_PARTIAL_FLASH_SERVICE_H | ||
#define MICROBIT_PARTIAL_FLASH_SERVICE_H | ||
|
||
#include "MicroBitConfig.h" | ||
#include "MicroBitBLEManager.h" | ||
#include "ble/BLE.h" | ||
#include "MicroBitMemoryMap.h" | ||
|
||
#include "MicroBitFlash.h" | ||
#include "MicroBitStorage.h" | ||
|
||
#include "MicroBitComponent.h" | ||
#include "MicroBitEvent.h" | ||
#include "MicroBitListener.h" | ||
#include "EventModel.h" | ||
|
||
#define PARTIAL_FLASHING_VERSION 0x01 | ||
|
||
// BLE PF Control Codes | ||
#define REGION_INFO 0x00 | ||
#define FLASH_DATA 0x01 | ||
#define END_OF_TRANSMISSION 0x02 | ||
|
||
// BLE Utilities | ||
#define MICROBIT_STATUS 0xEE | ||
#define MICROBIT_RESET 0xFF | ||
|
||
// UUIDs for our service and characteristics | ||
extern const uint8_t MicroBitPartialFlashingServiceUUID[]; | ||
extern const uint8_t MicroBitPartialFlashingServiceCharacteristicUUID[]; | ||
|
||
/** | ||
* Class definition for the custom MicroBit Partial Flash Service. | ||
* Provides a BLE service to remotely read the memory map and flash the PXT program. | ||
*/ | ||
class MicroBitPartialFlashingService | ||
{ | ||
public: | ||
/** | ||
* Constructor. | ||
* Create a representation of the Partial Flash Service | ||
* @param _ble The instance of a BLE device that we're running on. | ||
* @param _memoryMap An instance of MicroBiteMemoryMap to interface with. | ||
*/ | ||
MicroBitPartialFlashingService(BLEDevice &_ble, EventModel &_messageBus); | ||
|
||
/** | ||
* Callback. Invoked when any of our attributes are written via BLE. | ||
*/ | ||
void onDataWritten(const GattWriteCallbackParams *params); | ||
|
||
/** | ||
* Callback. Invoked when any of our attributes are read via BLE. | ||
*/ | ||
void onDataRead(GattReadAuthCallbackParams *params); | ||
|
||
private: | ||
// M:B Bluetooth stack and MessageBus | ||
BLEDevice &ble; | ||
EventModel &messageBus; | ||
|
||
/** | ||
* Writing to flash inside MicroBitEvent rather than in the ISR | ||
*/ | ||
void partialFlashingEvent(MicroBitEvent e); | ||
|
||
// Handles to access each characteristic when they are held by Soft Device. | ||
GattAttribute::Handle_t partialFlashCharacteristicHandle; | ||
|
||
/** | ||
* Process a Partial Flashing data packet | ||
*/ | ||
void flashData(uint8_t *data); | ||
|
||
// Ensure packets are in order | ||
uint8_t packetCount = 0; | ||
uint8_t blockPacketCount = 0; | ||
|
||
// Keep track of blocks of data | ||
uint32_t block[16]; | ||
uint8_t blockNum = 0; | ||
uint32_t offset = 0; | ||
|
||
}; | ||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.