tinyusb/demos/host/main.c

40 lines
873 B
C
Raw Normal View History

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
2012-12-10 16:10:24 +07:00
#include "boards/board.h"
#include "tusb.h"
#if defined(__CODE_RED)
#include <cr_section_macros.h>
#include <NXP/crp.h>
// Variable to store CRP value in. Will be placed automatically
// by the linker when "Enable Code Read Protect" selected.
// See crp.h header for more information
__CRP const unsigned int CRP_WORD = CRP_NO_CRP ;
#endif
int main(void)
{
2012-12-18 15:08:30 +07:00
uint32_t current_tick = system_ticks;
2012-12-10 16:10:24 +07:00
board_init();
tusb_init();
2012-12-10 16:10:24 +07:00
printf("reset\n");
2012-12-10 16:10:24 +07:00
while (1)
{
tusb_task_runner();
keyboard_app_task();
2013-03-24 14:32:54 +07:00
if (current_tick + 10*CFG_TICKS_PER_SECOND < system_ticks)
2012-12-10 16:10:24 +07:00
{
2013-03-24 14:32:54 +07:00
current_tick = system_ticks;
// board_leds(0x01, (current_tick/CFG_TICKS_PER_SECOND)%2); /* Toggle LED once per second */
printf("tinyusb: " __DATE__ "\t" __TIME__ "\n");
2012-12-10 16:10:24 +07:00
}
}
return 0;
2012-12-10 16:10:24 +07:00
}