求助!!!在下面的程序中,在对EPWM中断的设置中,为什么还要对flash进行操作呢?
interrupt void epwm1_timer_isr(void)
{
// Put the Flash to sleep
FlashRegs.FPWR.bit.PWR = FLASH_SLEEP;
EPwm1TimerIntCount++;
if ((EPwm1TimerIntCount%2000)==0)
GpioDataRegs.GPATOGGLE.bit.GPIO0 = 1; // Toggle GPIO0 once
// Clear INT flag for this timer
EPwm1Regs.ETCLR.bit.INT = 1;
// Acknowledge this interrupt to receive more interrupts from group 3
PieCtrlRegs.PIEACK.all = PIEACK_GROUP3;
}
// This ISR MUST be executed from RAM as it will put the Flash into Standby
interrupt void epwm2_timer_isr(void)
{
EPwm2TimerIntCount++;
if ((EPwm2TimerIntCount%2000)==0)
GpioDataRegs.GPATOGGLE.bit.GPIO1 = 1; // Toggle GPIO1 once per
// Put the Flash into standby
FlashRegs.FPWR.bit.PWR = FLASH_STANDBY;
// Clear INT flag for this timer
EPwm2Regs.ETCLR.bit.INT = 1;
// Acknowledge this interrupt to receive more interrupts from group 3
PieCtrlRegs.PIEACK.all = PIEACK_GROUP3;
}
虽然没懂,但是这句话有点猫腻:// This ISR MUST be executed from RAM as it will put the Flash into Standby
中断必须从RAM运行,因为它会让Flash进入standby模式。
这句话应该跟对flash操作有关。