Skip to content

Commit e40332f

Browse files
committed
Merge branch 'master' into dev_target_k64f
Conflicts: workspace_tools/build_api.py workspace_tools/export/uvision4.py workspace_tools/targets.py workspace_tools/toolchains/__init__.py
2 parents e059f65 + 6bfcd87 commit e40332f

File tree

572 files changed

+207434
-4086
lines changed

Some content is hidden

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

572 files changed

+207434
-4086
lines changed

README.md

Lines changed: 4 additions & 2 deletions

libraries/USBDevice/USBDevice/USBDevice.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ uint8_t * USBDevice::stringLangidDesc() {
926926
static uint8_t stringLangidDescriptor[] = {
927927
0x04, /*bLength*/
928928
STRING_DESCRIPTOR, /*bDescriptorType 0x03*/
929-
0x09,0x00, /*bString Lang ID - 0x009 - English*/
929+
0x09,0x04, /*bString Lang ID - 0x0409 - English*/
930930
};
931931
return stringLangidDescriptor;
932932
}

libraries/USBDevice/USBDevice/USBDevice_Types.h

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

5050
/* Descriptors */
5151
#define DESCRIPTOR_TYPE(wValue) (wValue >> 8)
52-
#define DESCRIPTOR_INDEX(wValue) (wValue & 0xf)
52+
#define DESCRIPTOR_INDEX(wValue) (wValue & 0xff)
5353

5454
typedef struct {
5555
struct {

libraries/USBDevice/USBDevice/USBHAL_LPC11U.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1717
*/
1818

19-
#if defined(TARGET_LPC11U24) || defined(TARGET_LPC1347)
19+
#if defined(TARGET_LPC11U24) || defined(TARGET_LPC11U35_401) || defined(TARGET_LPC1347)
2020

2121
#if defined(TARGET_LPC1347)
2222
#define USB_IRQ USB_IRQ_IRQn
23-
#elif defined(TARGET_LPC11U24)
23+
#elif defined(TARGET_LPC11U24) || defined(TARGET_LPC11U35_401)
2424
#define USB_IRQ USB_IRQn
2525
#endif
2626

@@ -145,6 +145,11 @@ USBHAL::USBHAL(void) {
145145
epCallback[6] = &USBHAL::EP4_OUT_callback;
146146
epCallback[7] = &USBHAL::EP4_IN_callback;
147147

148+
#if defined(TARGET_LPC11U35_401)
149+
// USB_VBUS input with pull-down
150+
LPC_IOCON->PIO0_3 = 0x00000009;
151+
#endif
152+
148153
// nUSB_CONNECT output
149154
LPC_IOCON->PIO0_6 = 0x00000001;
150155

libraries/USBHost/USBHost/USBHost.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ USB_TYPE USBHost::enumerate(USBDeviceConnected * dev, IUSBEnumerator* pEnumerato
855855
return res;
856856
}
857857

858-
#if DEBUG
858+
#if (DEBUG > 3)
859859
USB_DBG("CONFIGURATION DESCRIPTOR:\r\n");
860860
for (int i = 0; i < total_conf_descr_length; i++)
861861
printf("%02X ", data[i]);

libraries/mbed/common/board.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,37 +19,41 @@
1919

2020
WEAK void mbed_die(void);
2121
WEAK void mbed_die(void) {
22-
#if defined(DEVICE_ERROR_RED)
22+
__disable_irq(); // dont allow interrupts to disturb the flash pattern
23+
24+
#if (DEVICE_ERROR_RED == 1)
2325
gpio_t led_red; gpio_init(&led_red, LED_RED, PIN_OUTPUT);
2426

25-
#elif defined(DEVICE_ERROR_PATTERN)
27+
#elif (DEVICE_ERROR_PATTERN == 1)
2628
gpio_t led_1; gpio_init(&led_1, LED1, PIN_OUTPUT);
2729
gpio_t led_2; gpio_init(&led_2, LED2, PIN_OUTPUT);
2830
gpio_t led_3; gpio_init(&led_3, LED3, PIN_OUTPUT);
2931
gpio_t led_4; gpio_init(&led_4, LED4, PIN_OUTPUT);
3032
#endif
3133

3234
while (1) {
33-
#if defined(DEVICE_ERROR_RED)
35+
#if (DEVICE_ERROR_RED == 1)
3436
gpio_write(&led_red, 1);
3537

36-
#elif defined(DEVICE_ERROR_PATTERN)
38+
#elif (DEVICE_ERROR_PATTERN == 1)
3739
gpio_write(&led_1, 1);
3840
gpio_write(&led_2, 0);
3941
gpio_write(&led_3, 0);
4042
gpio_write(&led_4, 1);
4143
#endif
44+
4245
wait_ms(150);
4346

44-
#if defined(DEVICE_ERROR_RED)
47+
#if (DEVICE_ERROR_RED == 1)
4548
gpio_write(&led_red, 0);
4649

47-
#elif defined(DEVICE_ERROR_PATTERN)
50+
#elif (DEVICE_ERROR_PATTERN == 1)
4851
gpio_write(&led_1, 0);
4952
gpio_write(&led_2, 1);
5053
gpio_write(&led_3, 1);
5154
gpio_write(&led_4, 0);
5255
#endif
56+
5357
wait_ms(150);
5458
}
5559
}

libraries/mbed/common/retarget.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,22 +398,31 @@ extern "C" WEAK void __cxa_pure_virtual(void) {
398398

399399
// ****************************************************************************
400400
// mbed_main is a function that is called before main()
401+
// mbed_sdk_init() is also a function that is called before main(), but unlike
402+
// mbed_main(), it is not meant for user code, but for the SDK itself to perform
403+
// initializations before main() is called.
401404

402405
extern "C" WEAK void mbed_main(void);
403406
extern "C" WEAK void mbed_main(void) {
404407
}
405408

409+
extern "C" WEAK void mbed_sdk_init(void);
410+
extern "C" WEAK void mbed_sdk_init(void) {
411+
}
412+
406413
#if defined(TOOLCHAIN_ARM)
407414
extern "C" int $Super$$main(void);
408415

409416
extern "C" int $Sub$$main(void) {
417+
mbed_sdk_init();
410418
mbed_main();
411419
return $Super$$main();
412420
}
413421
#elif defined(TOOLCHAIN_GCC)
414422
extern "C" int __real_main(void);
415423

416424
extern "C" int __wrap_main(void) {
425+
mbed_sdk_init();
417426
mbed_main();
418427
return __real_main();
419428
}
@@ -424,6 +433,7 @@ extern "C" int __wrap_main(void) {
424433
// code will call a function to setup argc and argv (__iar_argc_argv) if it is defined.
425434
// Since mbed doesn't use argc/argv, we use this function to call our mbed_main.
426435
extern "C" void __iar_argc_argv() {
436+
mbed_sdk_init();
427437
mbed_main();
428438
}
429439
#endif

libraries/mbed/common/rtc_time.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,15 @@
1919
#include "rtc_time.h"
2020
#include "us_ticker_api.h"
2121

22+
#ifdef __cplusplus
23+
extern "C" {
24+
#endif
2225
#if defined (__ICCARM__)
2326
time_t __time32(time_t *timer)
2427
#else
2528
time_t time(time_t *timer)
2629
#endif
30+
2731
{
2832
#if DEVICE_RTC
2933
if (!(rtc_isenabled())) {
@@ -53,3 +57,7 @@ clock_t clock() {
5357
t /= 1000000 / CLOCKS_PER_SEC; // convert to processor time
5458
return t;
5559
}
60+
61+
#ifdef __cplusplus
62+
}
63+
#endif
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
;WITHOUT SOFTDEVICE:
2+
;LR_IROM1 0x00000000 0x00040000 {
3+
; ER_IROM1 0x00000000 0x00040000 {
4+
; *.o (RESET, +First)
5+
; *(InRoot$$Sections)
6+
; .ANY (+RO)
7+
; }
8+
; RW_IRAM1 0x20000000 0x00004000 {
9+
; .ANY (+RW +ZI)
10+
; }
11+
;}
12+
;
13+
;WITH SOFTDEVICE:
14+
15+
LR_IROM1 0x14000 0x002C000 {
16+
ER_IROM1 0x14000 0x002C000 {
17+
*.o (RESET, +First)
18+
*(InRoot$$Sections)
19+
.ANY (+RO)
20+
}
21+
RW_IRAM1 0x20002000 0x00002000 {
22+
.ANY (+RW +ZI)
23+
}
24+
}
25+
26+
27+
Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
; mbed Microcontroller Library
2+
; Copyright (c) 2006-2013 ARM Limited
3+
;Licensed under the Apache License, Version 2.0 (the "License");
4+
;you may not use this file except in compliance with the License.
5+
;You may obtain a copy of the License at
6+
;http://www.apache.org/licenses/LICENSE-2.0
7+
;Unless required by applicable law or agreed to in writing, software
8+
;distributed under the License is distributed on an "AS IS" BASIS,
9+
;WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
;See the License for the specific language governing permissions and
11+
;limitations under the License.
12+
13+
; Description message
14+
15+
__initial_sp EQU 0x20004000
16+
17+
18+
PRESERVE8
19+
THUMB
20+
21+
; Vector Table Mapped to Address 0 at Reset
22+
23+
AREA RESET, DATA, READONLY
24+
EXPORT __Vectors
25+
EXPORT __Vectors_End
26+
EXPORT __Vectors_Size
27+
28+
__Vectors DCD __initial_sp ; Top of Stack
29+
DCD Reset_Handler ; Reset Handler
30+
DCD NMI_Handler ; NMI Handler
31+
DCD HardFault_Handler ; Hard Fault Handler
32+
DCD 0 ; Reserved
33+
DCD 0 ; Reserved
34+
DCD 0 ; Reserved
35+
DCD 0 ; Reserved
36+
DCD 0 ; Reserved
37+
DCD 0 ; Reserved
38+
DCD 0 ; Reserved
39+
DCD SVC_Handler ; SVCall Handler
40+
DCD 0 ; Reserved
41+
DCD 0 ; Reserved
42+
DCD PendSV_Handler ; PendSV Handler
43+
DCD SysTick_Handler ; SysTick Handler
44+
45+
; External Interrupts
46+
DCD POWER_CLOCK_IRQHandler ;POWER_CLOCK
47+
DCD RADIO_IRQHandler ;RADIO
48+
DCD UART0_IRQHandler ;UART0
49+
DCD SPI0_TWI0_IRQHandler ;SPI0_TWI0
50+
DCD SPI1_TWI1_IRQHandler ;SPI1_TWI1
51+
DCD 0 ;Reserved
52+
DCD GPIOTE_IRQHandler ;GPIOTE
53+
DCD ADC_IRQHandler ;ADC
54+
DCD TIMER0_IRQHandler ;TIMER0
55+
DCD TIMER1_IRQHandler ;TIMER1
56+
DCD TIMER2_IRQHandler ;TIMER2
57+
DCD RTC0_IRQHandler ;RTC0
58+
DCD TEMP_IRQHandler ;TEMP
59+
DCD RNG_IRQHandler ;RNG
60+
DCD ECB_IRQHandler ;ECB
61+
DCD CCM_AAR_IRQHandler ;CCM_AAR
62+
DCD WDT_IRQHandler ;WDT
63+
DCD RTC1_IRQHandler ;RTC1
64+
DCD QDEC_IRQHandler ;QDEC
65+
DCD LPCOMP_COMP_IRQHandler ;LPCOMP_COMP
66+
DCD SWI0_IRQHandler ;SWI0
67+
DCD SWI1_IRQHandler ;SWI1
68+
DCD SWI2_IRQHandler ;SWI2
69+
DCD SWI3_IRQHandler ;SWI3
70+
DCD SWI4_IRQHandler ;SWI4
71+
DCD SWI5_IRQHandler ;SWI5
72+
DCD 0 ;Reserved
73+
DCD 0 ;Reserved
74+
DCD 0 ;Reserved
75+
DCD 0 ;Reserved
76+
DCD 0 ;Reserved
77+
DCD 0 ;Reserved
78+
79+
80+
__Vectors_End
81+
82+
__Vectors_Size EQU __Vectors_End - __Vectors
83+
84+
AREA |.text|, CODE, READONLY
85+
86+
; Reset Handler
87+
88+
NRF_POWER_RAMON_ADDRESS EQU 0x40000524 ; NRF_POWER->RAMON address
89+
NRF_POWER_RAMON_RAMxON_ONMODE_Msk EQU 0xF ; All RAM blocks on in onmode bit mask
90+
91+
Reset_Handler PROC
92+
EXPORT Reset_Handler [WEAK]
93+
IMPORT SystemInit
94+
IMPORT __main
95+
LDR R0, =NRF_POWER_RAMON_ADDRESS
96+
LDR R2, [R0]
97+
MOVS R1, #NRF_POWER_RAMON_RAMxON_ONMODE_Msk
98+
ORRS R2, R2, R1
99+
STR R2, [R0]
100+
LDR R0, =SystemInit
101+
BLX R0
102+
LDR R0, =__main
103+
BX R0
104+
ENDP
105+
106+
; Dummy Exception Handlers (infinite loops which can be modified)
107+
108+
NMI_Handler PROC
109+
EXPORT NMI_Handler [WEAK]
110+
B .
111+
ENDP
112+
HardFault_Handler\
113+
PROC
114+
EXPORT HardFault_Handler [WEAK]
115+
B .
116+
ENDP
117+
SVC_Handler PROC
118+
EXPORT SVC_Handler [WEAK]
119+
B .
120+
ENDP
121+
PendSV_Handler PROC
122+
EXPORT PendSV_Handler [WEAK]
123+
B .
124+
ENDP
125+
SysTick_Handler PROC
126+
EXPORT SysTick_Handler [WEAK]
127+
B .
128+
ENDP
129+
130+
Default_Handler PROC
131+
132+
EXPORT POWER_CLOCK_IRQHandler [WEAK]
133+
EXPORT RADIO_IRQHandler [WEAK]
134+
EXPORT UART0_IRQHandler [WEAK]
135+
EXPORT SPI0_TWI0_IRQHandler [WEAK]
136+
EXPORT SPI1_TWI1_IRQHandler [WEAK]
137+
EXPORT GPIOTE_IRQHandler [WEAK]
138+
EXPORT ADC_IRQHandler [WEAK]
139+
EXPORT TIMER0_IRQHandler [WEAK]
140+
EXPORT TIMER1_IRQHandler [WEAK]
141+
EXPORT TIMER2_IRQHandler [WEAK]
142+
EXPORT RTC0_IRQHandler [WEAK]
143+
EXPORT TEMP_IRQHandler [WEAK]
144+
EXPORT RNG_IRQHandler [WEAK]
145+
EXPORT ECB_IRQHandler [WEAK]
146+
EXPORT CCM_AAR_IRQHandler [WEAK]
147+
EXPORT WDT_IRQHandler [WEAK]
148+
EXPORT RTC1_IRQHandler [WEAK]
149+
EXPORT QDEC_IRQHandler [WEAK]
150+
EXPORT LPCOMP_COMP_IRQHandler [WEAK]
151+
EXPORT SWI0_IRQHandler [WEAK]
152+
EXPORT SWI1_IRQHandler [WEAK]
153+
EXPORT SWI2_IRQHandler [WEAK]
154+
EXPORT SWI3_IRQHandler [WEAK]
155+
EXPORT SWI4_IRQHandler [WEAK]
156+
EXPORT SWI5_IRQHandler [WEAK]
157+
POWER_CLOCK_IRQHandler
158+
RADIO_IRQHandler
159+
UART0_IRQHandler
160+
SPI0_TWI0_IRQHandler
161+
SPI1_TWI1_IRQHandler
162+
GPIOTE_IRQHandler
163+
ADC_IRQHandler
164+
TIMER0_IRQHandler
165+
TIMER1_IRQHandler
166+
TIMER2_IRQHandler
167+
RTC0_IRQHandler
168+
TEMP_IRQHandler
169+
RNG_IRQHandler
170+
ECB_IRQHandler
171+
CCM_AAR_IRQHandler
172+
WDT_IRQHandler
173+
RTC1_IRQHandler
174+
QDEC_IRQHandler
175+
LPCOMP_COMP_IRQHandler
176+
SWI0_IRQHandler
177+
SWI1_IRQHandler
178+
SWI2_IRQHandler
179+
SWI3_IRQHandler
180+
SWI4_IRQHandler
181+
SWI5_IRQHandler
182+
183+
B .
184+
ENDP
185+
ALIGN
186+
END
187+

0 commit comments

Comments
 (0)