more clean up use inline bit funciton instead of macros

This commit is contained in:
hathach
2019-05-14 12:54:29 +07:00
parent 81fc7b7e2b
commit 3e6d911ce9
15 changed files with 41 additions and 49 deletions

View File

@@ -279,7 +279,7 @@ static void process_xfer_isr(uint32_t int_status)
{
for(uint8_t ep_id = 0; ep_id < EP_COUNT; ep_id++ )
{
if ( TU_BIT_TEST(int_status, ep_id) )
if ( tu_bit_test(int_status, ep_id) )
{
ep_cmd_sts_t * ep_cs = &_dcd.ep[ep_id][0];
xfer_dma_t* xfer_dma = &_dcd.dma[ep_id];
@@ -354,7 +354,7 @@ void USB_IRQHandler(void)
}
// Setup Receive
if ( TU_BIT_TEST(int_status, 0) && (dev_cmd_stat & CMDSTAT_SETUP_RECEIVED_MASK) )
if ( tu_bit_test(int_status, 0) && (dev_cmd_stat & CMDSTAT_SETUP_RECEIVED_MASK) )
{
// Follow UM flowchart to clear Active & Stall on both Control IN/OUT endpoints
_dcd.ep[0][0].active = _dcd.ep[1][0].active = 0;
@@ -368,7 +368,7 @@ void USB_IRQHandler(void)
_dcd.ep[0][1].buffer_offset = get_buf_offset(_dcd.setup_packet);
// clear bit0
int_status = TU_BIT_CLEAR(int_status, 0);
int_status = tu_bit_clear(int_status, 0);
}
// Endpoint transfer complete interrupt

View File

@@ -530,7 +530,7 @@ void hal_dcd_isr(uint8_t rhport)
{
for ( uint8_t ep_id = 3; ep_id < DCD_ENDPOINT_MAX; ep_id += 2 )
{
if ( TU_BIT_TEST(ep_int_status, ep_id) )
if ( tu_bit_test(ep_int_status, ep_id) )
{
LPC_USB->EpIntClr = TU_BIT(ep_id);
@@ -553,7 +553,7 @@ void hal_dcd_isr(uint8_t rhport)
for ( uint8_t ep_id = 2; ep_id < DCD_ENDPOINT_MAX; ep_id++ )
{
if ( TU_BIT_TEST(eot, ep_id) )
if ( tu_bit_test(eot, ep_id) )
{
if ( ep_id & 0x01 )
{

View File

@@ -341,7 +341,7 @@ void hal_dcd_isr(uint8_t rhport)
{
for(uint8_t ep_idx = 0; ep_idx < QHD_MAX; ep_idx++)
{
if ( TU_BIT_TEST(edpt_complete, ep_idx2bit(ep_idx)) )
if ( tu_bit_test(edpt_complete, ep_idx2bit(ep_idx)) )
{
// 23.10.12.3 Failed QTD also get ENDPTCOMPLETE set
dcd_qtd_t * p_qtd = &dcd_data_ptr[rhport]->qtd[ep_idx];