diff options
| author | hathach <[email protected]> | 2019-05-14 12:54:29 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2019-05-14 12:54:29 +0700 |
| commit | 3e6d911ce9c01729af3b5d3093ccba250dfdfe2e (patch) | |
| tree | 6693d4080df0cf8b0027e95c42af829d2a942979 /src/portable | |
| parent | 81fc7b7e2b035ae1dd72c2e6167ac6d56393de22 (diff) | |
more clean up use inline bit funciton instead of macros
Diffstat (limited to 'src/portable')
| -rw-r--r-- | src/portable/nordic/nrf5x/dcd_nrf5x.c | 8 | ||||
| -rw-r--r-- | src/portable/nxp/lpc11_13_15/dcd_lpc11_13_15.c | 6 | ||||
| -rw-r--r-- | src/portable/nxp/lpc17_40/dcd_lpc17_40.c | 4 | ||||
| -rw-r--r-- | src/portable/nxp/lpc18_43/dcd_lpc18_43.c | 2 |
4 files changed, 10 insertions, 10 deletions
diff --git a/src/portable/nordic/nrf5x/dcd_nrf5x.c b/src/portable/nordic/nrf5x/dcd_nrf5x.c index b834de919..37b5459f6 100644 --- a/src/portable/nordic/nrf5x/dcd_nrf5x.c +++ b/src/portable/nordic/nrf5x/dcd_nrf5x.c @@ -375,7 +375,7 @@ void USBD_IRQHandler(void) for(uint8_t i=0; i<USBD_INTEN_EPDATA_Pos+1; i++) { - if ( TU_BIT_TEST(inten, i) && regevt[i] ) + if ( tu_bit_test(inten, i) && regevt[i] ) { int_status |= TU_BIT(i); @@ -477,7 +477,7 @@ void USBD_IRQHandler(void) */ for(uint8_t epnum=0; epnum<8; epnum++) { - if ( TU_BIT_TEST(int_status, USBD_INTEN_ENDEPOUT0_Pos+epnum)) + if ( tu_bit_test(int_status, USBD_INTEN_ENDEPOUT0_Pos+epnum)) { xfer_td_t* xfer = get_td(epnum, TUSB_DIR_OUT); uint8_t const xact_len = NRF_USBD->EPOUT[epnum].AMOUNT; @@ -517,7 +517,7 @@ void USBD_IRQHandler(void) // CBI In: Endpoint -> Host (transaction complete) for(uint8_t epnum=0; epnum<8; epnum++) { - if ( TU_BIT_TEST(data_status, epnum ) || ( epnum == 0 && is_control_in) ) + if ( tu_bit_test(data_status, epnum ) || ( epnum == 0 && is_control_in) ) { xfer_td_t* xfer = get_td(epnum, TUSB_DIR_IN); @@ -538,7 +538,7 @@ void USBD_IRQHandler(void) // CBI OUT: Host -> Endpoint for(uint8_t epnum=0; epnum<8; epnum++) { - if ( TU_BIT_TEST(data_status, 16+epnum ) || ( epnum == 0 && is_control_out) ) + if ( tu_bit_test(data_status, 16+epnum ) || ( epnum == 0 && is_control_out) ) { xfer_td_t* xfer = get_td(epnum, TUSB_DIR_OUT); diff --git a/src/portable/nxp/lpc11_13_15/dcd_lpc11_13_15.c b/src/portable/nxp/lpc11_13_15/dcd_lpc11_13_15.c index fe7156e7d..b63bf1feb 100644 --- a/src/portable/nxp/lpc11_13_15/dcd_lpc11_13_15.c +++ b/src/portable/nxp/lpc11_13_15/dcd_lpc11_13_15.c @@ -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 diff --git a/src/portable/nxp/lpc17_40/dcd_lpc17_40.c b/src/portable/nxp/lpc17_40/dcd_lpc17_40.c index e969e6673..a14d20e30 100644 --- a/src/portable/nxp/lpc17_40/dcd_lpc17_40.c +++ b/src/portable/nxp/lpc17_40/dcd_lpc17_40.c @@ -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 ) { diff --git a/src/portable/nxp/lpc18_43/dcd_lpc18_43.c b/src/portable/nxp/lpc18_43/dcd_lpc18_43.c index 38ea22380..89dc98ce4 100644 --- a/src/portable/nxp/lpc18_43/dcd_lpc18_43.c +++ b/src/portable/nxp/lpc18_43/dcd_lpc18_43.c @@ -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]; |
