bug fixed where persistentCounter increment would cause watchdog reset
This commit is contained in:
parent
86d4afe23e
commit
19d85491e8
2
Makefile
2
Makefile
|
@ -16,7 +16,7 @@ SRC_SIM = \
|
||||||
|
|
||||||
LAUNCH_BOOTLOADER = launch-bootloader
|
LAUNCH_BOOTLOADER = launch-bootloader
|
||||||
#SERIAL = /dev/ttyUSB0
|
#SERIAL = /dev/ttyUSB0
|
||||||
SERIAL = COM5
|
SERIAL = COM6
|
||||||
export TOPDIR
|
export TOPDIR
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
|
|
|
@ -24,11 +24,7 @@ jmp_buf newmode_jmpbuf;
|
||||||
void display_loop(){
|
void display_loop(){
|
||||||
// mcuf_serial_mode();
|
// mcuf_serial_mode();
|
||||||
|
|
||||||
#ifdef RANDOM_SUPPORT
|
mode = setjmp(newmode_jmpbuf);
|
||||||
percnt_inc();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// mode = setjmp(newmode_jmpbuf);
|
|
||||||
oldOldmode = oldMode;
|
oldOldmode = oldMode;
|
||||||
mode =0;
|
mode =0;
|
||||||
#ifdef JOYSTICK_SUPPORT
|
#ifdef JOYSTICK_SUPPORT
|
||||||
|
|
4
main.c
4
main.c
|
@ -18,13 +18,13 @@
|
||||||
int main (void){
|
int main (void){
|
||||||
clear_screen(0);
|
clear_screen(0);
|
||||||
|
|
||||||
borg_hw_init();
|
|
||||||
|
|
||||||
#ifdef RANDOM_SUPPORT
|
#ifdef RANDOM_SUPPORT
|
||||||
srandom32(percnt_get());
|
srandom32(percnt_get());
|
||||||
percnt_inc();
|
percnt_inc();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
borg_hw_init();
|
||||||
|
|
||||||
#ifdef CAN_SUPPORT
|
#ifdef CAN_SUPPORT
|
||||||
bcan_init();
|
bcan_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -46,6 +46,7 @@ uint16_t conv_addr(uint8_t * p){
|
||||||
}
|
}
|
||||||
|
|
||||||
void eeprom_write_byte (uint8_t *p, uint8_t value){
|
void eeprom_write_byte (uint8_t *p, uint8_t value){
|
||||||
|
printf("sim eeprom write [%04X]=%02X\n", conv_addr(p), value);
|
||||||
init();
|
init();
|
||||||
eemem[conv_addr(p)] = value;
|
eemem[conv_addr(p)] = value;
|
||||||
fseek(fp, 0, SEEK_SET);
|
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){
|
void eeprom_write_word (uint16_t *p, uint16_t value){
|
||||||
|
printf("sim eeprom write [%04X]=%04X\n", conv_addr(p), value);
|
||||||
|
|
||||||
init();
|
init();
|
||||||
eemem[conv_addr((uint8_t*)p) ] = value & 0xff;
|
eemem[conv_addr((uint8_t*)p) ] = value & 0xff;
|
||||||
eemem[conv_addr((uint8_t*)p)+1] = value >> 8;
|
eemem[conv_addr((uint8_t*)p)+1] = value >> 8;
|
||||||
|
|
Loading…
Reference in New Issue