X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=app%2Ftriface%2Ftriface.c;h=eb47d8fad0f5c67f77c31de895c0d67ff506b62b;hb=f66431cfee885cc3a2d87a4286e50850f46beac8;hp=c34b50036cfa311dee6b1057c5df5c76e7ac9b5a;hpb=70994853a1addb091d532327e2c4aca8a58c7932;p=bertos.git diff --git a/app/triface/triface.c b/app/triface/triface.c index c34b5003..eb47d8fa 100644 --- a/app/triface/triface.c +++ b/app/triface/triface.c @@ -26,7 +26,8 @@ * invalidate any other reasons why the executable file might be covered by * the GNU General Public License. * - * Copyright 2006 Develer S.r.l. (http://www.develer.com/) + * Copyright 2003, 2004, 2006, 2008 Develer S.r.l. (http://www.develer.com/) + * Copyright 2000 Bernardo Innocenti * * --> * @@ -34,36 +35,64 @@ * * \author Marco Benelli * \author Bernardo Innocenti + * \author Daniele Basile * * \brief Windowing system test. */ + #include #include #include +#include + #include #include +#include #include "protocol.h" +#include "hw_input.h" +#include "hw_adc.h" + + +static KFileSerial fd_ser; int main(void) { + /* SPI Port Initialization */ + sipo_init(); + kdbg_init(); timer_init(); -// buz_init(); + adc_init(); + buz_init(); IRQ_ENABLE; + INPUT_INIT; - Serial *host_port = ser_open(0); - ser_setbaudrate(host_port, 38400); + /* Initialize Tag serial port and data structure */ + TagPacket pkt; - protocol_init(host_port); + /* Open the main communication port */ + ser_init(&fd_ser, CONFIG_SER_HOSTPORT); + ser_setbaudrate(&fd_ser, CONFIG_SER_HOSTPORTBAUDRATE); + + ser_init(pkt.tag_ser, TAG_SER_PORT); + ser_setbaudrate(pkt.tag_ser, TAG_SER_BAUDRATE); + + pkt.comm_ser = &fd_ser; + keytag_init(&pkt); + + protocol_init(&fd_ser.fd); // Main loop for(;;) { - protocol_run(host_port); + protocol_run(&fd_ser.fd); + keytag_poll(&pkt); } return 0; } + +