4343//--------------------------------------------------------------------+
4444// USB Interrupt Handler
4545//--------------------------------------------------------------------+
46- void USB0_IRQHandler (void )
47- {
46+ void USB0_IRQHandler (void ) {
4847 #if PORT_SUPPORT_DEVICE (0 )
49- tud_int_handler (0 );
48+ tud_int_handler (0 );
5049 #endif
5150
5251 #if PORT_SUPPORT_HOST (0 )
53- tuh_int_handler (0 );
52+ tuh_int_handler (0 , true );
5453 #endif
5554}
5655
57- void USB1_IRQHandler (void )
58- {
56+ void USB1_IRQHandler (void ) {
5957 #if PORT_SUPPORT_DEVICE (1 )
60- tud_int_handler (1 );
58+ tud_int_handler (1 );
6159 #endif
6260
6361 #if PORT_SUPPORT_HOST (1 )
64- tuh_int_handler (1 );
62+ tuh_int_handler (1 , true );
6563 #endif
6664}
6765
@@ -74,28 +72,26 @@ const uint32_t OscRateIn = 12000000;
7472const uint32_t ExtRateIn = 0 ;
7573
7674// Invoked by startup code
77- void SystemInit (void )
78- {
75+ void SystemInit (void ) {
7976#ifdef __USE_LPCOPEN
80- extern void (* const g_pfnVectors [])(void );
77+ extern void (* const g_pfnVectors [])(void );
8178 unsigned int * pSCB_VTOR = (unsigned int * ) 0xE000ED08 ;
82- * pSCB_VTOR = (unsigned int ) g_pfnVectors ;
79+ * pSCB_VTOR = (unsigned int ) g_pfnVectors ;
8380#endif
8481
8582 board_lpc18_pinmux ();
8683
87- #ifdef TRACE_ETM
84+ #ifdef TRACE_ETM
8885 // Trace clock is limited to 60MHz, limit CPU clock to 120MHz
8986 Chip_SetupCoreClock (CLKIN_CRYSTAL , 120000000UL , true);
90- #else
87+ #else
9188 // CPU clock max to 180 Mhz
9289 Chip_SetupCoreClock (CLKIN_CRYSTAL , MAX_CLOCK_FREQ , true);
93- #endif
90+ #endif
9491
9592}
9693
97- void board_init (void )
98- {
94+ void board_init (void ) {
9995 SystemCoreClockUpdate ();
10096
10197#if CFG_TUSB_OS == OPT_OS_NONE
@@ -135,27 +131,22 @@ void board_init(void)
135131// Board porting API
136132//--------------------------------------------------------------------+
137133
138- void board_led_write (bool state )
139- {
134+ void board_led_write (bool state ) {
140135 Chip_GPIO_SetPinState (LPC_GPIO_PORT , LED_PORT , LED_PIN , state );
141136}
142137
143- uint32_t board_button_read (void )
144- {
138+ uint32_t board_button_read (void ) {
145139 // active low
146140 return Chip_GPIO_GetPinState (LPC_GPIO_PORT , BUTTON_PORT , BUTTON_PIN ) ? 0 : 1 ;
147141}
148142
149- int board_uart_read (uint8_t * buf , int len )
150- {
143+ int board_uart_read (uint8_t * buf , int len ) {
151144 return Chip_UART_Read (UART_DEV , buf , len );
152145}
153146
154- int board_uart_write (void const * buf , int len )
155- {
156- uint8_t const * buf8 = (uint8_t const * ) buf ;
157- for (int i = 0 ; i < len ; i ++ )
158- {
147+ int board_uart_write (void const * buf , int len ) {
148+ uint8_t const * buf8 = (uint8_t const * ) buf ;
149+ for (int i = 0 ; i < len ; i ++ ) {
159150 while ((Chip_UART_ReadLineStatus (UART_DEV ) & UART_LSR_THRE ) == 0 ) {}
160151 Chip_UART_SendByte (UART_DEV , buf8 [i ]);
161152 }
@@ -165,13 +156,13 @@ int board_uart_write(void const * buf, int len)
165156
166157#if CFG_TUSB_OS == OPT_OS_NONE
167158volatile uint32_t system_ticks = 0 ;
168- void SysTick_Handler ( void )
169- {
159+
160+ void SysTick_Handler ( void ) {
170161 system_ticks ++ ;
171162}
172163
173- uint32_t board_millis (void )
174- {
164+ uint32_t board_millis (void ) {
175165 return system_ticks ;
176166}
167+
177168#endif
0 commit comments