Skip to content

Commit 4eb47df

Browse files
committed
Don't run C++ constructors until after IO setup
This way, io setup done in constructors is not overwritten
1 parent 0f19898 commit 4eb47df

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

hardware/arduino/sam/variants/arduino_due_x/variant.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -380,9 +380,6 @@ void init( void )
380380
while (true);
381381
}
382382

383-
// Initialize C library
384-
__libc_init_array();
385-
386383
// Disable pull-up on every pin
387384
for (unsigned i = 0; i < PINS_COUNT; i++)
388385
digitalWrite(i, LOW);
@@ -445,6 +442,9 @@ void init( void )
445442

446443
// Initialize analogOutput module
447444
analogOutputInit();
445+
446+
// Initialize C library and run C++ constructors
447+
__libc_init_array();
448448
}
449449

450450
#ifdef __cplusplus

0 commit comments

Comments
 (0)