EXTENSIBLE_UI Joystick support (#15303)

This commit is contained in:
Marcio Teixeira
2019-09-18 18:35:03 -06:00
committed by Scott Lahteine
parent 12e0581f24
commit 7f117bfc60
10 changed files with 112 additions and 68 deletions

View File

@ -102,12 +102,16 @@
#include "../../feature/host_actions.h"
#endif
static struct {
uint8_t printer_killed : 1;
uint8_t manual_motion : 1;
} flags;
namespace ExtUI {
static struct {
uint8_t printer_killed : 1;
uint8_t manual_motion : 1;
} flags;
#if ENABLED(JOYSTICK)
float norm_jog[XYZ];
#endif
#ifdef __SAM3X8E__
/**
* Implement a special millis() to allow time measurement
@ -193,6 +197,14 @@ namespace ExtUI {
#endif
}
void jog(float dx, float dy, float dz) {
#if ENABLED(JOYSTICK)
norm_jog[X] = dx;
norm_jog[Y] = dy;
norm_jog[Z] = dz;
#endif
}
bool isHeaterIdle(const extruder_t extruder) {
return false
#if HOTENDS && HEATER_IDLE_HANDLER
@ -1037,9 +1049,10 @@ void MarlinUI::update() {
}
void MarlinUI::kill_screen(PGM_P const msg) {
using namespace ExtUI;
if (!flags.printer_killed) {
flags.printer_killed = true;
ExtUI::onPrinterKilled(msg);
onPrinterKilled(msg);
}
}