summaryrefslogtreecommitdiff
path: root/demos/host
diff options
context:
space:
mode:
authorhathach <[email protected]>2013-04-08 02:36:43 +0700
committerhathach <[email protected]>2013-04-08 02:36:43 +0700
commit95df92055c355b8184675663a2d4c66ad6c21d51 (patch)
tree6a96b374c8165047ecf297e65a82ee161020440c /demos/host
parent4b63a2bc5ccb1dd8c207f68b01be5ff6014a03da (diff)
fix board uart init with NGX4330 (use UART0)
add USB1_PWR_EN (GPIO5[6])
Diffstat (limited to 'demos/host')
-rw-r--r--demos/host/main.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/demos/host/main.c b/demos/host/main.c
index 247b91cdd..bb2084a59 100644
--- a/demos/host/main.c
+++ b/demos/host/main.c
@@ -28,11 +28,17 @@ int main(void)
keyboard_app_task();
mouse_app_task();
- if (current_tick + 10*CFG_TICKS_PER_SECOND < system_ticks)
+ if (current_tick + CFG_TICKS_PER_SECOND < system_ticks)
{
- 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"); // toggle leds on EA4357 is quite troublesome
+ static uint8_t timeout_10_ms = 0;
+ timeout_10_ms = (timeout_10_ms+1) % 10;
+ if (timeout_10_ms % 10 == 0)
+ {
+ printf("tinyusb: " __DATE__ "\t" __TIME__ "\n"); // toggle leds on EA4357 is quite troublesome
+ }
+
+ current_tick += CFG_TICKS_PER_SECOND;
+ board_leds(0x01, (current_tick/CFG_TICKS_PER_SECOND)%2); /* Toggle LED once per second */
}
}