mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-17 05:32:55 +08:00
d2bd80109e
add osal_queue_send in usbh_device_plugged add macro for placing breakpoint macros fix ehci init: - regs->cmd or (add run_stop) - enable port power in portsc add tusb_task_runner in main loop
40 lines
811 B
C
40 lines
811 B
C
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
#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)
|
|
{
|
|
uint32_t current_tick = system_ticks;
|
|
|
|
board_init();
|
|
tusb_init();
|
|
|
|
printf("reset\n");
|
|
while (1)
|
|
{
|
|
tusb_task_runner();
|
|
|
|
if (current_tick + 30*1000 < system_ticks)
|
|
{
|
|
current_tick += 30*1000;
|
|
board_leds(0x01, (current_tick/1000)%2); /* Toggle LED once per second */
|
|
|
|
printf("tinyusb: " __DATE__ "\t" __TIME__ "\n");
|
|
}
|
|
}
|
|
|
|
return 0;
|
|
}
|