X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=examples%2Ftriface%2Fboot%2Fmain.c;h=d84dc2552873aa478e89ea5dd857c18b7626a4de;hb=51157819d281eeca3d8afa8c27e22353c301e2ca;hp=1382ab9e55ca2867d4c17c9508c01925d9ab0b34;hpb=5f884bba3f826f323189c1109aa3eae33d4c5a1d;p=bertos.git diff --git a/examples/triface/boot/main.c b/examples/triface/boot/main.c index 1382ab9e..d84dc255 100644 --- a/examples/triface/boot/main.c +++ b/examples/triface/boot/main.c @@ -57,7 +57,7 @@ #include #include -#include +#include #include @@ -66,12 +66,12 @@ /* * Watchdog disable. * - * This function disable the watchdog timer, after a reset. - * We should do it after the software reset (do with watchdog), - * because in new AVR core do not reset the watchdog after - * a cpu reset, so the watchdog timer remain enable resetting - * every timeout time the cpu. This is necessary only with new - * AVR core, for the other core this no have effect. + * This function disable the watchdog timer early after a reset. + * We must do it very soon because new AVR cores do not disable + * the watchdog timer after a cpu reset. In this way the watchdog + * timer is still enabled, continuously resetting the cpu. This is + * necessary only with new AVR cores, for other cores this code has + * no effect. * * \{ */ @@ -89,12 +89,12 @@ void wdt_init(void) int main(void) { - FlashAvr flash; + Flash flash; Serial ser; // Set up flash programming functions. - flash_avr_init(&flash); + flash_init(&flash); IRQ_ENABLE; @@ -108,9 +108,10 @@ int main(void) ser_init(&ser, CONFIG_BOOT_PORT); ser_setbaudrate(&ser, CONFIG_BOOT_BAUDRATE); - xmodem_recv(&ser, &flash.fd); + xmodem_recv(&ser.fd, &flash.fd); + kfile_close(&flash.fd); - kfile_close(&ser.fd); + kfile_close(&ser.fd); IRQ_DISABLE;