Skip to content

Commit 46f6f9f

Browse files
committed
atmel-samd: Start USB at the end so storage is initialized.
1 parent aacb1ad commit 46f6f9f

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

atmel-samd/main.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,11 @@ int main(int argc, char **argv) {
196196
stack_top = (char*)&stack_dummy;
197197
reset_mp();
198198

199+
// Start USB after getting everything going.
200+
#ifdef USB_REPL
201+
udc_start();
202+
#endif
203+
199204
// Main script is finished, so now go into REPL mode.
200205
// The REPL mode can change, or it can request a soft reset.
201206
int exit_code = 0;
@@ -327,10 +332,6 @@ void samd21_init(void) {
327332
// pin_conf.direction = PORT_PIN_DIR_OUTPUT;
328333
// port_pin_set_config(MICROPY_HW_LED1, &pin_conf);
329334
// port_pin_set_output_level(MICROPY_HW_LED1, false);
330-
331-
#ifdef USB_REPL
332-
udc_start();
333-
#endif
334335
}
335336

336337
#endif

0 commit comments

Comments
 (0)