看流程不应该啊,编译关闭优化选项。核心代码如下。(顺便问下,代码模式下为啥不能自动缩进呢?)注:编辑的时候没有,提交了就有了,嘿嘿void SysTick_Handler(void)
{
mycount++;
}
int main(void) {
//前面还有其他模块初始化
LPC_PMU->PCON = 0x01;
//Chip_Clock_SetMainClockSource(SYSCTL_MAINCLKSRC_IRC);
// Enter an infinite loop, just incrementing a counter
while(1) {
LPC_GPIO_PORT->NOT[0] = (1 << 2);
Chip_UART_SendBlocking(LPC_USART0,"hi\n",3);
if (mycount>4) {
// Chip_UART_SendBlocking(LPC_USART0,"deep sleep\n",11);
SCB->SCR |= (1UL << SCB_SCR_SLEEPDEEP_Pos); //| (SCB->SCR & ~SCB_SCR_RESERVED);
Chip_UART_SendBlocking(LPC_USART0,"deep\n",5);
}
__WFI();
}
|