Skip to content

Commit 3b0ffd0

Browse files
committed
change hcd_int_handler(rhport, in_isr) signature: add in_isr
change tuh_int_handler() to take in_isr as optional parameter (default = true)
1 parent 46f7cf4 commit 3b0ffd0

File tree

35 files changed

+172
-267
lines changed

35 files changed

+172
-267
lines changed

examples/host/bare_api/only.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
mcu:KINETIS_KL
12
mcu:LPC175X_6X
23
mcu:LPC177X_8X
34
mcu:LPC18XX

examples/host/cdc_msc_hid/only.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
mcu:KINETIS_KL
12
mcu:LPC175X_6X
23
mcu:LPC177X_8X
34
mcu:LPC18XX

examples/host/hid_controller/only.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
mcu:KINETIS_KL
12
mcu:LPC175X_6X
23
mcu:LPC177X_8X
34
mcu:LPC18XX

examples/host/msc_file_explorer/only.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
mcu:KINETIS_KL
12
mcu:LPC175X_6X
23
mcu:LPC177X_8X
34
mcu:LPC18XX

hw/bsp/imxrt/family.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ void USB_OTG1_IRQHandler(void)
188188
#endif
189189

190190
#if PORT_SUPPORT_HOST(0)
191-
tuh_int_handler(0);
191+
tuh_int_handler(0, true);
192192
#endif
193193
}
194194

@@ -199,7 +199,7 @@ void USB_OTG2_IRQHandler(void)
199199
#endif
200200

201201
#if PORT_SUPPORT_HOST(1)
202-
tuh_int_handler(1);
202+
tuh_int_handler(1, true);
203203
#endif
204204
}
205205

hw/bsp/kinetis_kl/family.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
void USB0_IRQHandler(void)
4040
{
4141
#if CFG_TUH_ENABLED
42-
tuh_int_handler(0);
42+
tuh_int_handler(0, true);
4343
#endif
4444
#if CFG_TUD_ENABLED
4545
tud_int_handler(0);

hw/bsp/kinetis_kl/family.cmake

Lines changed: 37 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -22,48 +22,47 @@ set(FAMILY_MCUS KINETIS_KL CACHE INTERNAL "")
2222
#------------------------------------
2323
# only need to be built ONCE for all examples
2424
function(add_board_target BOARD_TARGET)
25-
if (NOT TARGET ${BOARD_TARGET})
26-
add_library(${BOARD_TARGET} STATIC
27-
${SDK_DIR}/drivers/gpio/fsl_gpio.c
28-
${SDK_DIR}/drivers/lpsci/fsl_lpsci.c
29-
${SDK_DIR}/drivers/uart/fsl_uart.c
30-
${SDK_DIR}/devices/${MCU_VARIANT}/drivers/fsl_clock.c
31-
${SDK_DIR}/devices/${MCU_VARIANT}/system_${MCU_VARIANT}.c
32-
)
33-
target_compile_definitions(${BOARD_TARGET} PUBLIC
34-
)
35-
target_include_directories(${BOARD_TARGET} PUBLIC
36-
${CMSIS_DIR}/CMSIS/Core/Include
37-
${SDK_DIR}/devices/${MCU_VARIANT}
38-
${SDK_DIR}/devices/${MCU_VARIANT}/drivers
39-
${SDK_DIR}/drivers/common
40-
${SDK_DIR}/drivers/gpio
41-
${SDK_DIR}/drivers/lpsci
42-
${SDK_DIR}/drivers/port
43-
${SDK_DIR}/drivers/smc
44-
${SDK_DIR}/drivers/uart
45-
)
25+
if (TARGET ${BOARD_TARGET})
26+
return()
27+
endif ()
4628

47-
update_board(${BOARD_TARGET})
29+
add_library(${BOARD_TARGET} STATIC
30+
${SDK_DIR}/drivers/gpio/fsl_gpio.c
31+
${SDK_DIR}/drivers/lpsci/fsl_lpsci.c
32+
${SDK_DIR}/drivers/uart/fsl_uart.c
33+
${SDK_DIR}/devices/${MCU_VARIANT}/drivers/fsl_clock.c
34+
${SDK_DIR}/devices/${MCU_VARIANT}/system_${MCU_VARIANT}.c
35+
)
36+
target_compile_definitions(${BOARD_TARGET} PUBLIC
37+
)
38+
target_include_directories(${BOARD_TARGET} PUBLIC
39+
${CMSIS_DIR}/CMSIS/Core/Include
40+
${SDK_DIR}/devices/${MCU_VARIANT}
41+
${SDK_DIR}/devices/${MCU_VARIANT}/drivers
42+
${SDK_DIR}/drivers/common
43+
${SDK_DIR}/drivers/gpio
44+
${SDK_DIR}/drivers/lpsci
45+
${SDK_DIR}/drivers/port
46+
${SDK_DIR}/drivers/smc
47+
${SDK_DIR}/drivers/uart
48+
)
49+
update_board(${BOARD_TARGET})
4850

49-
# LD_FILE and STARTUP_FILE can be defined in board.cmake
51+
# LD_FILE and STARTUP_FILE can be defined in board.cmake
52+
target_sources(${BOARD_TARGET} PUBLIC
53+
${STARTUP_FILE_${CMAKE_C_COMPILER_ID}}
54+
)
5055

51-
target_sources(${BOARD_TARGET} PUBLIC
52-
${STARTUP_FILE_${CMAKE_C_COMPILER_ID}}
56+
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
57+
target_link_options(${BOARD_TARGET} PUBLIC
58+
"LINKER:--script=${LD_FILE_GNU}"
59+
# nanolib
60+
--specs=nosys.specs --specs=nano.specs
61+
)
62+
elseif (CMAKE_C_COMPILER_ID STREQUAL "IAR")
63+
target_link_options(${BOARD_TARGET} PUBLIC
64+
"LINKER:--config=${LD_FILE_IAR}"
5365
)
54-
55-
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
56-
target_link_options(${BOARD_TARGET} PUBLIC
57-
"LINKER:--script=${LD_FILE_GNU}"
58-
# nanolib
59-
--specs=nosys.specs
60-
--specs=nano.specs
61-
)
62-
elseif (CMAKE_C_COMPILER_ID STREQUAL "IAR")
63-
target_link_options(${BOARD_TARGET} PUBLIC
64-
"LINKER:--config=${LD_FILE_IAR}"
65-
)
66-
endif ()
6766
endif ()
6867
endfunction()
6968

hw/bsp/lpc17/boards/lpcxpresso1769/lpcxpresso1769.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void USB_IRQHandler(void)
3737
#endif
3838

3939
#if CFG_TUH_ENABLED
40-
tuh_int_handler(0);
40+
tuh_int_handler(0, true);
4141
#endif
4242
}
4343

hw/bsp/lpc17/boards/mbed1768/mbed1768.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ void USB_IRQHandler(void)
151151
#endif
152152

153153
#if CFG_TUH_ENABLED
154-
tuh_int_handler(0);
154+
tuh_int_handler(0, true);
155155
#endif
156156
}
157157

hw/bsp/lpc18/family.c

Lines changed: 23 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -43,25 +43,23 @@
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;
7472
const 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
167158
volatile 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

Comments
 (0)