Bug report : lpcopen_2_10_lpcxpresso_nxp_lpcxpresso_1769, gpdma_17xx_40xx.c

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Bug report : lpcopen_2_10_lpcxpresso_nxp_lpcxpresso_1769, gpdma_17xx_40xx.c

261 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by thedaz on Mon Apr 04 11:53:02 MST 2016
The function

IntStatus Chip_GPDMA_IntGetStatus(LPC_GPDMA_T *pGPDMA, GPDMA_STATUS_T type, uint8_t channel)


contains bad a bad implementation casting a logical and operation on the DMA interrupt status registers into the IntStatus enumeration type. Because the logical and will result in values != 0 or 1 the function will deliver an invalid return code unless it is called for DMA channel 0 only.

switch (type) {
case GPDMA_STAT_INT:/* check status of DMA channel interrupts */
return (IntStatus) (pGPDMA->INTSTAT & (((1UL << channel) & 0xFF)));
        ...


should instead be

switch (type) {
case GPDMA_STAT_INT:/* check status of DMA channel interrupts */
return (pGPDMA->INTSTAT & (((1UL << channel) & 0xFF))) ? SET : RESET;
        ...
Labels (1)
0 Kudos
1 Reply

245 Views
lpcware
NXP Employee
NXP Employee
bump
0 Kudos