diff options
author | midopple <mdoppler@gmx.at> | 2012-02-24 14:00:51 +0100 |
---|---|---|
committer | midopple <mdoppler@gmx.at> | 2012-02-24 14:00:51 +0100 |
commit | 7c5e58a7c49e43c06d704c0ef7e7dad6c0dbf960 (patch) | |
tree | 19d4c62eb694fc24c3b449e6b6b9e56004c77a9f /Sprinter | |
parent | d30c3199f983985ba8144f0fccb3d1eb857ef172 (diff) |
Changhe PWM Value from INT to unsigned char, is faster for interrupt
Diffstat (limited to 'Sprinter')
-rw-r--r-- | Sprinter/heater.cpp | 4 | ||||
-rw-r--r-- | Sprinter/heater.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Sprinter/heater.cpp b/Sprinter/heater.cpp index 65f52e4..9d494b2 100644 --- a/Sprinter/heater.cpp +++ b/Sprinter/heater.cpp @@ -48,7 +48,7 @@ int current_bed_raw = 0; unsigned long previous_millis_heater, previous_millis_bed_heater, previous_millis_monitor; #ifdef PIDTEMP - int g_heater_pwm_val = 0; + volatile unsigned char g_heater_pwm_val = 0; unsigned char PWM_off_time = 0; unsigned char PWM_out_on = 0; @@ -402,7 +402,7 @@ int read_max6675() heater_duty = constrain(heater_duty, 0, HEATER_CURRENT); #ifdef PID_SOFT_PWM - g_heater_pwm_val = heater_duty; + g_heater_pwm_val = (unsigned char)heater_duty; #else analogWrite(HEATER_0_PIN, heater_duty); diff --git a/Sprinter/heater.h b/Sprinter/heater.h index 5470a4f..a1d2917 100644 --- a/Sprinter/heater.h +++ b/Sprinter/heater.h @@ -75,7 +75,7 @@ extern unsigned long previous_millis_heater, previous_millis_bed_heater; extern unsigned char manage_monitor; #ifdef PIDTEMP - extern int g_heater_pwm_val; + extern volatile unsigned char g_heater_pwm_val; extern unsigned char PWM_off_time; extern unsigned char PWM_out_on; |