Browse Source

moved the variables in the ISR, thats the most normal use case of static.

pull/1/head
Bernhard Kubicek 13 years ago
parent
commit
ea86a5e10f
  1. 13
      Marlin/temperature.cpp

13
Marlin/temperature.cpp

@ -322,15 +322,18 @@ void tp_init()
TIMSK0 |= (1<<OCIE0B);
}
static unsigned char temp_count = 0;
static unsigned long raw_temp_0_value = 0;
static unsigned long raw_temp_1_value = 0;
static unsigned long raw_temp_2_value = 0;
static unsigned char temp_state = 0;
// Timer 0 is shared with millies
ISR(TIMER0_COMPB_vect)
{
//these variables are only accesible from the ISR, but static, so they don't loose their value
static unsigned char temp_count = 0;
static unsigned long raw_temp_0_value = 0;
static unsigned long raw_temp_1_value = 0;
static unsigned long raw_temp_2_value = 0;
static unsigned char temp_state = 0;
switch(temp_state) {
case 0: // Prepare TEMP_0
#if (TEMP_0_PIN > -1)

Loading…
Cancel
Save