Merge pull request #9769 from teemuatlut/bf2_compile_fixes

[2.0.x] Fix compiling with M600 and runout sensor
This commit is contained in:
Scott Lahteine 2018-02-22 22:52:31 -06:00 committed by GitHub
commit b17982bde9
Signed by: GitHub
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 37 additions and 32 deletions

View file

@ -51,6 +51,7 @@
#include "../libs/buzzer.h"
#include "../libs/nozzle.h"
#include "pause.h"
// private:

View file

@ -35,13 +35,22 @@
#include "../inc/MarlinConfig.h"
class FilamentRunoutSensor {
public:
FilamentRunoutSensor() {}
static bool filament_ran_out;
static void setup();
FORCE_INLINE static reset() { filament_ran_out = false; }
FORCE_INLINE static void reset() { filament_ran_out = false; }
FORCE_INLINE static void run() {
if ((IS_SD_PRINTING || print_job_timer.isRunning()) && check() && !filament_ran_out) {
filament_ran_out = true;
enqueue_and_echo_commands_P(PSTR(FILAMENT_RUNOUT_SCRIPT));
stepper.synchronize();
}
}
private:
static bool filament_ran_out;
FORCE_INLINE static bool check() {
#if NUM_RUNOUT_SENSORS < 2
@ -65,15 +74,6 @@ class FilamentRunoutSensor {
#endif
return false;
}
FORCE_INLINE static void run() {
if ((IS_SD_PRINTING || print_job_timer.isRunning()) && check() && !filament_ran_out) {
filament_ran_out = true;
enqueue_and_echo_commands_P(PSTR(FILAMENT_RUNOUT_SCRIPT));
stepper.synchronize();
}
}
};
extern FilamentRunoutSensor runout;

View file

@ -71,6 +71,10 @@
#include "../feature/fwretract.h"
#endif
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#include "../feature/pause.h"
#endif
#pragma pack(push, 1) // No padding between variables
typedef struct PID { float Kp, Ki, Kd; } PID;