Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
ucbus-stepper
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jake Read
ucbus-stepper
Commits
eeb26a89
Commit
eeb26a89
authored
3 years ago
by
Jake Read
Browse files
Options
Downloads
Patches
Plain Diff
motor does axl homing
parent
bc79029c
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
firmware/axl-stepper/src/axl
+1
-1
1 addition, 1 deletion
firmware/axl-stepper/src/axl
firmware/axl-stepper/src/main.cpp
+34
-0
34 additions, 0 deletions
firmware/axl-stepper/src/main.cpp
firmware/axl-stepper/src/osape
+1
-1
1 addition, 1 deletion
firmware/axl-stepper/src/osape
with
36 additions
and
2 deletions
axl
@
71bf9021
Compare
09e3e906
...
71bf9021
Subproject commit
09e3e90667034d09f34bbe4041b3f395461fad8
a
Subproject commit
71bf90214692c6a2fb82d121708b91692648376
a
This diff is collapsed.
Click to expand it.
firmware/axl-stepper/src/main.cpp
+
34
−
0
View file @
eeb26a89
...
...
@@ -155,6 +155,38 @@ EP_ONDATA_RESPONSES onMotorSettingsData(uint8_t* data, uint16_t len){
Endpoint
motorSettingsEP
(
&
osap
,
"motorSettings"
,
onMotorSettingsData
);
// -------------------------------------------------------- 7: Home Routine
EP_ONDATA_RESPONSES
onHomeData
(
uint8_t
*
data
,
uint16_t
len
){
uint16_t
rptr
=
0
;
uint8_t
axis
=
data
[
rptr
++
];
float
rate
=
ts_readFloat32
(
data
,
&
rptr
);
float
offset
=
ts_readFloat32
(
data
,
&
rptr
);
// alright alright, this would be sliq if we had a little async-cpp api, alas,
if
(
axl_isMoving
()){
return
EP_ONDATA_REJECT
;
}
else
{
axl_home
(
axis
,
rate
,
offset
);
return
EP_ONDATA_REJECT
;
}
}
#define LIMIT_PIN 23
#define LIMIT_PORT 0
void
axl_limitSetup
(
void
){
PORT
->
Group
[
LIMIT_PORT
].
DIRCLR
.
reg
=
(
1
<<
LIMIT_PIN
);
PORT
->
Group
[
LIMIT_PORT
].
PINCFG
[
LIMIT_PIN
].
bit
.
INEN
=
1
;
// pullup
PORT
->
Group
[
LIMIT_PORT
].
OUTSET
.
reg
=
(
1
<<
LIMIT_PIN
);
}
boolean
axl_checkLimit
(
void
){
return
(
PORT
->
Group
[
LIMIT_PORT
].
IN
.
reg
&
(
1
<<
LIMIT_PIN
));
}
Endpoint
homeEP
(
&
osap
,
"home"
,
onHomeData
);
// -------------------------------------------------------- Arduino Setup
void
setup
()
{
...
...
@@ -164,6 +196,7 @@ void setup() {
DEBUG2PIN_SETUP
;
// port begin
vpUSBSerial
.
begin
();
vbUCBusDrop
.
begin
(
4
);
// setup stepper machine
stepper_hw
->
init
(
false
,
0.0F
);
stepper_hw
->
setMicrostep
(
4
);
...
...
@@ -186,6 +219,7 @@ void loop() {
lastBlink
=
millis
();
CLKLIGHT_TOGGLE
;
updateStatesEP
();
axl_printHomeState
();
}
}
...
...
This diff is collapsed.
Click to expand it.
osape
@
97e593d5
Compare
bc18a89d
...
97e593d5
Subproject commit
bc18a89d155622fd8ab959773c0eb967cedd9383
Subproject commit
97e593d51e42f77c12b9ed2ae561adc5136ae9cc
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