32 #if defined (__cplusplus)
34 #error Redlib does not support C++
42 extern void __libc_init_array(
void);
47 #define WEAK __attribute__ ((weak))
48 #define ALIAS(f) __attribute__ ((weak, alias (#f)))
51 #if defined (__cplusplus)
56 #if defined (__USE_CMSIS) || defined (__USE_LPCOPEN)
58 extern void SystemInit(
void);
89 void TIMER16_0_IRQHandler(
void)
ALIAS(IntDefaultHandler);
90 void TIMER16_1_IRQHandler(
void)
ALIAS(IntDefaultHandler);
93 #if defined (__USE_LPCOPEN)
94 void SSP0_IRQHandler(
void)
ALIAS(IntDefaultHandler);
100 void USB_FIQHandler(
void)
ALIAS(IntDefaultHandler);
101 void ADC_IRQHandler(
void)
ALIAS(IntDefaultHandler);
102 void WDT_IRQHandler(
void)
ALIAS(IntDefaultHandler);
103 void BOD_IRQHandler(
void)
ALIAS(IntDefaultHandler);
104 void FMC_IRQHandler(
void)
ALIAS(IntDefaultHandler);
105 void PIOINT3_IRQHandler(
void)
ALIAS(IntDefaultHandler);
106 void PIOINT2_IRQHandler(
void)
ALIAS(IntDefaultHandler);
107 void PIOINT1_IRQHandler(
void)
ALIAS(IntDefaultHandler);
108 void PIOINT0_IRQHandler(
void)
ALIAS(IntDefaultHandler);
109 void WAKEUP_IRQHandler(
void)
ALIAS(IntDefaultHandler);
110 void SSP1_IRQHandler(
void)
ALIAS(IntDefaultHandler);
119 #if defined (__REDLIB__)
120 extern void __main(
void);
122 extern int main(
void);
129 extern void _vStackTop(
void);
132 #if defined (__cplusplus)
141 extern void (*
const g_pfnVectors[])(void);
143 void (* const g_pfnVectors[])(
void) = {
213 TIMER16_0_IRQHandler,
214 TIMER16_1_IRQHandler,
217 #if defined (__USE_LPCOPEN)
246 void data_init(
unsigned int romstart,
unsigned int start,
unsigned int len) {
247 unsigned int *pulDest = (
unsigned int*) start;
248 unsigned int *pulSrc = (
unsigned int*) romstart;
250 for (loop = 0; loop < len; loop = loop + 4)
251 *pulDest++ = *pulSrc++;
255 void bss_init(
unsigned int start,
unsigned int len) {
256 unsigned int *pulDest = (
unsigned int*) start;
258 for (loop = 0; loop < len; loop = loop + 4)
286 unsigned int LoadAddr, ExeAddr, SectionLen;
287 unsigned int *SectionTableAddr;
293 while (SectionTableAddr < &__data_section_table_end) {
294 LoadAddr = *SectionTableAddr++;
295 ExeAddr = *SectionTableAddr++;
296 SectionLen = *SectionTableAddr++;
297 data_init(LoadAddr, ExeAddr, SectionLen);
301 while (SectionTableAddr < &__bss_section_table_end) {
302 ExeAddr = *SectionTableAddr++;
303 SectionLen = *SectionTableAddr++;
304 bss_init(ExeAddr, SectionLen);
307 #if defined (__USE_CMSIS) || defined (__USE_LPCOPEN)
311 #if defined (__cplusplus)
318 #if defined (__REDLIB__)
337 void NMI_Handler(
void) {
342 void HardFault_Handler(
void) {
347 void MemManage_Handler(
void) {
352 void BusFault_Handler(
void) {
357 void UsageFault_Handler(
void) {
362 void SVC_Handler(
void) {
367 void DebugMon_Handler(
void) {
372 void PendSV_Handler(
void) {
377 void SysTick_Handler(
void) {
389 void IntDefaultHandler(
void) {
unsigned int __bss_section_table_end
unsigned int __data_section_table_end
WEAK void MemManage_Handler(void)
void I2C_IRQHandler(void TIMER16_0_IRQHandler() ALIAS(IntDefaultHandler) void)
WEAK void UsageFault_Handler(void)
unsigned int __data_section_table
void UART_IRQHandler(void)
__attribute__((section(".after_vectors")))
void TIMER32_0_IRQHandler(void)
unsigned int __bss_section_table
void SSP_IRQHandler(void)
void USB_IRQHandler(void)
WEAK void SVC_Handler(void)
WEAK void NMI_Handler(void)
WEAK void IntDefaultHandler(void)
WEAK void BusFault_Handler(void)
WEAK void HardFault_Handler(void)
WEAK void PendSV_Handler(void)
WEAK void DebugMon_Handler(void)
WEAK void SysTick_Handler(void)
void TIMER32_1_IRQHandler(void)