X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=app%2Ftriface%2Fboot%2Fmain.c;h=97b1cefc4b6621d55090ddf9cd7ce6a9655fb66a;hb=4cc44c9888a0336b9d01121ec0b7ad95f4a76195;hp=093a7f91d20955d749b7eb4a64176756076b7c11;hpb=cbab5cfe6696b8c288835b62b8c51ceb53cb7262;p=bertos.git diff --git a/app/triface/boot/main.c b/app/triface/boot/main.c index 093a7f91..97b1cefc 100644 --- a/app/triface/boot/main.c +++ b/app/triface/boot/main.c @@ -27,7 +27,7 @@ * the GNU General Public License. * * Copyright 2003, 2004, 2006 Develer S.r.l. (http://www.develer.com/) - * Copyright 2000 Bernardo Innocenti + * Copyright 2000 Bernie Innocenti * * --> * @@ -46,7 +46,7 @@ * \author Daniele Basile */ -#include +#include #include #include #include /* BV() */ @@ -57,16 +57,18 @@ #include #include "hw/hw_boot.h" +#include "cfg/cfg_boot.h" #include int main(void) { - KFile fd; + KFileFlashAvr flash; + KFileSerial ser; // Set up flash programming functions. - flash_avr_init(&fd); + flash_avr_init(&flash); IRQ_ENABLE; @@ -74,17 +76,22 @@ int main(void) kdbg_init(); timer_init(); - kprintf("Bertuccia"); + + /* Open the main communication port */ - Serial *host_port = ser_open(CONFIG_SER_HOSTPORT); - ser_setbaudrate(host_port, CONFIG_SER_HOSTPORTBAUDRATE); - xmodem_recv(host_port, &fd); - fd.close(&fd); + ser_init(&ser, CONFIG_SER_HOSTPORT); + ser_setbaudrate(&ser, CONFIG_SER_HOSTPORTBAUDRATE); + + xmodem_recv(&ser, &flash.fd); + kfile_close(&flash.fd); + kfile_close(&ser.fd); IRQ_DISABLE; BOOT_END; START_APP(); + } +