ispprog2: change baudrate, no boot timeout and add button delay

This commit is contained in:
Olaf Rempel 2014-10-12 11:02:19 +02:00
parent e7b67a0aa7
commit 92d3f545a3

14
main.c
View File

@ -117,11 +117,11 @@
* Fuse L: 0xE2 (internal osc) * Fuse L: 0xE2 (internal osc)
*/ */
#define F_CPU 8000000 #define F_CPU 8000000
#define BAUDRATE 115200 #define BAUDRATE 19200
#define DEVCODE 0x72 /* mega32 devcode */ #define DEVCODE 0x72 /* mega32 devcode */
/* 100 * 10ms => 1000ms */ /* 100 * 10ms => 1000ms */
#define TIMEOUT 100 //#define TIMEOUT 100
/* enter bootloader if PINB1 is low */ /* enter bootloader if PINB1 is low */
#define ISP_DDR DDRB #define ISP_DDR DDRB
@ -136,9 +136,6 @@
#define LED_NUM PORTB0 #define LED_NUM PORTB0
#define LED_POL 1 #define LED_POL 1
/* trim internal oscillator to get "good" baudrate */
#define OSCCAL_VALUE 0x80
/* *********************************************************************** */ /* *********************************************************************** */
#else #else
#error "unknown CONFIG" #error "unknown CONFIG"
@ -351,6 +348,11 @@ int main(void)
/* set as input, enable pullup/pulldown */ /* set as input, enable pullup/pulldown */
ISP_INIT(); ISP_INIT();
{
volatile uint8_t wait = 0;
while (--wait);
}
/* check if bootloader is not selected */ /* check if bootloader is not selected */
if (ISP_CHECK()) { if (ISP_CHECK()) {
jump_to_app(); jump_to_app();
@ -368,7 +370,7 @@ int main(void)
/* initalize UART */ /* initalize UART */
uartinit(); uartinit();
uint8_t val = 'S'; uint8_t val = 0x1B;
#if defined(TIMEOUT) #if defined(TIMEOUT)
uint8_t prev = 0x00; uint8_t prev = 0x00;