Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions BLE_API.lib
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/lancaster-university/BLE_API/#bbc2dc58f8da1d5a6d1882dddd5ce7399dc48889
6 changes: 3 additions & 3 deletions inc/bluetooth/MicroBitBLEManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ class MicroBitBLEManager : MicroBitComponent
void stopAdvertising();

/**
* A member function used to defer writes to flash, in order to prevent a write collision with
* A member function used to defer writes to flash, in order to prevent a write collision with
* softdevice.
* @param handle The handle offered by soft device during pairing.
* */
Expand Down Expand Up @@ -312,7 +312,7 @@ class MicroBitBLEManager : MicroBitComponent
void showManagementModeAnimation(MicroBitDisplay &display);

#define MICROBIT_BLE_DISCONNECT_AFTER_PAIRING_DELAY 500
unsigned long pairing_completed_at_time;
unsigned long pairing_completed_at_time;

int pairingStatus;
ManagedString passKey;
Expand All @@ -322,7 +322,7 @@ class MicroBitBLEManager : MicroBitComponent
* Default to Application Mode
* This variable will be set to MICROBIT_MODE_PAIRING if pairingMode() is executed.
*/
uint8_t currentMode = MICROBIT_MODE_APPLICATION;
uint8_t currentMode;

};

Expand Down
8 changes: 4 additions & 4 deletions inc/bluetooth/MicroBitPartialFlashingService.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ class MicroBitPartialFlashingService
void flashData(uint8_t *data);

// Ensure packets are in order
uint8_t packetCount = 0;
uint8_t blockPacketCount = 0;
uint8_t packetCount;
uint8_t blockPacketCount;

// Keep track of blocks of data
uint32_t block[16];
uint8_t blockNum = 0;
uint32_t offset = 0;
uint8_t blockNum;
uint32_t offset;

};

Expand Down
24 changes: 24 additions & 0 deletions inc/core/MicroBitHeapAllocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ DEALINGS IN THE SOFTWARE.
#define MICROBIT_HEAP_ALLOCTOR_H

#include "MicroBitConfig.h"
#include <new>

// The maximum number of heap segments that can be created.
#define MICROBIT_MAXIMUM_HEAPS 2
Expand Down Expand Up @@ -85,4 +86,27 @@ struct HeapDefinition
int microbit_create_heap(uint32_t start, uint32_t end);
void microbit_heap_print();

/**
* Attempt to allocate a given amount of memory from any of our configured heap areas.
*
* @param size The amount of memory, in bytes, to allocate.
*
* @return A pointer to the allocated memory, or NULL if insufficient memory is available.
*/
void *_microbit_malloc(size_t size);
void* _microbit_calloc (size_t num, size_t size);
void* _microbit_realloc (void* ptr, size_t size);

/**
* Release a given area of memory from the heap.
*
* @param mem The memory area to release.
*/
void _microbit_free(void *mem);

#define malloc _microbit_malloc
#define free _microbit_free
#define calloc _microbit_calloc
#define realloc _microbit_realloc

#endif
2 changes: 1 addition & 1 deletion inc/core/MicroBitUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ DEALINGS IN THE SOFTWARE.

#include "MicroBitConfig.h"

#define CREATE_KEY_VALUE_TABLE(NAME, PAIRS) const KeyValueTable NAME { PAIRS, sizeof(PAIRS) / sizeof(KeyValueTableEntry) };
#define CREATE_KEY_VALUE_TABLE(NAME, PAIRS) const KeyValueTable NAME = { PAIRS, sizeof(PAIRS) / sizeof(KeyValueTableEntry) };

/**
* Provides a simple key/value pair lookup table with range lookup support.
Expand Down
2 changes: 1 addition & 1 deletion inc/drivers/MicroBitMemoryMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class MicroBitMemoryMap
Region memoryMap[NUMBER_OF_REGIONS];
};

uint8_t regionCount = 0;
uint8_t regionCount;

public:

Expand Down
12 changes: 6 additions & 6 deletions inc/drivers/MicroBitQuadratureDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ DEALINGS IN THE SOFTWARE.
class MicroBitQuadratureDecoder : public MicroBitComponent
{
protected:
int64_t position = 0; // Absolute position
int64_t position; // Absolute position
MicroBitPin& phaseA, // Phase A input for decoding
phaseB; // Phase B input for decoding
MicroBitPin* LED; // LED output to assert while decoding
uint32_t samplePeriod = 128; // Minimum sampling period allowed
uint16_t faults = 0; // Double-transition counter
uint8_t LEDDelay = 0; // power-up time for LED, in microseconds
uint32_t samplePeriod; // Minimum sampling period allowed
uint16_t faults; // Double-transition counter
uint8_t LEDDelay; // power-up time for LED, in microseconds
uint8_t flags;

public:
Expand Down Expand Up @@ -172,9 +172,9 @@ class MicroBitQuadratureDecoder : public MicroBitComponent
*
* Ensures that stop() gets called if necessary.
*/
virtual ~MicroBitQuadratureDecoder() override;
virtual ~MicroBitQuadratureDecoder();

virtual void systemTick() override;
virtual void systemTick();
};

#endif
1 change: 1 addition & 0 deletions mbed-classic.lib
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/geowor01/mbed-classic/#d20ce0213b3a8734477eff8c7d5c35189e695a30
1 change: 1 addition & 0 deletions nRF51822.lib
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/lancaster-university/nRF51822/#040baa12c08b439f9a09f0c1594ac625e58e2ad1
1 change: 1 addition & 0 deletions nrf51-sdk.lib
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/geowor01/nrf51-sdk/#ef7142f00d5d89b0c54862485c4a2c34eaee6a4b
Loading