mirror of https://github.com/ARMmbed/mbed-os.git
Merge remote-tracking branch 'upstream/master'
commit
46003d4c3c
|
@ -425,3 +425,30 @@ extern "C" void __iar_argc_argv() {
|
|||
mbed_main();
|
||||
}
|
||||
#endif
|
||||
|
||||
// Provide implementation of _sbrk (low-level dynamic memory allocation
|
||||
// routine) for GCC_ARM which compares new heap pointer with MSP instead of
|
||||
// SP. This make it compatible with RTX RTOS thread stacks.
|
||||
#if defined(TOOLCHAIN_GCC_ARM)
|
||||
// Linker defined symbol used by _sbrk to indicate where heap should start.
|
||||
extern "C" int __end__;
|
||||
|
||||
// Turn off the errno macro and use actual global variable instead.
|
||||
#undef errno
|
||||
extern "C" int errno;
|
||||
|
||||
// Dynamic memory allocation related syscall.
|
||||
extern "C" caddr_t _sbrk(int incr) {
|
||||
static unsigned char* heap = (unsigned char*)&__end__;
|
||||
unsigned char* prev_heap = heap;
|
||||
unsigned char* new_heap = heap + incr;
|
||||
|
||||
if (new_heap >= (unsigned char*)__get_MSP()) {
|
||||
errno = ENOMEM;
|
||||
return (caddr_t)-1;
|
||||
}
|
||||
|
||||
heap = new_heap;
|
||||
return (caddr_t) prev_heap;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -39,7 +39,28 @@ static const PinMap PinMap_PWM[] = {
|
|||
{D10, PWM_1 , 4}, // PTD0 , TPM0 CH0
|
||||
{D11, PWM_3 , 4}, // PTD2 , TPM0 CH2
|
||||
{D12, PWM_4 , 4}, // PTD3 , TPM0 CH3
|
||||
{D13, PWM_2 , 4}, // PTD1 , TPM0 CH1
|
||||
{D13, PWM_2 , 4}, // PTD1 , TPM0 CH1,
|
||||
|
||||
{PTA0, PWM_6, 3},
|
||||
{PTA3, PWM_1, 3},
|
||||
{PTB0, PWM_7, 3},
|
||||
{PTB1, PWM_8, 3},
|
||||
{PTB2, PWM_9, 3},
|
||||
{PTB3, PWM_10, 3},
|
||||
{PTC1, PWM_1, 4},
|
||||
{PTC2, PWM_2, 4},
|
||||
{PTC3, PWM_3, 4},
|
||||
{PTC4, PWM_4, 4},
|
||||
{PTE20, PWM_7, 3},
|
||||
{PTE21, PWM_8, 3},
|
||||
{PTE22, PWM_9, 3},
|
||||
{PTE23, PWM_10, 3},
|
||||
{PTE24, PWM_1, 3},
|
||||
{PTE25, PWM_2, 3},
|
||||
{PTE29, PWM_3, 3},
|
||||
{PTE30, PWM_4, 3},
|
||||
{PTE31, PWM_5, 3},
|
||||
|
||||
{NC , NC , 0}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue