Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Step edge count fix & readme update #14

Merged
merged 3 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DendoStepper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ bool DendoStepper::xISR(gptimer_t *timer, const gptimer_alarm_event_data_t *data
ctrl.status = IDLE;
ctrl.stepCnt = 0;
gptimer_disable(timer_handle);
GPIO.out_w1tc = (1ULL << conf.stepPin);
return 0;
}

Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ typedef struct
uint8_t stepPin; /** step signal pin */
uint8_t dirPin; /** dir signal pin */
uint8_t enPin; /** enable signal pin */
timer_group_t timer_group; /** timer group, useful if we are controlling more than 2 steppers */
timer_idx_t timer_idx; /** timer index, useful if we are controlling 2steppers */
microStepping_t miStep; /** microstepping configured on driver - used in distance calculation */
float stepAngle; /** one step angle in degrees (usually 1.8deg), used in steps per rotation calculation */
} DendoStepper_config_t;
Expand Down
6 changes: 1 addition & 5 deletions example/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,13 @@ extern "C" void app_main(void)
.stepPin = 16,
.dirPin = 17,
.enPin = 15,
.timer_group = TIMER_GROUP_0,
.timer_idx = TIMER_0,
.miStep = MICROSTEP_32,
.stepAngle = 1.8};

DendoStepper_config_t step1_cfg = {
.stepPin = 18,
.dirPin = 19,
.enPin = 20,
.timer_group = TIMER_GROUP_0,
.timer_idx = TIMER_1,
.miStep = MICROSTEP_32,
.stepAngle = 1.8};

Expand All @@ -43,7 +39,7 @@ extern "C" void app_main(void)
{
step.runPosMm(500);
step1.runPos(10000);
vTaskDelay(1000);
vTaskDelay(1000 / portTICK_PERIOD_MS);
// step.runAbs(5000);
}
}