Other Parts Discussed in Thread: TMS320F28335
Hello,
There is my question :
From a pin interrupt (handle at power off) I want my micro enter in LPM3 to keep the RTC running.
To keep the maximal energy store in a SuperCap and have a running RTC for several hours, the time between Interrupt routine and my low power mode function (configure all peripherals & pins) has to be as short as possible.
The problem is after the ISR my program return to his previous task which has a heavy consumption of energy and my supercap become useless before go in LPM3.
I don't know how to do this but I would like to modify the RETI of the ISR to go directly in my fuction low power mode (somewhat as using a goto instruction but in C).
Does someone know C langage tips to do that?
Thank you
Here is a part of my code :
#pragma vector=PORT1_VECTOR
__interrupt void Port1_ISR (void)
{
if(P1IFG & P_ITAL){
POUT_ENPWR &= ~P_ENPWR;
P1IE &= ~P_ITAL; // Interrupt disabled
P1IFG &= ~P_ITAL;
GATW.Mode = POWER_OFF;
if (GATW.Sleep == 1){
LPM3_EXIT;
}
}
while(1){
switch(GATW.Mode) {
case TASK1:{
function1(); // These functions are not determinist, it could take more than 1 second
function2();
break;}
case POWER_OFF:{
Low_power_Mode(); // I WANT JUMP HERE STRAIGHT AFTER THE RETI FROM PORT1_ISR
P1IES &= ~P_ITAL; // hi/low edge P1IFG &= ~P_ITAL; // IFG Cleared P1IE |= P_ITAL; // Interrupt enabled _BIS_SR(LPM3_bits + GIE); // LPM3, enable interrupts
break;}
}