[讨论] 在EPWM中断的设置中为什么要对FLAGH寄存器进行操作啊

xiaomailee   2013-8-16 11:55 楼主
求助!!!在下面的程序中,在对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;
}

回复评论 (1)

虽然没懂,但是这句话有点猫腻:// This ISR MUST be executed from RAM as it will put the Flash into Standby
中断必须从RAM运行,因为它会让Flash进入standby模式。
这句话应该跟对flash操作有关。
点赞  2013-8-18 11:09
电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 京公网安备 11010802033920号
    写回复