This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
tutorials:library:arduino:bootloader.html [2011/04/14 21:16] daigo |
tutorials:library:arduino:bootloader.html [2016/01/28 18:05] (current) |
||
---|---|---|---|
Line 89: | Line 89: | ||
uint8_t ch,ch2; | uint8_t ch,ch2; | ||
uint16_t w; | uint16_t w; | ||
- | **uint8_t firstchar = 0;** | + | uint8_t firstchar = 0; |
..... | ..... | ||
Line 95: | Line 95: | ||
/* Hello is anyone home ? */ | /* Hello is anyone home ? */ | ||
if(ch=='0') { | if(ch=='0') { | ||
- | fi**rstchar = 1; // we got an appropriate bootloader instruction** | + | firstchar = 1; // we got an appropriate bootloader instruction |
nothing_response(); | nothing_response(); | ||
- | } <strong>else if (firstchar == 0) { | + | }else if (firstchar == 0) { |
// the first character we got is not '0', lets bail! | // the first character we got is not '0', lets bail! | ||
// autoreset via watchdog (sneaky!) | // autoreset via watchdog (sneaky!) | ||
WDTCSR = _BV(WDE); | WDTCSR = _BV(WDE); | ||
while (1); // 16 ms | while (1); // 16 ms | ||
- | }</strong> | + | } |
</code> | </code> | ||