File tree Expand file tree Collapse file tree 3 files changed +13
-17
lines changed
variants/arduino_zero/linker_scripts/gcc Expand file tree Collapse file tree 3 files changed +13
-17
lines changed Original file line number Diff line number Diff line change @@ -106,26 +106,22 @@ static void check_start_application(void)
106106 }
107107 else
108108 {
109- switch (BOOT_DOUBLE_TAP_DATA ) {
110- case 0 :
111- /* First tap */
112- BOOT_DOUBLE_TAP_DATA = DOUBLE_TAP_MAGIC ;
113-
114- for (uint32_t i = 0 ; i < 125000 ; i ++ ) /* 500ms */
115- /* force compiler to not optimize this... */
116- __asm__ __volatile__("" );
117-
118- /* Timeout happened, continue boot... */
119- BOOT_DOUBLE_TAP_DATA = 0 ;
120- break ;
121- case DOUBLE_TAP_MAGIC :
109+ if (BOOT_DOUBLE_TAP_DATA == DOUBLE_TAP_MAGIC ) {
122110 /* Second tap, stay in bootloader */
123111 BOOT_DOUBLE_TAP_DATA = 0 ;
124112 return ;
125- default :
126- /* Fallback... reset counter and continue boot */
127- BOOT_DOUBLE_TAP_DATA = 0 ;
128113 }
114+
115+ /* First tap */
116+ BOOT_DOUBLE_TAP_DATA = DOUBLE_TAP_MAGIC ;
117+
118+ /* Wait 0.5sec to see if the user tap reset again */
119+ for (uint32_t i = 0 ; i < 125000 ; i ++ ) /* 500ms */
120+ /* force compiler to not optimize this... */
121+ __asm__ __volatile__("" );
122+
123+ /* Timeout happened, continue boot... */
124+ BOOT_DOUBLE_TAP_DATA = 0 ;
129125 }
130126#endif
131127
Original file line number Diff line number Diff line change 2626MEMORY
2727{
2828 FLASH (rx) : ORIGIN = 0x00000000 +0x2000 , LENGTH = 0x00040000 -0x2000 /* First 8KB used by bootloader */
29- RAM (rwx) : ORIGIN = 0x20000000 , LENGTH = 0x00008000 - 0x0004 /* Last 4B used by bootloader */
29+ RAM (rwx) : ORIGIN = 0x20000000 , LENGTH = 0x00008000
3030}
3131
3232/* Linker script to place sections and symbol values. Should be used together
You can’t perform that action at this time.
0 commit comments