diff --git a/pousseseringue-arduino.cpp b/pousseseringue-arduino.cpp index 1787a187cf0238b620b5bbb550d30ea017584783..b87c4afd15df8baf6f46a0119b6c5e37c248cb65 100644 --- a/pousseseringue-arduino.cpp +++ b/pousseseringue-arduino.cpp @@ -56,6 +56,7 @@ SSD1306AsciiWire oled; #include "motor.h" #include "Debouncer.h" // local, debouncer, short counter, long detector #include "syringe.h" +#include "syringefilled.h" #include "cli.h" #include "common.h" #include "fs.h" @@ -88,8 +89,8 @@ float stepsPerSeconds2rpm () { return 60.0 * stepsPerSeconds / (MOTOR_STEPS * MI int rpming = 0; // -1, 0 or +1 // single syringe global instance -Syringe syringe(stepper); -Cli console(syringe); +SyringeFilled syringefilled(stepper); +Cli console(syringe_filled); const char* oledMode () { @@ -178,7 +179,7 @@ void buttons (int shortp, int longp) // log debug on serial console Serial.printf("button change: short:%d long:%d\n", shortp, longp); - syringe.stop(); + syringe_filled.stop(); auto oldrpming = rpming; rpming = 0; // anything stops rpming @@ -272,7 +273,7 @@ void setup() oled.println("Booting...\n"); //syringe.setPhysical(MOTOR_STEPS * MICROSTEPS_CONF, M4_MMREV, /*forwardClockWise*/true, /*emergencySensorBehind*/false); - syringe.setPhysical(MOTOR_STEPS * MICROSTEPS_CONF, M5_MMREV, /*forwardClockWise*/false, /*emergencySensorBehind*/true); + syringe_filled.setPhysical(MOTOR_STEPS * MICROSTEPS_CONF, M5_MMREV, /*forwardClockWise*/false); pinMode(SLEEP, OUTPUT); digitalWrite(SLEEP, 0); @@ -354,7 +355,7 @@ void loop() { if (bEmergency.update(digitalRead(COURSE))) { - syringe.manageEmergency(bEmergency.pressed(), !!stepper.distanceToGo()); + syringefilled.manage_emergency(bEmergency.pressed(), !!stepper.distanceToGo()); Serial.printf("%sEmergency=%u (remaining steps = %lu)\n", msgHeader, bEmergency.pressed(), stepper.distanceToGo()); }