File tree Expand file tree Collapse file tree 4 files changed +12
-62
lines changed
TARGET_NUMAKER_PFM_NUC472 Expand file tree Collapse file tree 4 files changed +12
-62
lines changed Original file line number Diff line number Diff line change 16
16
17
17
#include "analogin_api.h"
18
18
19
- // NOTE: Ensurce mbed_sdk_init() will get called before C++ global object constructor.
20
- #if defined(__CC_ARM ) || defined(__GNUC__ )
21
- void mbed_sdk_init_forced (void ) __attribute__((constructor (101 )));
22
- #elif defined(__ICCARM__ )
23
- // FIXME: How to achieve it in IAR?
24
- #endif
25
-
26
-
27
19
void mbed_sdk_init (void )
28
20
{
29
21
// NOTE: Support singleton semantics to be called from other init functions
@@ -75,8 +67,3 @@ void mbed_sdk_init(void)
75
67
/* Lock protected registers */
76
68
SYS_LockReg ();
77
69
}
78
-
79
- void mbed_sdk_init_forced (void )
80
- {
81
- mbed_sdk_init ();
82
- }
Original file line number Diff line number Diff line change @@ -61,12 +61,11 @@ extern uint32_t __bss_start__;
61
61
extern uint32_t __bss_end__ ;
62
62
63
63
extern void uvisor_init (void );
64
- //#if defined(TOOLCHAIN_GCC_ARM)
65
- //extern void _start(void);
66
- //#endif
67
- extern void software_init_hook (void ) __attribute__((weak ));
68
- extern void __libc_init_array (void );
69
- extern int main (void );
64
+ #if defined(TOOLCHAIN_GCC_ARM )
65
+ extern void _start (void );
66
+ #else
67
+ #error ("For GCC toolchain, only support GNU ARM Embedded")
68
+ #endif
70
69
#endif
71
70
72
71
/* Default empty handler */
@@ -307,19 +306,8 @@ void Reset_Handler(void)
307
306
}
308
307
}
309
308
310
- //uvisor_init ();
309
+ _start ();
311
310
312
- if (software_init_hook ) {
313
- /**
314
- * Give control to the RTOS via software_init_hook() which will also call __libc_init_array().
315
- * Assume software_init_hook() is defined in libraries/rtos/rtx/TARGET_CORTEX_M/RTX_CM_lib.h.
316
- */
317
- software_init_hook ();
318
- }
319
- else {
320
- __libc_init_array ();
321
- main ();
322
- }
323
311
#endif
324
312
325
313
/* Infinite loop */
Original file line number Diff line number Diff line change 17
17
#include "cmsis.h"
18
18
#include "analogin_api.h"
19
19
20
- // NOTE: Ensurce mbed_sdk_init() will get called before C++ global object constructor.
21
- #if defined(__CC_ARM ) || defined(__GNUC__ )
22
- void mbed_sdk_init_forced (void ) __attribute__((constructor (101 )));
23
- #elif defined(__ICCARM__ )
24
- // FIXME: How to achieve it in IAR?
25
- #endif
26
-
27
20
void mbed_sdk_init (void )
28
21
{
29
22
// NOTE: Support singleton semantics to be called from other init functions
@@ -88,8 +81,3 @@ void mbed_sdk_init(void)
88
81
/* Lock protected registers */
89
82
SYS_LockReg ();
90
83
}
91
-
92
- void mbed_sdk_init_forced (void )
93
- {
94
- mbed_sdk_init ();
95
- }
Original file line number Diff line number Diff line change @@ -63,12 +63,11 @@ extern uint32_t __bss_extern_start__ WEAK;
63
63
extern uint32_t __bss_extern_end__ WEAK ;
64
64
65
65
extern void uvisor_init (void );
66
- //#if defined(TOOLCHAIN_GCC_ARM)
67
- //extern void _start(void);
68
- //#endif
69
- extern void software_init_hook (void ) __attribute__((weak ));
70
- extern void __libc_init_array (void );
71
- extern int main (void );
66
+ #if defined(TOOLCHAIN_GCC_ARM )
67
+ extern void _start (void );
68
+ #else
69
+ #error ("For GCC toolchain, only support GNU ARM Embedded")
70
+ #endif
72
71
#endif
73
72
74
73
/* Default empty handler */
@@ -476,19 +475,7 @@ void Reset_Handler(void)
476
475
}
477
476
}
478
477
479
- //uvisor_init();
480
-
481
- if (software_init_hook ) {
482
- /**
483
- * Give control to the RTOS via software_init_hook() which will also call __libc_init_array().
484
- * Assume software_init_hook() is defined in libraries/rtos/rtx/TARGET_CORTEX_M/RTX_CM_lib.h.
485
- */
486
- software_init_hook ();
487
- }
488
- else {
489
- __libc_init_array ();
490
- main ();
491
- }
478
+ _start ();
492
479
493
480
#endif
494
481
/* Infinite loop */
You can’t perform that action at this time.
0 commit comments