LPCOpen bug report

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

LPCOpen bug report

跳至解决方案
914 次查看
MindBender
Contributor II

There's a bug in LPCOpen, switching all peripherals on when trying to switch off one:

lpc_chip_40xx/src/clock_17xx_40xx.c, line 111:

/* Disables power and clocking for a peripheral */
void Chip_Clock_DisablePeriphClock(CHIP_SYSCTL_CLOCK_T clk) {
    uint32_t bs = (uint32_t) clk;

#if defined(CHIP_LPC40XX)
    if (bs >= 32) {
        LPC_SYSCTL->PCONP1 &= ~(1 << (bs - 32));
    }
    else {
        LPC_SYSCTL->PCONP |= ~(1 << bs);
    }
#else
    LPC_SYSCTL->PCONP |= ~(1 << bs);
#endif
}

Index: lpc_chip_40xx/src/clock_17xx_40xx.c
===================================================================
--- lpc_chip_40xx/src/clock_17xx_40xx.c    (revision 440)
+++ lpc_chip_40xx/src/clock_17xx_40xx.c    (working copy)
@@ -117,7 +117,7 @@
         LPC_SYSCTL->PCONP1 &= ~(1 << (bs - 32));
     }
     else {
-        LPC_SYSCTL->PCONP |= ~(1 << bs);
+        LPC_SYSCTL->PCONP &= ~(1 << bs);
     }
 #else
     LPC_SYSCTL->PCONP |= ~(1 << bs);

0 项奖励
回复
1 解答
711 次查看
MindBender
Contributor II

The patch above was incomplete and inadvertently posted by my wonky browser. The version attached to this post is complete. It patches two instances in two files in LPCOpen v2.10.

在原帖中查看解决方案

0 项奖励
回复
2 回复数
712 次查看
MindBender
Contributor II

The patch above was incomplete and inadvertently posted by my wonky browser. The version attached to this post is complete. It patches two instances in two files in LPCOpen v2.10.

0 项奖励
回复
711 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi Robert Delien,

Thanks for your sharing, and I will transfer the report to the AE for checking.

Thanks again.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复