Skip to content

Commit

Permalink
Skip bootloader if external reset occurred
Browse files Browse the repository at this point in the history
  • Loading branch information
László Dávid committed Sep 20, 2013
1 parent 406be0e commit af031e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 0 additions & 6 deletions firmware/bootloaderconfig.h
Expand Up @@ -329,12 +329,6 @@ static inline void bootLoaderInit(void)
{
PIN_DDR(JUMPER_PORT) = 0;
PIN_PORT(JUMPER_PORT) = (1<< PIN(JUMPER_PORT, JUMPER_BIT)); /* activate pull-up */

// deactivated by Stephan - reset after each avrdude op is annoing!
// if(!(MCUCSR & (1 << EXTRF))) /* If this was not an external reset, ignore */
// leaveBootloader();

MCUCSR = 0; /* clear all reset flags for next time */
}

static inline void bootLoaderExit(void)
Expand Down
7 changes: 7 additions & 0 deletions firmware/main.c
Expand Up @@ -502,6 +502,13 @@ int __attribute__((__noreturn__)) main(void)
{
/* initialize */
bootLoaderInit();

if(!(MCUCSR & (1 << EXTRF))){ /* If this was not an external reset, ignore */
leaveBootloader();
}

MCUCSR = 0; /* clear all reset flags for next time */

odDebugInit();
DBG1(0x00, 0, 0);
#ifndef NO_FLASH_WRITE
Expand Down

0 comments on commit af031e9

Please sign in to comment.