Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
atkstepper17
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Jake Read
atkstepper17
Commits
8043a4e1
Commit
8043a4e1
authored
7 years ago
by
Jake Read
Browse files
Options
Downloads
Patches
Plain Diff
reich full system walkthrough
parent
2d46110b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
embedded/mkstepper-v011/.vs/mkstepper-v011/v14/.atsuo
+0
-0
0 additions, 0 deletions
embedded/mkstepper-v011/.vs/mkstepper-v011/v14/.atsuo
embedded/mkstepper-v011/mkstepper-v011/stepper.c
+4
-1
4 additions, 1 deletion
embedded/mkstepper-v011/mkstepper-v011/stepper.c
with
4 additions
and
1 deletion
embedded/mkstepper-v011/.vs/mkstepper-v011/v14/.atsuo
+
0
−
0
View file @
8043a4e1
No preview for this file type
This diff is collapsed.
Click to expand it.
embedded/mkstepper-v011/mkstepper-v011/stepper.c
+
4
−
1
View file @
8043a4e1
...
@@ -61,9 +61,12 @@ void stepper_targetspeed_float(stepper_t *stepper, float speed){
...
@@ -61,9 +61,12 @@ void stepper_targetspeed_float(stepper_t *stepper, float speed){
void
stepper_targetspeed_steps
(
stepper_t
*
stepper
,
uint32_t
speed
){
void
stepper_targetspeed_steps
(
stepper_t
*
stepper
,
uint32_t
speed
){
uint32_t
speedmin
=
((
speed
/
(
stepper
->
position_per_200_steps
/
200
))
*
stepper
->
microsteps
);
// enforce no division by 0
uint32_t
speedmin
=
((
speed
/
(
stepper
->
position_per_200_steps
/
200
))
*
stepper
->
microsteps
);
// enforce no division by 0
// minimum of 1 step / s
// if speed is 0, we leave speed at minimum and set state to not step?
(
speedmin
<
1
)
?
speedmin
=
1
:
(
0
);
(
speedmin
<
1
)
?
speedmin
=
1
:
(
0
);
// timing not accurate to real-world yet
// timing not accurate to real-world yet
stepper
->
speed_period
=
300000000
/
speedmin
;
// timer is 48MHz clock on a DIV16, so we have 3 000 000 ticks / s (333ns resolution, wow)
stepper
->
speed_period
=
60000000
/
speedmin
;
}
}
void
stepper_update
(
stepper_t
*
stepper
){
void
stepper_update
(
stepper_t
*
stepper
){
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment