-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert all services to extern pattern. Reduce warnings from boost sml
- Loading branch information
Showing
3 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "encoder.h" | ||
|
||
// Define the global encoder instance | ||
AiEsp32RotaryEncoder encoder( | ||
Pins::Remote::encoderA, | ||
Pins::Remote::encoderB, | ||
Pins::Remote::encoderSwitch, | ||
Pins::Remote::encoderPower, | ||
Pins::Remote::encoderStepsPerNotch | ||
); | ||
|
||
void IRAM_ATTR readEncoderISR() { | ||
encoder.readEncoder_ISR(); | ||
} | ||
|
||
void initEncoder() { | ||
encoder.begin(); | ||
encoder.setup(readEncoderISR); | ||
encoder.setBoundaries(0, 99, false); | ||
encoder.setAcceleration(0); | ||
encoder.disableAcceleration(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include "stepper.h" | ||
|
||
FastAccelStepperEngine stepperEngine = FastAccelStepperEngine(); | ||
FastAccelStepper *stepper = nullptr; | ||
class StrokeEngine Stroker; | ||
|
||
void initStepper() { | ||
stepperEngine.init(); | ||
stepper = stepperEngine.stepperConnectToPin(Pins::Driver::motorStepPin); | ||
if (stepper) { | ||
stepper->setDirectionPin(Pins::Driver::motorDirectionPin, false); | ||
stepper->setEnablePin(Pins::Driver::motorEnablePin, true); | ||
stepper->setAutoEnable(false); | ||
} | ||
|
||
// disable motor briefly in case we are against a hard stop. | ||
digitalWrite(Pins::Driver::motorEnablePin, HIGH); | ||
delay(600); | ||
digitalWrite(Pins::Driver::motorEnablePin, LOW); | ||
delay(100); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include "tasks.h" | ||
|
||
namespace Tasks { | ||
TaskHandle_t drawHelloTaskH = nullptr; | ||
TaskHandle_t drawMenuTaskH = nullptr; | ||
TaskHandle_t drawPlayControlsTaskH = nullptr; | ||
TaskHandle_t drawPatternControlsTaskH = nullptr; | ||
TaskHandle_t wmTaskH = nullptr; | ||
TaskHandle_t drawPreflightTaskH = nullptr; | ||
|
||
TaskHandle_t runHomingTaskH = nullptr; | ||
TaskHandle_t runSimplePenetrationTaskH = nullptr; | ||
TaskHandle_t runStrokeEngineTaskH = nullptr; | ||
} |