diff --git a/main.c b/main.c index 4a2669f..2567337 100644 --- a/main.c +++ b/main.c @@ -84,11 +84,14 @@ * WAIT-mode waits 1 sec for the S command if nothing is recived * then the user prog is started .. */ -#define START_SIMPLE -//#define START_WAIT +//#define START_SIMPLE +#define START_WAIT //#define START_POWERSAVE //#define START_BOOTICE +/* wait 1s in START_WAIT mode (10ms steps) */ +#define WAIT_VALUE 100 + /* * enable/disable readout of fuse and lock-bits * (will not work for Mega169 since not supported by AVRPROG 1.37 @@ -109,6 +112,7 @@ #include #include #include +#include #include "chipdef.h" @@ -324,43 +328,20 @@ int main(void) #elif defined(START_WAIT) - // Timer-Setup for ATmega8 - // - verify that the configuration is valid for the target AVR - - #define MY_WAIT 900 - // wait ca 1 sec (900ms) - TCCR1A = 0; // timer setup - // F_OSC / 8 / 1000 -> 1ms - #if (((F_CPU / 8 / 1000)*MY_WAIT) < 65535) - #warning Information: setting prescaler to 8 - #define WAIT_VALUE ((F_CPU / 8 / 1000)*MY_WAIT) - TCCR1B |= (1<= WAIT_VALUE){ + + if (cnt++ >= WAIT_VALUE) { BLPORT &= ~(1<