#include "board.h"
#include "hif.h"
#include "xmpl.h"
int main(void)
{
int inchar;
uint32_t br = HIF_DEFAULT_BAUDRATE;
uint32_t txcnt, rxcnt;
uint8_t state;
const char volatile INFO[] = "info";
txcnt = 0;
rxcnt = 0;
state = 0;
#if HIF_TYPE == HIF_AT90USB
do
{
}
while (EOF == inchar);
#endif
hif_printf(FLASH_STRING(
"\n\rHIF Echo : %s : %ld bit/s\n\r"),BOARD_NAME,br);
hif_echo(FLASH_STRING(
"$Revision$\n\r"));
while(1)
{
rxcnt ++;
if (EOF != inchar)
{
txcnt ++;
if (inchar == INFO[state])
{
state += 1;
}
else
{
state = 0;
}
if (state == 4)
{
PRINTF(
"\n\rECHO rx=%ld tx=%ld\n\r", rxcnt, txcnt);
state = 0;
txcnt = 0;
rxcnt = 0;
}
}
}
}