1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-17 06:52:18 +01:00

Delayed static object construction after hardware setup

This commit is contained in:
Cristian Maglie 2012-09-19 16:23:39 +02:00
parent 8cefac5d3b
commit d994e48c55
4 changed files with 11 additions and 4 deletions

View File

@ -44,7 +44,8 @@ extern uint32_t _estack;
int main(void);
/** \endcond */
void __libc_init_array(void);
// Arduino: we must setup hardware before doing this
// void __libc_init_array(void);
/* Default empty handler */
void Dummy_Handler(void);
@ -272,7 +273,9 @@ void Reset_Handler(void)
}
/* Initialize the C library */
__libc_init_array();
// Arduino: we must setup hardware before doing this
//__libc_init_array();
/* Branch to main function */
main();

View File

@ -288,7 +288,6 @@ startup_sam3xa.o:
00000000 W USART3_Handler
00000000 W UsageFault_Handler
00000000 W WDT_Handler
U __libc_init_array
U _erelocate
U _estack
U _etext

View File

@ -338,7 +338,9 @@ void USART3_Handler( void )
extern "C" {
#endif
extern void init( void )
void __libc_init_array(void);
void init( void )
{
SystemInit() ;
@ -352,6 +354,9 @@ extern void init( void )
// Disable watchdog, common to all SAM variants
WDT_Disable( WDT ) ;
// Initialize C library
__libc_init_array();
// Initialize Serial port UART, common to all SAM3 variants
PIO_Configure(
g_APinDescription[PINS_UART].pPort,