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

423件の閲覧回数
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 返信

407件の閲覧回数
lpcware
NXP Employee
NXP Employee
bump
0 件の賞賛
返信