mirror of
https://github.com/hathach/tinyusb.git
synced 2025-04-16 05:42:56 +00:00
rename hal_interrupt_* to hal_usb_int_*
This commit is contained in:
parent
b6e337bc12
commit
dc12e55c56
@ -71,12 +71,12 @@ static tusb_error_t hal_controller_reset(uint8_t coreid)
|
|||||||
return TUSB_ERROR_NONE;
|
return TUSB_ERROR_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void hal_interrupt_enable(uint8_t coreid)
|
void hal_usb_int_enable(uint8_t coreid)
|
||||||
{
|
{
|
||||||
NVIC_EnableIRQ(coreid ? USB1_IRQn : USB0_IRQn);
|
NVIC_EnableIRQ(coreid ? USB1_IRQn : USB0_IRQn);
|
||||||
}
|
}
|
||||||
|
|
||||||
void hal_interrupt_disable(uint8_t coreid)
|
void hal_usb_int_disable(uint8_t coreid)
|
||||||
{
|
{
|
||||||
NVIC_DisableIRQ(coreid ? USB1_IRQn : USB0_IRQn);
|
NVIC_DisableIRQ(coreid ? USB1_IRQn : USB0_IRQn);
|
||||||
}
|
}
|
||||||
|
@ -74,14 +74,14 @@ tusb_error_t hal_init(void);
|
|||||||
* \note Some MCUs such as NXP LPC43xx has multiple USB controllers. It is necessary to know which USB controller for
|
* \note Some MCUs such as NXP LPC43xx has multiple USB controllers. It is necessary to know which USB controller for
|
||||||
* those MCUs.
|
* those MCUs.
|
||||||
*/
|
*/
|
||||||
void hal_interrupt_enable(uint8_t coreid);
|
void hal_usb_int_enable(uint8_t coreid);
|
||||||
|
|
||||||
/** \brief Disable USB Interrupt on a specific USB Controller
|
/** \brief Disable USB Interrupt on a specific USB Controller
|
||||||
* \param[in] coreid is a zero-based index to identify USB controller's ID
|
* \param[in] coreid is a zero-based index to identify USB controller's ID
|
||||||
* \note Some MCUs such as NXP LPC43xx has multiple USB controllers. It is necessary to know which USB controller for
|
* \note Some MCUs such as NXP LPC43xx has multiple USB controllers. It is necessary to know which USB controller for
|
||||||
* those MCUs.
|
* those MCUs.
|
||||||
*/
|
*/
|
||||||
void hal_interrupt_disable(uint8_t coreid);
|
void hal_usb_int_disable(uint8_t coreid);
|
||||||
|
|
||||||
#include "hal_usb.h"
|
#include "hal_usb.h"
|
||||||
|
|
||||||
|
@ -41,13 +41,13 @@
|
|||||||
|
|
||||||
#if TUSB_CFG_MCU == MCU_LPC11UXX
|
#if TUSB_CFG_MCU == MCU_LPC11UXX
|
||||||
|
|
||||||
void hal_interrupt_enable(uint8_t coreid)
|
void hal_usb_int_enable(uint8_t coreid)
|
||||||
{
|
{
|
||||||
(void) coreid; // discard compiler's warning
|
(void) coreid; // discard compiler's warning
|
||||||
NVIC_EnableIRQ(USB_IRQn);
|
NVIC_EnableIRQ(USB_IRQn);
|
||||||
}
|
}
|
||||||
|
|
||||||
void hal_interrupt_disable(uint8_t coreid)
|
void hal_usb_int_disable(uint8_t coreid)
|
||||||
{
|
{
|
||||||
(void) coreid; // discard compiler's warning
|
(void) coreid; // discard compiler's warning
|
||||||
NVIC_DisableIRQ(USB_IRQn);
|
NVIC_DisableIRQ(USB_IRQn);
|
||||||
|
@ -41,13 +41,13 @@
|
|||||||
|
|
||||||
#if TUSB_CFG_MCU == MCU_LPC13UXX
|
#if TUSB_CFG_MCU == MCU_LPC13UXX
|
||||||
|
|
||||||
void hal_interrupt_enable(uint8_t coreid)
|
void hal_usb_int_enable(uint8_t coreid)
|
||||||
{
|
{
|
||||||
(void) coreid; // discard compiler's warning
|
(void) coreid; // discard compiler's warning
|
||||||
NVIC_EnableIRQ(USB_IRQ_IRQn);
|
NVIC_EnableIRQ(USB_IRQ_IRQn);
|
||||||
}
|
}
|
||||||
|
|
||||||
void hal_interrupt_disable(uint8_t coreid)
|
void hal_usb_int_disable(uint8_t coreid)
|
||||||
{
|
{
|
||||||
(void) coreid; // discard compiler's warning
|
(void) coreid; // discard compiler's warning
|
||||||
NVIC_DisableIRQ(USB_IRQ_IRQn);
|
NVIC_DisableIRQ(USB_IRQ_IRQn);
|
||||||
|
@ -41,13 +41,13 @@
|
|||||||
|
|
||||||
#if TUSB_CFG_MCU == MCU_LPC175X_6X
|
#if TUSB_CFG_MCU == MCU_LPC175X_6X
|
||||||
|
|
||||||
void hal_interrupt_enable(uint8_t coreid)
|
void hal_usb_int_enable(uint8_t coreid)
|
||||||
{
|
{
|
||||||
(void) coreid; // discard compiler's warning
|
(void) coreid; // discard compiler's warning
|
||||||
NVIC_EnableIRQ(USB_IRQn);
|
NVIC_EnableIRQ(USB_IRQn);
|
||||||
}
|
}
|
||||||
|
|
||||||
void hal_interrupt_disable(uint8_t coreid)
|
void hal_usb_int_disable(uint8_t coreid)
|
||||||
{
|
{
|
||||||
(void) coreid; // discard compiler's warning
|
(void) coreid; // discard compiler's warning
|
||||||
NVIC_DisableIRQ(USB_IRQn);
|
NVIC_DisableIRQ(USB_IRQn);
|
||||||
|
@ -191,11 +191,11 @@ static inline void osal_queue_flush(osal_queue_t const queue_hdl)
|
|||||||
else\
|
else\
|
||||||
return TUSB_ERROR_OSAL_WAITING;\
|
return TUSB_ERROR_OSAL_WAITING;\
|
||||||
} else{\
|
} else{\
|
||||||
/*TODO mutex lock hal_interrupt_disable */\
|
/*TODO mutex lock hal_usb_int_disable */\
|
||||||
memcpy(p_data, queue_hdl->buffer + (queue_hdl->rd_idx * queue_hdl->item_size), queue_hdl->item_size);\
|
memcpy(p_data, queue_hdl->buffer + (queue_hdl->rd_idx * queue_hdl->item_size), queue_hdl->item_size);\
|
||||||
queue_hdl->rd_idx = (queue_hdl->rd_idx + 1) % queue_hdl->depth;\
|
queue_hdl->rd_idx = (queue_hdl->rd_idx + 1) % queue_hdl->depth;\
|
||||||
queue_hdl->count--;\
|
queue_hdl->count--;\
|
||||||
/*TODO mutex unlock hal_interrupt_enable */\
|
/*TODO mutex unlock hal_usb_int_enable */\
|
||||||
*(p_error) = TUSB_ERROR_NONE;\
|
*(p_error) = TUSB_ERROR_NONE;\
|
||||||
}\
|
}\
|
||||||
}while(0)
|
}while(0)
|
||||||
@ -245,7 +245,7 @@ static inline void osal_semaphore_reset(osal_semaphore_t sem_hdl)
|
|||||||
else\
|
else\
|
||||||
return TUSB_ERROR_OSAL_WAITING;\
|
return TUSB_ERROR_OSAL_WAITING;\
|
||||||
} else{\
|
} else{\
|
||||||
if (sem_hdl->count) sem_hdl->count--; /*TODO mutex hal_interrupt_disable consideration*/\
|
if (sem_hdl->count) sem_hdl->count--; /*TODO mutex hal_usb_int_disable consideration*/\
|
||||||
*(p_error) = TUSB_ERROR_NONE;\
|
*(p_error) = TUSB_ERROR_NONE;\
|
||||||
}\
|
}\
|
||||||
}while(0)
|
}while(0)
|
||||||
|
@ -53,11 +53,11 @@ tusb_error_t tusb_init(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (TUSB_CFG_CONTROLLER_0_MODE)
|
#if (TUSB_CFG_CONTROLLER_0_MODE)
|
||||||
hal_interrupt_enable(0);
|
hal_usb_int_enable(0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (TUSB_CFG_CONTROLLER_1_MODE)
|
#if (TUSB_CFG_CONTROLLER_1_MODE)
|
||||||
hal_interrupt_enable(1);
|
hal_usb_int_enable(1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return TUSB_ERROR_NONE;
|
return TUSB_ERROR_NONE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user