Signed-off-by: Stephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
static inline void bootLoaderInit(void)
{
static inline void bootLoaderInit(void)
{
- PORTD |= (1 << JUMPER_BIT); /* activate pull-up */
+ DDRD = 0;
+ PORTD = (1 << 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();
// deactivated by Stephan - reset after each avrdude op is annoing!
// if(!(MCUCSR & (1 << EXTRF))) /* If this was not an external reset, ignore */
// leaveBootloader();
static const uchar currentRequest = 0;
#endif
static const uchar currentRequest = 0;
#endif
+static unsigned char wdtstatus;
+
static const uchar signatureBytes[4] = {
#ifdef SIGNATURE_BYTES
SIGNATURE_BYTES
static const uchar signatureBytes[4] = {
#ifdef SIGNATURE_BYTES
SIGNATURE_BYTES
USB_INTR_CFG = 0; /* also reset config bits */
GICR = (1 << IVCE); /* enable change of interrupt vectors */
GICR = (0 << IVSEL); /* move interrupts to application flash section */
USB_INTR_CFG = 0; /* also reset config bits */
GICR = (1 << IVCE); /* enable change of interrupt vectors */
GICR = (0 << IVSEL); /* move interrupts to application flash section */
/* We must go through a global function pointer variable instead of writing
* ((void (*)(void))0)();
* because the compiler optimizes a constant 0 to "rcall 0" which is not
/* We must go through a global function pointer variable instead of writing
* ((void (*)(void))0)();
* because the compiler optimizes a constant 0 to "rcall 0" which is not
int __attribute__((noreturn)) main(void)
{
/* initialize */
int __attribute__((noreturn)) main(void)
{
/* initialize */
wdt_disable(); /* main app may have enabled watchdog */
bootLoaderInit();
odDebugInit();
wdt_disable(); /* main app may have enabled watchdog */
bootLoaderInit();
odDebugInit();
*/
#if defined (__AVR_ATmega8__) || defined (__AVR_ATmega8HVA__)
//assume SPMCR==0x37, SPMEN==0x00
*/
#if defined (__AVR_ATmega8__) || defined (__AVR_ATmega8HVA__)
//assume SPMCR==0x37, SPMEN==0x00
-const uint16_t bootloader__do_spm[30] PROGMEM = {0x0000, 0x2dec, 0x2dfd, 0xb6c7, 0xfcc0, 0xcffd, 0xbea7, 0x95e8, 0x9508,
+const uint16_t bootloader__do_spm[22] PROGMEM = {0x0000, 0x2dec, 0x2dfd, 0xb6c7, 0xfcc0, 0xcffd, 0xbea7, 0x95e8, 0x9508,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
- 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
- 0xFFFF, 0xFFFF, 0xFFFF};
+ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF};
#else
#error "bootloader__do_spm has to be adapted, since there is no architecture code, yet"
#endif
#else
#error "bootloader__do_spm has to be adapted, since there is no architecture code, yet"
#endif