Skip to content

Commit 66a93be

Browse files
committed
Merge branch 'master' of https://github.com/mbedmicro/mbed
2 parents c531cab + 809d8aa commit 66a93be

File tree

122 files changed

+18840
-11569
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+18840
-11569
lines changed

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
---
2-
python:
1+
---
2+
python:
33
- "2.7"
44
script: "python workspace_tools/build_travis.py"
55
install:
66
- "sudo $TRAVIS_BUILD_DIR/travis/install_dependencies.sh > /dev/null"
77
- sudo pip install colorama
8-
- sudo pip install prettytable
8+
- sudo pip install prettytable
9+
- sudo pip install jinja2

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ You can for example read more in our ```docs``` section in [mbedmicro/mbed/doc](
1010
# How to contribute
1111
We really appreciate your contributions! We are Open Source project and we need your help. We want to keep it as easy as possible to contribute changes that get things working in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.
1212

13+
Before a pull request will be merged, the [mbed Contributor Agreement](http://developer.mbed.org/contributor_agreement/) must be signed.
14+
1315
You can pick up existing [mbed GitHub Issue](https://github.com/mbedmicro/mbed/issues) and solve it or implement new feature you find important, attractive or just necessary. We will review your proposal via pull request mechanism, give you comments and merge your changes if we decide your contribution satisfy criteria such as quality.
1416

1517
# Enhancements vs Bugs

libraries/USBDevice/USBMIDI/MIDIMessage.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@
4444
/** A MIDI message container */
4545
class MIDIMessage {
4646
public:
47-
MIDIMessage() {}
47+
MIDIMessage() : length(4) {}
4848

49-
MIDIMessage(uint8_t *buf) {
49+
MIDIMessage(uint8_t *buf) : length(4) {
5050
for (int i = 0; i < 4; i++)
5151
data[i] = buf[i];
5252
}
@@ -270,7 +270,7 @@ class MIDIMessage {
270270
}
271271

272272
uint8_t data[MAX_MIDI_MESSAGE_SIZE+1];
273-
uint8_t length=4;
273+
uint8_t length;
274274
};
275275

276276
#endif

libraries/USBDevice/USBMIDI/USBMIDI.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
#include "USBMIDI.h"
2121

2222

23-
USBMIDI::USBMIDI(uint16_t vendor_id, uint16_t product_id, uint16_t product_release): USBDevice(vendor_id, product_id, product_release) {
23+
USBMIDI::USBMIDI(uint16_t vendor_id, uint16_t product_id, uint16_t product_release)
24+
: USBDevice(vendor_id, product_id, product_release), cur_data(0), data_end(true)
25+
{
2426
midi_evt = NULL;
2527
USBDevice::connect();
2628
}

libraries/USBDevice/USBMIDI/USBMIDI.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ class USBMIDI: public USBDevice {
103103

104104
private:
105105
uint8_t data[MAX_MIDI_MESSAGE_SIZE+1];
106-
uint8_t cur_data=0;
107-
bool data_end = true;
106+
uint8_t cur_data;
107+
bool data_end;
108108

109109
void (*midi_evt)(MIDIMessage);
110110
};

libraries/USBDevice/USBMSD/USBMSD.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,10 @@ bool USBMSD::connect(bool blocking) {
135135
}
136136

137137
void USBMSD::disconnect() {
138+
USBDevice::disconnect();
138139
//De-allocate MSD page size:
139140
free(page);
140141
page = NULL;
141-
USBDevice::disconnect();
142142
}
143143

144144
void USBMSD::reset() {

libraries/USBDevice/USBSerial/CircBuffer.h

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,10 @@
1919
#ifndef CIRCBUFFER_H
2020
#define CIRCBUFFER_H
2121

22-
template <class T>
22+
template <class T, int Size>
2323
class CircBuffer {
2424
public:
25-
CircBuffer(int length) {
26-
write = 0;
27-
read = 0;
28-
size = length + 1;
29-
buf = (T *)malloc(size * sizeof(T));
30-
};
31-
32-
~CircBuffer() {
33-
free(buf);
34-
}
35-
25+
CircBuffer():write(0), read(0){}
3626
bool isFull() {
3727
return ((write + 1) % size == read);
3828
};
@@ -66,8 +56,8 @@ class CircBuffer {
6656
private:
6757
volatile uint16_t write;
6858
volatile uint16_t read;
69-
uint16_t size;
70-
T * buf;
59+
static const int size = Size+1; //a modern optimizer should be able to remove this so it uses no ram.
60+
T buf[Size];
7161
};
7262

7363
#endif

libraries/USBDevice/USBSerial/USBSerial.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class USBSerial: public USBCDC, public Stream {
5656
* @param connect_blocking define if the connection must be blocked if USB not plugged in
5757
*
5858
*/
59-
USBSerial(uint16_t vendor_id = 0x1f00, uint16_t product_id = 0x2012, uint16_t product_release = 0x0001, bool connect_blocking = true): USBCDC(vendor_id, product_id, product_release, connect_blocking), buf(128){
59+
USBSerial(uint16_t vendor_id = 0x1f00, uint16_t product_id = 0x2012, uint16_t product_release = 0x0001, bool connect_blocking = true): USBCDC(vendor_id, product_id, product_release, connect_blocking){
6060
settingsChangedCallback = 0;
6161
};
6262

@@ -154,7 +154,7 @@ class USBSerial: public USBCDC, public Stream {
154154

155155
private:
156156
FunctionPointer rx;
157-
CircBuffer<uint8_t> buf;
157+
CircBuffer<uint8_t,128> buf;
158158
void (*settingsChangedCallback)(int baud, int bits, int parity, int stop);
159159
};
160160

libraries/mbed/targets/cmsis/TARGET_Freescale/TARGET_K20XX/TARGET_TEENSY3_1/TOOLCHAIN_GCC_ARM/MK20DX256.ld

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ SECTIONS
4242
{
4343
.isr_vector :
4444
{
45-
__vector_table = .;
46-
KEEP(*(.vector_table))
45+
. = 0;
46+
__isr_vector = .;
47+
KEEP(*(.isr_vector))
4748
*(.text.Reset_Handler)
48-
*(.text.System_Init)
49+
*(.text.SystemInit)
4950
. = ALIGN(4);
5051
} > VECTORS
5152

libraries/mbed/targets/cmsis/TARGET_Freescale/TARGET_K20XX/TARGET_TEENSY3_1/TOOLCHAIN_GCC_ARM/startup_MK20DX256.s

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,13 @@ __isr_vector:
192192
.globl Reset_Handler
193193
.type Reset_Handler, %function
194194
Reset_Handler:
195+
/*
196+
* Call SystemInit before loading the .data section to prevent the watchdog
197+
* from resetting the board.
198+
*/
199+
ldr r0, =SystemInit
200+
blx r0
201+
195202
/* Loop to copy data from read only memory to RAM. The ranges
196203
* of copy from/to are specified by following symbols evaluated in
197204
* linker script.
@@ -212,8 +219,6 @@ Reset_Handler:
212219

213220
.Lflash_to_ram_loop_end:
214221

215-
ldr r0, =SystemInit
216-
blx r0
217222
ldr r0, =_start
218223
bx r0
219224
.pool

libraries/mbed/targets/cmsis/TARGET_Freescale/TARGET_K20XX/TARGET_TEENSY3_1/system_MK20DX256.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ uint32_t SystemCoreClock = DEFAULT_SYSTEM_CLOCK;
100100
-- SystemInit()
101101
---------------------------------------------------------------------------- */
102102
void SystemInit (void) {
103+
/* SystemInit MUST NOT use any variables from the .data section, as this section is not loaded yet! */
104+
103105
#if (DISABLE_WDOG)
104106
/* Disable the WDOG module */
105107
/* WDOG_UNLOCK: WDOGUNLOCK=0xC520 */

libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_ARM_STD/TARGET_MCU_NORDIC_16K/nRF51822.sct

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
;
1313
;WITH SOFTDEVICE:
1414

15-
LR_IROM1 0x16000 0x002A000 {
16-
ER_IROM1 0x16000 0x002A000 {
15+
LR_IROM1 0x18000 0x0028000 {
16+
ER_IROM1 0x18000 0x0028000 {
1717
*.o (RESET, +First)
1818
*(InRoot$$Sections)
1919
.ANY (+RO)
@@ -22,6 +22,3 @@ LR_IROM1 0x16000 0x002A000 {
2222
.ANY (+RW +ZI)
2323
}
2424
}
25-
26-
27-

libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_ARM_STD/TARGET_MCU_NORDIC_32K/nRF51822.sct

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
;
1313
;WITH SOFTDEVICE:
1414

15-
LR_IROM1 0x16000 0x002A000 {
16-
ER_IROM1 0x16000 0x002A000 {
15+
LR_IROM1 0x18000 0x0028000 {
16+
ER_IROM1 0x18000 0x0028000 {
1717
*.o (RESET, +First)
1818
*(InRoot$$Sections)
1919
.ANY (+RO)
@@ -22,6 +22,3 @@ LR_IROM1 0x16000 0x002A000 {
2222
.ANY (+RW +ZI)
2323
}
2424
}
25-
26-
27-

libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_GCC_ARM/TARGET_MCU_NORDIC_16K/NRF51822.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
MEMORY
44
{
5-
FLASH (rx) : ORIGIN = 0x00016000, LENGTH = 0x2A000
5+
FLASH (rx) : ORIGIN = 0x00018000, LENGTH = 0x28000
66
RAM (rwx) : ORIGIN = 0x20002000, LENGTH = 0x2000
77
}
88

libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_GCC_ARM/TARGET_MCU_NORDIC_32K/NRF51822.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
MEMORY
44
{
5-
FLASH (rx) : ORIGIN = 0x00016000, LENGTH = 0x2A000
5+
FLASH (rx) : ORIGIN = 0x00018000, LENGTH = 0x28000
66
RAM (rwx) : ORIGIN = 0x20002000, LENGTH = 0x6000
77
}
88

libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F0/TARGET_DISCO_F051R8/system_stm32f0xx.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ void SystemInit(void)
209209
RCC->CIR = 0x00000000;
210210

211211
/* Configure the Cube driver */
212+
SystemCoreClock = 8000000; // At this stage the HSI is used as system clock
212213
HAL_Init();
213214

214215
/* Configure the System clock source, PLL Multiplier and Divider factors,

libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F030R8/system_stm32f0xx.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ void SystemInit(void)
226226
RCC->CIR = 0x00000000;
227227

228228
/* Configure the Cube driver */
229+
SystemCoreClock = 8000000; // At this stage the HSI is used as system clock
229230
HAL_Init();
230231

231232
/* Configure the System clock source, PLL Multiplier and Divider factors,

libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F1/TARGET_DISCO_F100RB/system_stm32f1xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@
159159
uint32_t SystemCoreClock = 72000000; /*!< System Clock Frequency (Core Clock) */
160160
#endif
161161

162-
__IO const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
162+
const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
163163
/**
164164
* @}
165165
*/

libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F1/TARGET_NUCLEO_F103RB/system_stm32f1xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
uint32_t SystemCoreClock = 72000000; /*!< System Clock Frequency (Core Clock) */
162162
#endif
163163

164-
__IO const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
164+
const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
165165
/**
166166
* @}
167167
*/

libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F3XX/stm32f30x_rcc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@
141141

142142
/* Private macro -------------------------------------------------------------*/
143143
/* Private variables ---------------------------------------------------------*/
144-
static __I uint8_t APBAHBPrescTable[16] = {0, 0, 0, 0, 1, 2, 3, 4, 1, 2, 3, 4, 6, 7, 8, 9};
145-
static __I uint16_t ADCPrescTable[16] = {1, 2, 4, 6, 8, 10, 12, 16, 32, 64, 128, 256, 0, 0, 0, 0 };
144+
const uint8_t APBAHBPrescTable[16] = {0, 0, 0, 0, 1, 2, 3, 4, 1, 2, 3, 4, 6, 7, 8, 9};
145+
const uint16_t ADCPrescTable[16] = {1, 2, 4, 6, 8, 10, 12, 16, 32, 64, 128, 256, 0, 0, 0, 0 };
146146

147147
/* Private function prototypes -----------------------------------------------*/
148148
/* Private functions ---------------------------------------------------------*/

libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F3XX/system_stm32f30x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143

144144
uint32_t SystemCoreClock = 64000000; /* Default with HSI. Will be updated if HSE is used */
145145

146-
__I uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
146+
const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
147147

148148
/**
149149
* @}

libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F429ZI/system_stm32f4xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
variable is updated automatically.
156156
*/
157157
uint32_t SystemCoreClock = 168000000;
158-
__IO const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
158+
const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
159159

160160
/**
161161
* @}

libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_DRAGONFLY_F411RE/system_stm32f4xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158
variable is updated automatically.
159159
*/
160160
uint32_t SystemCoreClock = 16000000;
161-
__IO const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
161+
const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
162162

163163
/**
164164
* @}

libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/system_stm32f4xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
variable is updated automatically.
164164
*/
165165
uint32_t SystemCoreClock = 16000000;
166-
__IO const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
166+
const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
167167

168168
/**
169169
* @}

0 commit comments

Comments
 (0)