Skip to content

Commit

Permalink
Add second ISR counter
Browse files Browse the repository at this point in the history
  • Loading branch information
zeleps committed Mar 7, 2022
1 parent 3752db9 commit f6165a3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Marlin/src/module/temperature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2492,7 +2492,8 @@ uint32_t wdogCount = 0;

Temperature::tr_state_machine_t Temperature::tr_state_machine[NR_HEATER_RUNAWAY]; // = { { TRInactive, 0 } };

static uint32_t isrCount = 0;
static uint32_t isrCount1 = 0;
static uint32_t isrCount2 = 0;

/**
* @brief Thermal Runaway state machine for a single heater
Expand Down Expand Up @@ -2536,7 +2537,7 @@ uint32_t wdogCount = 0;
#if HEATER_IDLE_HANDLER
, " ; Idle Timeout:", heater_idle[idle_index].timed_out
#endif
, " ISR count:", isrCount, " WD count: ", wdogCount
, " ISR counts:", isrCount1, " " , isrCount2, " WD count: ", wdogCount
);
}

Expand Down Expand Up @@ -3027,6 +3028,8 @@ class SoftPWM {
*/
void Temperature::isr() {

isrCount1++;

static int8_t temp_count = -1;
static ADCSensorState adc_sensor_state = StartupDelay;
static uint8_t pwm_count = _BV(SOFT_PWM_SCALE);
Expand Down Expand Up @@ -3372,7 +3375,6 @@ void Temperature::isr() {
readings_ready();
}

isrCount++;
break;

#if HAS_TEMP_ADC_0
Expand All @@ -3382,7 +3384,7 @@ void Temperature::isr() {

#if HAS_TEMP_ADC_BED
case PrepareTemp_BED: hal.adc_start(TEMP_BED_PIN); break;
case MeasureTemp_BED: ACCUMULATE_ADC(temp_bed); break;
case MeasureTemp_BED: ACCUMULATE_ADC(temp_bed); isrCount2++; break;
#endif

#if HAS_TEMP_ADC_CHAMBER
Expand Down

0 comments on commit f6165a3

Please sign in to comment.