Commit Graph

346 Commits (master)

Author SHA1 Message Date
Sam Kent 521381d276 Remove int1,2,3 2018-11-22 14:00:07 +00:00
Jonathan Austin 3e37cc9c4e Make microbit_heap_print() available externally
The heap printing in MicrobitHeapAllocator is really useful for
gauging how much memory is free at various points in the program.

Specifically, by calling this after the uBit object is created we
can start to measure a high-water-mark for RAM and track it over
releases, etc
2018-10-02 17:14:05 +01:00
Sam Kent 01d6d4f39a Added Yotta Glue 2018-09-27 12:12:01 +01:00
Sam Kent 7aedfab59a Add defines for radio upper/lower freq 2018-09-24 18:26:48 +01:00
Joe Finney d3d64283a7 Fixes to LSM303 DATA_READY Signal detection and configuration
Updates to LSM303 magnetometer driver to:
  - Configure for a clean DATA_READY signal, disabling all other interrupt
    sources
  - Correct the interrupt polarity

Updates to MicroBitCompass to:
  - Define configure() as virtual, to enable applicaiton uses to correclty
    configure all magnetometers for update period.
2018-09-13 12:58:28 +01:00
Joe Finney da620c0f3f
Merge pull request #380 from lancaster-university/messagebus-patch
Messagebus patch
2018-09-07 18:35:20 +01:00
Joe Finney 34e46f04e4
Merge pull request #382 from microbit-sam/pf-yt-toggle
Use config.json to enable / disable Partial Flashing Service
2018-09-07 17:55:41 +01:00
Joe Finney 1a4d5abd7b Introduce CONFIG option to enable/disable microbit heap allocator
- Add CONFIG option to MicroBitConfig.h
  - Add YOTTA glue for config.json mapping
  - Introduce conditional compilation into MicroBitHeapAllocator.cpp
2018-09-07 17:41:49 +01:00
Joe Finney 4dda6ef298 Disable DEBUG information 2018-09-07 14:51:26 +01:00
Joe Finney c3beca20c6 First compiling build of overriding heap allocator 2018-09-06 16:03:00 +01:00
Joe Finney 83e1795945 Add config.json glue logic for MICROBIT_FULL_RANGE_PITCH_CALCULATION 2018-09-06 14:35:32 +01:00
Joe Finney 14f4c0e64e Merge branch 'hardware-unavailable' of git://github.com/microbit-sam/microbit-dal into dal-integration 2018-09-05 10:31:13 +01:00
Joe Finney 97382b8fb0 Merge remote-tracking branch 'origin/s130-config' into dal-integration 2018-09-05 09:51:38 +01:00
Joe Finney 95c1fc7f05 Fix Calculation of Pitch/Roll. Fixes #371
This patch:

 - Corrects the getPitch() and getRoll() methods to use normalized data from accelerometer sensors.
 - Provides a compile time option (default: enabled) to provide full range 0..360 degree pitch data
   that is consistent with the rage of the roll data.
 - Updates the tilt compensated compass heading calculation to use normalized data from accelerometer sensors.
2018-09-04 23:43:32 +01:00
Sam Kent 26d7b6d420 Partial Flashing disabled by default. Enabled for MakeCode builds 2018-08-29 19:14:08 +01:00
James Devine 9fcfe937ae Added listener_deletion_callback member to EventModel
In upcoming commits I will add the ability to add/ignore listeners based also on the given listener cb_arg. With the possibility of multiple handlers being deleted at once, it's useful to application developers to be able to inspect what is being removed.
2018-08-26 22:45:03 -07:00
Sam Kent f385db52d5 Error 050: Accelerometer unavailable; 051: Magnetometer unavailable 2018-08-20 11:32:05 +01:00
Jonny Austin e3188e315a Add SoftDevice values for S130v1
These values are determined from
http://infocenter.nordicsemi.com/pdf/S130_SDS_v1.0.pdf
pg 41

It appears using S130v2 would allow even lower memory consumption

This is for use in conjunction with the
bbc-microbot-classic-gcc-s130
target, which also needs a fix before it will work.
2018-07-12 09:29:07 +01:00
Joe Finney 52e308658f Merge branch 'partial-flashing' into dal-integration 2018-07-06 17:42:09 +01:00
Sam Kent e13d31c27a Fix whitespace 2018-07-06 16:57:59 +01:00
Sam Kent 36dff6e73f Fix GATT Table. Replace CortexContextSwitch.s 2018-07-06 16:43:14 +01:00
Joe Finney 13459857a5 Disable DEBUG, pending beta release 2018-07-06 04:28:13 +01:00
Joe Finney 57e2485861 Introduce optional persistent storage functionality into
MicroBitCompassCalibrator

  - A new form of constructor now allows for a persistent storage object to be
    provided. If present, compass calibration data will be automatically
    stored and retrieved from FLASH when needed.
2018-07-06 04:18:34 +01:00
Joe Finney 5d4c397311 Remove redundant Matrix4 Class.
- Matrix4 was used only for the least mean squres calculation as part of the
    MicroBitCompassCalibrator. This has now been replace with an itereative
approximation algorithm.
2018-07-06 03:39:02 +01:00
Joe Finney 81b85e1335 Backward compatibility for ::updateSample() methods in sensors. 2018-07-06 03:32:08 +01:00
Joe Finney e770f34636 Add Backward Compatibility for CompassSample type. 2018-07-06 03:17:03 +01:00
Joe Finney d58396aa12 Updates to Compass Calibration and Compass Heading Calculation
- Add mutator to allow accelerometer to be added to a compass after construction
- Use floating point values for Sample3D:dSquared() operations to resmove possible overflow
- Change compass calibration hill climb algorithm to use 100 unit steps to converge faster.
- Update autodetect functions to register accelerometer instances with compass instances upon detection
- Clean and fix axis alignments for tilt compensation algorithm
2018-07-06 03:08:06 +01:00
Joe Finney bbf56210ed Introduce Updates to Compass Calibration Algorithm and UX
- Updated compass calibration algorithm, based on iterative approximation
  - Updated calibration UX
2018-07-05 23:48:41 +01:00
Joe Finney e79284d797 Introduce accelerometer/magnetometer autodetection
- Autodetection logic added to MicroBitAccelerometer/MicroBitCompass
  - Added single byte I2C read utility function into MicroBitI2C
  - Added isDetected() method into sensor drivers
2018-06-15 18:39:56 +01:00
Joe Finney f8ee57bd26 Use correct WHO_AM_I value for LSM303 magnetometer sensor 2018-06-07 17:37:53 +01:00
Joe Finney a4b803d3e7 Updates to configure for FXOS8700 driver on microbit v1.5
- Add pin mapping for third interrupt line as used by FXOS8700
 - Move FXOS to open drain interrupt configuration
 - Add pullup onto interrupt line to FXOS
2018-06-07 17:27:34 +01:00
Sam Kent 040f63b01f
Changes from code review with Joe F (#10)
* Movd MICROBIT_MODE_* defines to MicroBitConfig.h

* Search for embedded source and remove magic

* Fixed memcpy

* Change offset order

* Fixed memcpy for data
2018-06-04 16:13:20 +01:00
Joe Finney f6bee0940e minor fixes after testing 2018-05-31 17:54:33 +01:00
Joe Finney ff29f2133e Refactor Accelerometer/Magnetometer code to enable new drivers 2018-05-29 18:09:48 +01:00
Sam Kent 3413d5487d
Added Partial Flashing Service (#9)
* Memory Map + Partial Flash Service

* Moved Partial Flash Service to Management Mode

* PF Service appears in YT Build not PXT

* PF in PXT

* Swapped DFU and PF Services

* Fixing Flash Writew

* write flash via bluetooth

* Partial Flash -  Fixed Address

* Update module.json

* Adjust flash pointer

* Adjust flash start

* Adjust Flash Pointer

* Added offset to xfer

* Writing to FLASH_END

* Writing to FLASH_END

* Modified PFS read callback

* Reenable BLE Security

* removed pf

* Check diff

* Check diff

* Replaced ContextSwitch

* PF

* Test. Writing Hex File to 0x30000

* Writing to PXT empty space

* Reversed byte order

* Flash 16 bytes at once

* Copy data from static var to local var

* blocks -> bytes

* Fixed offset

* Fixed Offset

* Flash to 0x30000 + offset

* Bypass scratch page

* Changed byte order

* Write Without Response

* Without Fast BLE

* Added fast BLE

* Updated Connection Parameters

* Iterate through BLE data bytes

* Get Hashes From PXT Build

* Copy Hash from Flash

* Testing FLASH_END

* Read Hash From Flash

* Read Hash from Flash

* Reading correct hash from mem

* Endianess

* Modified MAGIC

* Fix Start Address

* Sequence #

* Write 0xdeadbeef to 0x36000 on PF Seq # error

* Group 4 packet blocks for writing

* Added error case

* Increased flash write size

* Blocks

* Fire event to write

* Decreased flash time

* Reformat

* Reduced hash size in MemoryMap

* Partial Flashing w/ Notifications

* One Characteristic - WRITE/WRITE_WOUT_RESP/NOTIFY

* Modified WRITE Notification

* Tidied - Moved end of transfer logic

* Removed VI Swap files

* Added Pairing Mode Event ID

* Modified Retransmit behaviour

* updateFlash caused stack overflow

* Removed flash write from memory map

* Instantiate Memory Map where used

* Word aligned. Added Status and Reset commands

* Fixed: storage. becomes storage->

* Fixed warnings: switch case fall through

* Fix Hash

* Rebuild Map everytime

* Hash Error

* Edited animation. Hash testing

* persistent memory map issues

* Moved EOT

* Modified BLE animation. Removed globals from PFS

* Updated MM

* Added incomplete flash flag

* Re added CCS.s
2018-04-16 17:27:14 +01:00
Damien George d883f33c5b Remove "throw" exception specifications because they are deprecated.
The use of such specifications are deprecated since C++11.
2017-11-16 11:04:40 +11:00
Martin Woolley dcb5398d36 Added MICROBIT_BLE_ADVERTISING_INTERVAL to MicroBitConfig.h 2017-08-31 09:04:12 +01:00
Martin Woolley 002272e048 Exposed Bluetooth advertising interval as config.json property 2017-08-16 12:05:32 +01:00
Joe Finney f90ef0030d Merge pull request #296 from smartyw/master
BLE Magnetometer service has new characteristic for requesting calilbration
2017-07-18 11:14:13 +01:00
Martin Woolley 5980f9015e Refactored to use only one event handler 2017-07-10 09:13:14 +01:00
alennie1993 aacba5f36e Quick Clean up, added MIT Licence to some files and a spelling mistake corrected. Issues #269 & #287 resolved. 2017-06-14 10:03:51 +01:00
Martin Woolley 66fd96b098 Added magnetometer calibration characteristic to the Bluetooth Magnetometer Service 2017-06-06 07:50:03 +01:00
Martin Woolley 621e328df1 Added new Magnetometer Calibration characteristic to Magnetometer Service 2017-05-30 10:17:08 +01:00
Joe Finney c0995137f0 Cleanup internal method names
- Rename isInput() to isActiveInput() to improve readability
  - Remove isOutput() method
2017-05-25 23:41:37 +01:00
Joe Finney 0aaedaa5d9 Remove repeated code in MicroBitIOPinService 2017-05-25 13:38:40 +01:00
James Devine d5ee7d99b6 microbit-dal: Corrected bad validation in MicroBitImage.printImage
width was validated, height was not. Documentation also modified to have a better example that works.
2017-04-23 00:53:16 +01:00
Simon Hosie c1626c208c Remove sentinel pinNC from QDEC; use NULL instead. 2017-04-06 22:27:22 -07:00
Simon Hosie e2ec932480 Use better quadrature decoder flag names.
Name the quadrature QDEC_USE_xx rather than QDEC_USING_xx, because they
represent intent rather than status.

Also fixes bug where system tick wouldn't be registered at start() when
configured to do so.
2017-04-06 22:00:08 -07:00
Simon Hosie 3fd457c2b8 Quadrature decoder hardware driver. 2017-04-02 02:17:39 -07:00
Joe Finney 4b3520daa6 Update to MicrobitBLEManager to allow safe storage of BLE bond information 2017-03-01 17:41:28 +00:00