AnsweredAssumed Answered

Bug in example under periph_wkt.  Code still runs okay!

Question asked by HM Yoong on Apr 22, 2017
Latest reply on Apr 24, 2017 by jeremyzhou

For the example program for LPC82x Xpresso V2 board, 

 

periph_wkt/examples/src/wkt.c, inside the main() function

 

/* Disable wakeup pad */
Chip_PMU_ClearPowerDownControl(LPC_PMU, PMU_DPDCTRL_WAKEPAD | PMU_DPDCTRL_LPOSCDPDEN);

 

/* Disable wakeup hysteresis by setting the bit (set to disable), enable 10KHz oscillator for all power down modes including deep power-down */
Chip_PMU_SetPowerDownControl(LPC_PMU, PMU_DPDCTRL_WAKEUPPHYS | PMU_DPDCTRL_LPOSCEN |
PMU_DPDCTRL_LPOSCDPDEN);

 

It seems that the code should be

/* Disable wakeup pad */
Chip_PMU_ClearPowerDownControl(LPC_PMU, PMU_DPDCTRL_WAKEPAD);

 

/* Enable wakeup hysteresis by setting the bit, enable 10KHz oscillator for all power down modes including deep power-down */
Chip_PMU_SetPowerDownControl(LPC_PMU, PMU_DPDCTRL_WAKEUPPHYS | PMU_DPDCTRL_LPOSCEN |
PMU_DPDCTRL_LPOSCDPDEN);

Outcomes