analog&RFmodels
Well-known member
i am trying to write a pgm for Teensy LC that time slices tasks and that part is easy
via interval timer routine that increments the task number and main code that looks
to see what the task number is and do that task accordingly. that all works fine.
then i am trying to make the tasks hang proof without any elapsed time or loop
count checks inside the task. i have a second interval timer set for slightly longer
than the first interval timer. if any task takes too long the service routine for IT2
gets run.
i would like that event to cause a skip to the next task number in line. when i use
goto to jump out of the isr and back to main c gets lost.
so instead the isr for it2 sets a variable and does does a software restart. but
because the restart causes re-initialization of all of the variables to zero, it loses
the ability to know why it is starting up - power on or software restart.
i think i could use eeprom but trying to avoid going there for several reasons, and
am wondering if anyone knows how to tell the compiler that one or even all global
variables should NOT get initialized ? best in the c code itself but if elsewhere that
would be second best.
or is there a register that i could check to see why a start or re-start occurred ?
thanks
via interval timer routine that increments the task number and main code that looks
to see what the task number is and do that task accordingly. that all works fine.
then i am trying to make the tasks hang proof without any elapsed time or loop
count checks inside the task. i have a second interval timer set for slightly longer
than the first interval timer. if any task takes too long the service routine for IT2
gets run.
i would like that event to cause a skip to the next task number in line. when i use
goto to jump out of the isr and back to main c gets lost.
so instead the isr for it2 sets a variable and does does a software restart. but
because the restart causes re-initialization of all of the variables to zero, it loses
the ability to know why it is starting up - power on or software restart.
i think i could use eeprom but trying to avoid going there for several reasons, and
am wondering if anyone knows how to tell the compiler that one or even all global
variables should NOT get initialized ? best in the c code itself but if elsewhere that
would be second best.
or is there a register that i could check to see why a start or re-start occurred ?
thanks