From 19d85491e8037244417bca241abca744578e3940 Mon Sep 17 00:00:00 2001 From: tixiv Date: Thu, 19 Feb 2009 00:46:02 +0000 Subject: [PATCH] bug fixed where persistentCounter increment would cause watchdog reset --- Makefile | 2 +- display_loop.c | 6 +----- main.c | 4 ++-- simulator/eeprom.c | 3 +++ 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 0bd7609..81b02a9 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ SRC_SIM = \ LAUNCH_BOOTLOADER = launch-bootloader #SERIAL = /dev/ttyUSB0 -SERIAL = COM5 +SERIAL = COM6 export TOPDIR ############################################################################## diff --git a/display_loop.c b/display_loop.c index cd80c3c..95ebf25 100644 --- a/display_loop.c +++ b/display_loop.c @@ -24,11 +24,7 @@ jmp_buf newmode_jmpbuf; void display_loop(){ // mcuf_serial_mode(); -#ifdef RANDOM_SUPPORT - percnt_inc(); -#endif - -// mode = setjmp(newmode_jmpbuf); + mode = setjmp(newmode_jmpbuf); oldOldmode = oldMode; mode =0; #ifdef JOYSTICK_SUPPORT diff --git a/main.c b/main.c index 5df80cc..a7c9aa8 100644 --- a/main.c +++ b/main.c @@ -18,13 +18,13 @@ int main (void){ clear_screen(0); - borg_hw_init(); - #ifdef RANDOM_SUPPORT srandom32(percnt_get()); percnt_inc(); #endif + borg_hw_init(); + #ifdef CAN_SUPPORT bcan_init(); #endif diff --git a/simulator/eeprom.c b/simulator/eeprom.c index ee1b07f..30b0650 100644 --- a/simulator/eeprom.c +++ b/simulator/eeprom.c @@ -46,6 +46,7 @@ uint16_t conv_addr(uint8_t * p){ } void eeprom_write_byte (uint8_t *p, uint8_t value){ + printf("sim eeprom write [%04X]=%02X\n", conv_addr(p), value); init(); eemem[conv_addr(p)] = value; fseek(fp, 0, SEEK_SET); @@ -53,6 +54,8 @@ void eeprom_write_byte (uint8_t *p, uint8_t value){ } void eeprom_write_word (uint16_t *p, uint16_t value){ + printf("sim eeprom write [%04X]=%04X\n", conv_addr(p), value); + init(); eemem[conv_addr((uint8_t*)p) ] = value & 0xff; eemem[conv_addr((uint8_t*)p)+1] = value >> 8;