Skip to content

Commit

Permalink
manage_heater => task
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Jun 30, 2022
1 parent e27137d commit 1e8212a
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ void idle(bool no_stepper_sleep/*=false*/) {
manage_inactivity(no_stepper_sleep);

// Manage Heaters (and Watchdog)
thermalManager.manage_heater();
thermalManager.task();

// Max7219 heartbeat, animation, etc
TERN_(MAX7219_DEBUG, max7219.idle_tasks());
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/core/utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ void safe_delay(millis_t ms) {
while (ms > 50) {
ms -= 50;
delay(50);
thermalManager.manage_heater();
thermalManager.task();
}
delay(ms);
thermalManager.manage_heater(); // This keeps us safe if too many small safe_delay() calls are made
thermalManager.task(); // This keeps us safe if too many small safe_delay() calls are made
}

// A delay to provide brittle hosts time to receive bytes
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/motion/G2_G3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ void plan_arc(

for (uint16_t i = 1; i < segments; i++) { // Iterate (segments-1) times

thermalManager.manage_heater();
thermalManager.task();
const millis_t ms = millis();
if (ELAPSED(ms, next_idle_ms)) {
next_idle_ms = ms + 200UL;
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ inline bool process_line_done(uint8_t &sis, char (&buff)[MAX_CMD_SIZE], int &ind
buff[ind] = '\0'; // Of course, I'm a Terminator.
const bool is_empty = (ind == 0); // An empty line?
if (is_empty)
thermalManager.manage_heater(); // Keep sensors satisfied
thermalManager.task(); // Keep sensors satisfied
else
ind = 0; // Start a new line
return is_empty; // Inform the caller
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/ui_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ namespace ExtUI {
}

void yield() {
if (!flags.printer_killed) thermalManager.manage_heater();
if (!flags.printer_killed) thermalManager.task();
}

void enableHeater(const extruder_t extruder) {
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/libs/buzzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void Buzzer::tone(const uint16_t duration, const uint16_t frequency/*=0*/) {
if (!ui.sound_on) return;
while (buffer.isFull()) {
tick();
thermalManager.manage_heater();
thermalManager.task();
}
tone_t tone = { duration, frequency };
buffer.enqueue(tone);
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/module/motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) {
next_idle_ms = ms + 200UL;
return idle();
}
thermalManager.manage_heater(); // Returns immediately on most calls
thermalManager.task(); // Returns immediately on most calls
}

#if IS_KINEMATIC
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/module/planner_bezier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ void cubic_b_spline(

for (float t = 0; t < 1;) {

thermalManager.manage_heater();
thermalManager.task();
millis_t now = millis();
if (ELAPSED(now, next_idle_ms)) {
next_idle_ms = now + 200UL;
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/module/temperature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1837,7 +1837,7 @@ void Temperature::min_temp_error(const heater_id_t heater_id) {
* - Apply filament width to the extrusion rate (may move)
* - Update the heated bed PID output value
*/
void Temperature::manage_heater() {
void Temperature::task() {
if (marlin_state == MF_INITIALIZING) return hal.watchdog_refresh(); // If Marlin isn't started, at least reset the watchdog!

static bool no_reentry = false; // Prevent recursion
Expand Down Expand Up @@ -2393,7 +2393,7 @@ void Temperature::updateTemperaturesFromRawValues() {
/**
* Initialize the temperature manager
*
* The manager is implemented by periodic calls to manage_heater()
* The manager is implemented by periodic calls to task()
*
* - Init (and disable) SPI thermocouples like MAX6675 and MAX31865
* - Disable RUMBA JTAG to accommodate a thermocouple extension
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/module/temperature.h
Original file line number Diff line number Diff line change
Expand Up @@ -716,9 +716,9 @@ class Temperature {
static void readings_ready();

/**
* Call periodically to manage heaters
* Call periodically to manage heaters and keep the watchdog fed
*/
static void manage_heater() __O2; // __O2 added to work around a compiler error
static void task();

/**
* Preheating hotends
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
#define USB_HOST_MANUAL_POLL // Optimization to shut off IRQ automatically

// Workarounds to keep Marlin's watchdog timer from barking...
void marlin_yield() { thermalManager.manage_heater(); }
void marlin_yield() { thermalManager.task(); }
#define SYSTEM_OR_SPECIAL_YIELD(...) marlin_yield();
#define delay(x) safe_delay(x)

Expand Down

0 comments on commit 1e8212a

Please sign in to comment.