Additional comments for Temperature::isr

This commit is contained in:
Scott Lahteine 2016-08-27 20:06:26 -05:00
parent a255945f29
commit e9bfca5870

View File

@ -1399,7 +1399,12 @@ void Temperature::set_current_temp_raw() {
} }
/** /**
* Timer 0 is shared with millies * Timer 0 is shared with millies so don't change the prescaler.
*
* This ISR uses the compare method so it runs at the base
* frequency (16 MHz / 256 = 62500 Hz), but at the TCNT0 set
* in OCR0B above (128 or halfway between OVFs).
*
* - Manage PWM to all the heaters and fan * - Manage PWM to all the heaters and fan
* - Update the raw temperature values * - Update the raw temperature values
* - Check new temperature values for MIN/MAX errors * - Check new temperature values for MIN/MAX errors
@ -1515,6 +1520,7 @@ void Temperature::isr() {
#endif #endif
#endif #endif
// 488.28 Hz (or 1:976.56, 2:1953.12, 3:3906.25, 4:7812.5, 5:7812.5 6:15625, 6:15625 7:31250)
pwm_count += _BV(SOFT_PWM_SCALE); pwm_count += _BV(SOFT_PWM_SCALE);
pwm_count &= 0x7f; pwm_count &= 0x7f;
@ -1523,7 +1529,7 @@ void Temperature::isr() {
/** /**
* SLOW PWM HEATERS * SLOW PWM HEATERS
* *
* for heaters drived by relay * For relay-driven heaters
*/ */
#ifndef MIN_STATE_TIME #ifndef MIN_STATE_TIME
#define MIN_STATE_TIME 16 // MIN_STATE_TIME * 65.5 = time in milliseconds #define MIN_STATE_TIME 16 // MIN_STATE_TIME * 65.5 = time in milliseconds