heater: if pwm is set to 1, hardware pwm is forced, if available.

This commit is contained in:
Nico Tonnhofer 2017-03-21 08:43:52 +01:00
parent 6e78757385
commit 4882d19215
26 changed files with 80 additions and 95 deletions

View File

@ -226,8 +226,7 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO14, THERMISTOR_BED)
for this pin, e.g. for a MOSFET with a driver.
Set 'pwm' to ...
2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins.
1 for using software emulated PWM.
1 for using hardware PWM on a PWM-able pin and software PWM on other pins.
0 for using on/off on a PWM-able pin, too.
Using PWM usually gives smoother temperature control but can conflict
@ -238,9 +237,9 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO14, THERMISTOR_BED)
//DEFINE_HEATERS_START
// name pin invert pwm max_pwm
DEFINE_HEATER(extruder, DIO10, 0, 2, 100)
DEFINE_HEATER(bed, DIO9, 0, 2, 100)
DEFINE_HEATER(fan, DIO8, 0, 2, 100)
DEFINE_HEATER(extruder, DIO10, 0, 1, 100)
DEFINE_HEATER(bed, DIO9, 0, 1, 100)
DEFINE_HEATER(fan, DIO8, 0, 1, 100)
#define HEATER_EXTRUDER HEATER_extruder
#define HEATER_BED HEATER_bed

View File

@ -226,8 +226,7 @@ DEFINE_TEMP_SENSOR(extruder, TT_THERMISTOR, AIO3, THERMISTOR_EXTRUDER)
for this pin, e.g. for a MOSFET with a driver.
Set 'pwm' to ...
2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins.
1 for using software emulated PWM.
1 for using hardware PWM on a PWM-able pin and software PWM on other pins.
0 for using on/off on a PWM-able pin, too.
Using PWM usually gives smoother temperature control but can conflict
@ -238,7 +237,7 @@ DEFINE_TEMP_SENSOR(extruder, TT_THERMISTOR, AIO3, THERMISTOR_EXTRUDER)
//DEFINE_HEATERS_START
// name pin invert pwm max_pwm
DEFINE_HEATER(extruder, AIO2, 0, 2, 100)
DEFINE_HEATER(extruder, AIO2, 0, 1, 100)
#define HEATER_EXTRUDER HEATER_extruder
//DEFINE_HEATERS_END

View File

@ -220,7 +220,7 @@ DEFINE_TEMP_SENSOR(noheater, TT_INTERCOM, AIO0, 0)
for this pin, e.g. for a MOSFET with a driver.
Set 'pwm' to ...
1 for using PWM on a PWM-able pin and on/off on other pins.
1 for using hardware PWM on a PWM-able pin and software PWM on other pins.
0 for using on/off on a PWM-able pin, too.
Using PWM usually gives smoother temperature control but can conflict

View File

@ -221,8 +221,7 @@ DEFINE_TEMP_SENSOR(extruder, TT_THERMISTOR, AIO5, THERMISTOR_EXTRUDER)
for this pin, e.g. for a MOSFET with a driver.
Set 'pwm' to ...
2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins.
1 for using software emulated PWM.
1 for using hardware PWM on a PWM-able pin and software PWM on other pins.
0 for using on/off on a PWM-able pin, too.
Using PWM usually gives smoother temperature control but can conflict
@ -233,7 +232,7 @@ DEFINE_TEMP_SENSOR(extruder, TT_THERMISTOR, AIO5, THERMISTOR_EXTRUDER)
//DEFINE_HEATERS_START
// name pin invert pwm max_pwm
DEFINE_HEATER(extruder, DIO6, 0, 2, 100)
DEFINE_HEATER(extruder, DIO6, 0, 1, 100)
#define HEATER_EXTRUDER HEATER_extruder
//DEFINE_HEATERS_END

View File

@ -225,13 +225,14 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, PIO1_0,THERMISTOR_BED)
for this pin, e.g. for a MOSFET with a driver.
Set 'pwm' to ...
>=2 in Hertz (Hz) on ARM based controllers to set PWM frequency of
frequency in Hertz (Hz) on ARM based controllers to set PWM frequency of
this pin's output. Frequency isn't always accurate, Teacup
will choose the closest possible one. FAST_PWM is ignored
on such controllers. Valid range is 2 to 200'000 Hz.
It will force to 1 on none-PWM-able pins.
1 for using software emulated PWM at 100Hz.
0 for using on/off on a PWM-able pin, too.
1 on AVR based controllers for using Pulse Width Modulation (PWM)
on a pin supporting it. PWM frequency can be influenced only
somewhat and only globally with FAST_PWM.
0 for using a PWM-able pin in on/off mode.
Using PWM usually gives smoother temperature control but can conflict
with slow switches, like solid state relays. A too high frequency can

View File

@ -230,11 +230,9 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO2, THERMISTOR_BED)
for this pin, e.g. for a MOSFET with a driver.
Set 'pwm' to ...
2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins.
1 for using software emulated PWM.
1 for using hardware PWM on a PWM-able pin and software PWM on other pins.
0 for using on/off on a PWM-able pin, too.
Using PWM usually gives smoother temperature control but can conflict
with slow switches, like solid state relays. PWM frequency can be
influenced globally with FAST_PWM, see below.
@ -243,8 +241,8 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO2, THERMISTOR_BED)
//DEFINE_HEATERS_START
// name pin invert pwm max_pwm
DEFINE_HEATER(extruder, DIO4, 0, 2, 100)
DEFINE_HEATER(bed, DIO3, 0, 2, 100)
DEFINE_HEATER(extruder, DIO4, 0, 1, 100)
DEFINE_HEATER(bed, DIO3, 0, 1, 100)
#define HEATER_EXTRUDER HEATER_extruder
#define HEATER_BED HEATER_bed

View File

@ -231,8 +231,7 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO0, THERMISTOR_BED)
for this pin, e.g. for a MOSFET with a driver.
Set 'pwm' to ...
2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins.
1 for using software emulated PWM.
1 for using hardware PWM on a PWM-able pin and software PWM on other pins.
0 for using on/off on a PWM-able pin, too.
Using PWM usually gives smoother temperature control but can conflict
@ -243,8 +242,8 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO0, THERMISTOR_BED)
//DEFINE_HEATERS_START
// name pin invert pwm max_pwm
DEFINE_HEATER(extruder, DIO4, 0, 2, 100)
DEFINE_HEATER(bed, DIO3, 0, 2, 100)
DEFINE_HEATER(extruder, DIO4, 0, 1, 100)
DEFINE_HEATER(bed, DIO3, 0, 1, 100)
#define HEATER_EXTRUDER HEATER_extruder
#define HEATER_BED HEATER_bed

View File

@ -230,8 +230,7 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED)
for this pin, e.g. for a MOSFET with a driver.
Set 'pwm' to ...
2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins.
1 for using software emulated PWM.
1 for using hardware PWM on a PWM-able pin and software PWM on other pins.
0 for using on/off on a PWM-able pin, too.
Using PWM usually gives smoother temperature control but can conflict
@ -242,9 +241,9 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED)
//DEFINE_HEATERS_START
// name pin invert pwm max_pwm
DEFINE_HEATER(extruder, DIO13, 0, 2, 100)
DEFINE_HEATER(bed, DIO12, 0, 2, 100)
DEFINE_HEATER(fan, DIO4, 0, 1, 100)
DEFINE_HEATER(extruder, DIO13, 0, 1, 100)
DEFINE_HEATER(bed, DIO12, 0, 1, 100)
DEFINE_HEATER(fan, DIO4, 0, 0, 100)
#define HEATER_EXTRUDER HEATER_extruder
#define HEATER_BED HEATER_bed

View File

@ -228,8 +228,7 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO7, THERMISTOR_BED)
for this pin, e.g. for a MOSFET with a driver.
Set 'pwm' to ...
2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins.
1 for using software emulated PWM.
1 for using hardware PWM on a PWM-able pin and software PWM on other pins.
0 for using on/off on a PWM-able pin, too.
Using PWM usually gives smoother temperature control but can conflict
@ -240,8 +239,8 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO7, THERMISTOR_BED)
//DEFINE_HEATERS_START
// name pin invert pwm max_pwm
DEFINE_HEATER(extruder, DIO11, 0, 2, 100)
DEFINE_HEATER(bed, DIO3, 0, 2, 100)
DEFINE_HEATER(extruder, DIO11, 0, 1, 100)
DEFINE_HEATER(bed, DIO3, 0, 1, 100)
#define HEATER_EXTRUDER HEATER_extruder
#define HEATER_BED HEATER_bed

View File

@ -247,8 +247,7 @@
for this pin, e.g. for a MOSFET with a driver.
Set 'pwm' to ...
2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins.
1 for using software emulated PWM.
1 for using hardware PWM on a PWM-able pin and software PWM on other pins.
0 for using on/off on a PWM-able pin, too.
Using PWM usually gives smoother temperature control but can conflict

View File

@ -227,8 +227,7 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO1, THERMISTOR_BED)
for this pin, e.g. for a MOSFET with a driver.
Set 'pwm' to ...
2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins.
1 for using software emulated PWM.
1 for using hardware PWM on a PWM-able pin and software PWM on other pins.
0 for using on/off on a PWM-able pin, too.
Using PWM usually gives smoother temperature control but can conflict
@ -239,9 +238,9 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO1, THERMISTOR_BED)
//DEFINE_HEATERS_START
// name pin invert pwm max_pwm
DEFINE_HEATER(extruder, DIO10, 0, 2, 100)
DEFINE_HEATER(bed, DIO8, 0, 2, 100)
DEFINE_HEATER(fan, DIO9, 0, 2, 100)
DEFINE_HEATER(extruder, DIO10, 0, 1, 100)
DEFINE_HEATER(bed, DIO8, 0, 1, 100)
DEFINE_HEATER(fan, DIO9, 0, 1, 100)
#define HEATER_EXTRUDER HEATER_extruder
#define HEATER_BED HEATER_bed

View File

@ -232,8 +232,7 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO14, THERMISTOR_BED)
for this pin, e.g. for a MOSFET with a driver.
Set 'pwm' to ...
2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins.
1 for using software emulated PWM.
1 for using hardware PWM on a PWM-able pin and software PWM on other pins.
0 for using on/off on a PWM-able pin, too.
Using PWM usually gives smoother temperature control but can conflict
@ -244,9 +243,9 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO14, THERMISTOR_BED)
//DEFINE_HEATERS_START
// name pin invert pwm max_pwm
DEFINE_HEATER(extruder, DIO10, 0, 2, 100)
DEFINE_HEATER(bed, DIO8, 0, 2, 100)
DEFINE_HEATER(fan, DIO9, 0, 2, 100)
DEFINE_HEATER(extruder, DIO10, 0, 1, 100)
DEFINE_HEATER(bed, DIO8, 0, 1, 100)
DEFINE_HEATER(fan, DIO9, 0, 1, 100)
#define HEATER_EXTRUDER HEATER_extruder
#define HEATER_BED HEATER_bed

View File

@ -230,8 +230,7 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO11, THERMISTOR_BED)
for this pin, e.g. for a MOSFET with a driver.
Set 'pwm' to ...
2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins.
1 for using software emulated PWM.
1 for using hardware PWM on a PWM-able pin and software PWM on other pins.
0 for using on/off on a PWM-able pin, too.
Using PWM usually gives smoother temperature control but can conflict
@ -242,9 +241,9 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO11, THERMISTOR_BED)
//DEFINE_HEATERS_START
// name pin invert pwm max_pwm
DEFINE_HEATER(extruder, DIO2, 0, 2, 100)
DEFINE_HEATER(bed, DIO9, 0, 2, 100)
DEFINE_HEATER(fan, DIO8, 0, 2, 100)
DEFINE_HEATER(extruder, DIO2, 0, 1, 100)
DEFINE_HEATER(bed, DIO9, 0, 1, 100)
DEFINE_HEATER(fan, DIO8, 0, 1, 100)
#define HEATER_EXTRUDER HEATER_extruder
#define HEATER_BED HEATER_bed

View File

@ -228,8 +228,7 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED)
for this pin, e.g. for a MOSFET with a driver.
Set 'pwm' to ...
2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins.
1 for using software emulated PWM.
1 for using hardware PWM on a PWM-able pin and software PWM on other pins.
0 for using on/off on a PWM-able pin, too.
Using PWM usually gives smoother temperature control but can conflict
@ -240,8 +239,8 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED)
//DEFINE_HEATERS_START
// name pin invert pwm max_pwm
DEFINE_HEATER(extruder, DIO13, 0, 2, 100)
DEFINE_HEATER(bed, DIO14, 0, 2, 100)
DEFINE_HEATER(extruder, DIO13, 0, 1, 100)
DEFINE_HEATER(bed, DIO14, 0, 1, 100)
#define HEATER_EXTRUDER HEATER_extruder
#define HEATER_BED HEATER_bed

View File

@ -228,8 +228,7 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED)
for this pin, e.g. for a MOSFET with a driver.
Set 'pwm' to ...
2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins.
1 for using software emulated PWM.
1 for using hardware PWM on a PWM-able pin and software PWM on other pins.
0 for using on/off on a PWM-able pin, too.
Using PWM usually gives smoother temperature control but can conflict
@ -240,8 +239,8 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED)
//DEFINE_HEATERS_START
// name pin invert pwm max_pwm
DEFINE_HEATER(extruder, DIO12, 0, 2, 100)
DEFINE_HEATER(bed, DIO13, 0, 2, 100)
DEFINE_HEATER(extruder, DIO12, 0, 1, 100)
DEFINE_HEATER(bed, DIO13, 0, 1, 100)
#define HEATER_EXTRUDER HEATER_extruder
#define HEATER_BED HEATER_bed

View File

@ -228,8 +228,7 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO0, THERMISTOR_BED)
for this pin, e.g. for a MOSFET with a driver.
Set 'pwm' to ...
2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins.
1 for using software emulated PWM.
1 for using hardware PWM on a PWM-able pin and software PWM on other pins.
0 for using on/off on a PWM-able pin, too.
Using PWM usually gives smoother temperature control but can conflict
@ -240,8 +239,8 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO0, THERMISTOR_BED)
//DEFINE_HEATERS_START
// name pin invert pwm max_pwm
DEFINE_HEATER(extruder, DIO3, 0, 2, 100)
DEFINE_HEATER(bed, DIO4, 0, 2, 100)
DEFINE_HEATER(extruder, DIO3, 0, 1, 100)
DEFINE_HEATER(bed, DIO4, 0, 1, 100)
#define HEATER_EXTRUDER HEATER_extruder
#define HEATER_BED HEATER_bed

View File

@ -229,8 +229,7 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED)
for this pin, e.g. for a MOSFET with a driver.
Set 'pwm' to ...
2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins.
1 for using software emulated PWM.
1 for using hardware PWM on a PWM-able pin and software PWM on other pins.
0 for using on/off on a PWM-able pin, too.
Using PWM usually gives smoother temperature control but can conflict
@ -241,9 +240,9 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED)
//DEFINE_HEATERS_START
// name pin invert pwm max_pwm
DEFINE_HEATER(extruder, DIO3, 0, 2, 100)
DEFINE_HEATER(bed, DIO6, 0, 2, 100)
DEFINE_HEATER(fan, DIO5, 0, 2, 100)
DEFINE_HEATER(extruder, DIO3, 0, 1, 100)
DEFINE_HEATER(bed, DIO6, 0, 1, 100)
DEFINE_HEATER(fan, DIO5, 0, 1, 100)
#define HEATER_EXTRUDER HEATER_extruder
#define HEATER_BED HEATER_bed

View File

@ -226,8 +226,7 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED)
for this pin, e.g. for a MOSFET with a driver.
Set 'pwm' to ...
2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins.
1 for using software emulated PWM.
1 for using hardware PWM on a PWM-able pin and software PWM on other pins.
0 for using on/off on a PWM-able pin, too.
Using PWM usually gives smoother temperature control but can conflict
@ -238,9 +237,9 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED)
//DEFINE_HEATERS_START
// name pin invert pwm max_pwm
DEFINE_HEATER(extruder, DIO15, 0, 2, 100)
DEFINE_HEATER(bed, DIO14, 0, 2, 100)
DEFINE_HEATER(fan, DIO16, 0, 1, 100)
DEFINE_HEATER(extruder, DIO15, 0, 1, 100)
DEFINE_HEATER(bed, DIO14, 0, 1, 100)
DEFINE_HEATER(fan, DIO16, 0, 0, 100)
#define HEATER_EXTRUDER HEATER_extruder
#define HEATER_BED HEATER_bed

View File

@ -226,8 +226,7 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO0, THERMISTOR_BED)
for this pin, e.g. for a MOSFET with a driver.
Set 'pwm' to ...
2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins.
1 for using software emulated PWM.
1 for using hardware PWM on a PWM-able pin and software PWM on other pins.
0 for using on/off on a PWM-able pin, too.
Using PWM usually gives smoother temperature control but can conflict
@ -238,9 +237,9 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO0, THERMISTOR_BED)
//DEFINE_HEATERS_START
// name pin invert pwm max_pwm
DEFINE_HEATER(extruder, DIO10, 0, 2, 100)
DEFINE_HEATER(bed, DIO9, 0, 2, 100)
DEFINE_HEATER(fan, DIO8, 0, 1, 100)
DEFINE_HEATER(extruder, DIO10, 0, 1, 100)
DEFINE_HEATER(bed, DIO9, 0, 1, 100)
DEFINE_HEATER(fan, DIO8, 0, 0, 100)
#define HEATER_EXTRUDER HEATER_extruder
#define HEATER_BED HEATER_bed

View File

@ -228,8 +228,7 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED)
for this pin, e.g. for a MOSFET with a driver.
Set 'pwm' to ...
2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins.
1 for using software emulated PWM.
1 for using hardware PWM on a PWM-able pin and software PWM on other pins.
0 for using on/off on a PWM-able pin, too.
Using PWM usually gives smoother temperature control but can conflict
@ -240,9 +239,9 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED)
//DEFINE_HEATERS_START
// name pin invert pwm max_pwm
DEFINE_HEATER(extruder, DIO13, 0, 2, 100)
DEFINE_HEATER(bed, DIO12, 0, 2, 100)
DEFINE_HEATER(fan, DIO4, 0, 2, 100)
DEFINE_HEATER(extruder, DIO13, 0, 1, 100)
DEFINE_HEATER(bed, DIO12, 0, 1, 100)
DEFINE_HEATER(fan, DIO4, 0, 1, 100)
#define HEATER_EXTRUDER HEATER_extruder
#define HEATER_BED HEATER_bed

View File

@ -222,7 +222,7 @@
for this pin, e.g. for a MOSFET with a driver.
Set 'pwm' to ...
1 for using PWM on a PWM-able pin and on/off on other pins.
1 for using hardware PWM on a PWM-able pin and software PWM on other pins.
0 for using on/off on a PWM-able pin, too.
Using PWM usually gives smoother temperature control but can conflict

View File

@ -32,7 +32,7 @@ typedef struct {
// When pwm == 1 it's software pwm.
// pwm == 0 is no pwm at all.
// Use this macro only in DEFINE_HEATER_ACTUAL-macros.
#define PWM_TYPE(pwm, pin) (((pwm) >= HARDWARE_PWM) ? ((pin ## _PWM) ? HARDWARE_PWM : SOFTWARE_PWM) : (pwm))
#define PWM_TYPE(pwm, pin) (((pwm) >= HARDWARE_PWM_START) ? ((pin ## _PWM) ? HARDWARE_PWM : SOFTWARE_PWM) : pwm)
#undef DEFINE_HEATER_ACTUAL
/// \brief helper macro to fill heater definition struct from config.h
@ -163,7 +163,7 @@ void heater_init() {
void do_heater(heater_t index, uint8_t value) {
if (index < NUM_HEATERS) {
if (heaters[index].pwm_type >= HARDWARE_PWM) {
if (heaters[index].pwm_type == HARDWARE_PWM) {
uint8_t pwm_value;
// Remember, we scale, and the timer inverts already.

View File

@ -77,7 +77,7 @@ typedef struct {
// When pwm == 1 it's software pwm.
// pwm == 0 is no pwm at all.
// Use this macro only in DEFINE_HEATER_ACTUAL-macros.
#define PWM_TYPE(pwm, pin) (((pwm) >= HARDWARE_PWM) ? ((pin ## _TIMER) ? HARDWARE_PWM : SOFTWARE_PWM) : (pwm))
#define PWM_TYPE(pwm, pin) (((pwm) >= HARDWARE_PWM_START) ? ((pin ## _TIMER) ? HARDWARE_PWM : SOFTWARE_PWM) : (pwm))
#undef DEFINE_HEATER_ACTUAL
#define DEFINE_HEATER_ACTUAL(name, pin, invert, pwm, max_value) \

View File

@ -76,6 +76,9 @@ typedef enum {
HARDWARE_PWM = 2
} pwm_type_t;
// Force hardware PWM if available.
#define HARDWARE_PWM_START SOFTWARE_PWM
void heater_init(void);
void pid_init(void);

View File

@ -63,7 +63,7 @@
DEFINE_TEMP_SENSOR(extruder, TT_THERMISTOR, AIO1, THERMISTOR_EXTRUDER)
DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO2, THERMISTOR_BED)
DEFINE_HEATER(extruder, DIO4, 0, 2, 100)
DEFINE_HEATER(extruder, DIO4, 0, 1, 100)
DEFINE_HEATER(bed, DIO3, 0, 1, 100)
#define HEATER_EXTRUDER HEATER_extruder

View File

@ -523,7 +523,7 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO0, THERMISTOR_EXTRUDER)
* signal for this pin, e.g. for a MOSFET with a driver. *
* *
* Set 'pwm' to ... *
* 1 for using PWM on a PWM-able pin and on/off on other pins. *
* 1 for using hardware PWM on a PWM-able pin and software PWM on other pins. *
* 0 for using on/off on a PWM-able pin, too. *
* Using PWM usually gives smoother temperature control but can conflict *
* with slow switches, like solid state relays. PWM frequency can be *
@ -551,8 +551,8 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO0, THERMISTOR_EXTRUDER)
// #define HEATER_MAX_ACTIVE
// name pin invert pwm
DEFINE_HEATER(extruder, DIO4, 0, 2, 100)
DEFINE_HEATER(bed, DIO3, 0, 2, 100)
DEFINE_HEATER(extruder, DIO4, 0, 1, 100)
DEFINE_HEATER(bed, DIO3, 0, 1, 100)
/// and now because the c preprocessor isn't as smart as it could be,
/// uncomment the ones you've listed above and comment the rest.