Bug report : lpcopen_2_10_lpcxpresso_nxp_lpcxpresso_1769, gpdma_17xx_40xx.c

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Bug report : lpcopen_2_10_lpcxpresso_nxp_lpcxpresso_1769, gpdma_17xx_40xx.c

422 次查看
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;
        ...
标签 (1)
0 项奖励
回复
1 回复

406 次查看
lpcware
NXP Employee
NXP Employee
bump
0 项奖励
回复