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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jake Read
ucbus-stepper
Commits
3087001f
Commit
3087001f
authored
2 years ago
by
Jake Read
Browse files
Options
Downloads
Patches
Plain Diff
towards new-queue tests
parent
cdfdafb8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
firmware/axl-stepper/src/axl
+1
-1
1 addition, 1 deletion
firmware/axl-stepper/src/axl
firmware/axl-stepper/src/main.cpp
+45
-40
45 additions, 40 deletions
firmware/axl-stepper/src/main.cpp
with
46 additions
and
41 deletions
axl
@
be9a5a91
Compare
2715834f
...
be9a5a91
Subproject commit
2715834fbc79e77f061f0812234ab3a8eeb14f27
Subproject commit
be9a5a919bc9c6324f4ce6dcdfccac6837b659df
This diff is collapsed.
Click to expand it.
firmware/axl-stepper/src/main.cpp
+
45
−
40
View file @
3087001f
...
...
@@ -24,11 +24,35 @@ OSAP osap("axl-stepper_z");
//OSAP osap("axl-stepper_rl");
//OSAP osap("axl-stepper_rr");
// -------------------------------------------------------- 0: USB Serial
VPort_ArduinoSerial
vpUSBSerial
(
&
osap
,
"arduinoUSBSerial"
,
&
Serial
);
VBus_UCBusDrop
vbUCBusDrop
(
&
osap
,
"ucBusDrop"
);
// -------------------------------------------------------- 1: Bus Drop
VBus_UCBusDrop
vbUCBusDrop
(
&
osap
,
"ucBusDrop"
);
// -------------------------------------------------------- 2: AXL Settings
EP_ONDATA_RESPONSES
onAXLSettingsData
(
uint8_t
*
data
,
uint16_t
len
){
// jd, then pairs of accel & vel limits,
axlSettings_t
settings
;
uint16_t
rptr
=
0
;
for
(
uint8_t
a
=
0
;
a
<
AXL_NUM_DOF
;
a
++
){
settings
.
accelLimits
.
axis
[
a
]
=
ts_readFloat32
(
data
,
&
rptr
);
settings
.
velocityLimits
.
axis
[
a
]
=
ts_readFloat32
(
data
,
&
rptr
);
}
settings
.
queueStartDelayMS
=
ts_readUint32
(
data
,
&
rptr
);
settings
.
ourActuatorID
=
ts_readUint8
(
data
,
&
rptr
);
// ship em...
axl_setSettings
(
settings
);
// don't stash data,
return
EP_ONDATA_ACCEPT
;
}
Endpoint
axlSettingsEP
(
&
osap
,
"axlSettings"
,
onAXLSettingsData
);
// --------------------------------------------------------
2
:
States
// --------------------------------------------------------
3
:
Axl Modal Requests
EP_ONDATA_RESPONSES
onStateData
(
uint8_t
*
data
,
uint16_t
len
){
/*
...
...
@@ -79,39 +103,9 @@ EP_ONDATA_RESPONSES onStateData(uint8_t* data, uint16_t len){
Endpoint
statesEP
(
&
osap
,
"states"
,
onStateData
);
// -------------------------------------------------------- 3: Halt
EP_ONDATA_RESPONSES
onHaltData
(
uint8_t
*
data
,
uint16_t
len
){
axl_halt
(
AXL_HALT_REQUEST
);
return
EP_ONDATA_REJECT
;
}
Endpoint
haltInEP
(
&
osap
,
"haltInput"
,
onHaltData
);
Endpoint
haltOutEP
(
&
osap
,
"haltOutput"
);
// -------------------------------------------------------- 5: AXL Settings
// -------------------------------------------------------- 4: Axl Queue Addition
EP_ONDATA_RESPONSES
onAXLSettingsData
(
uint8_t
*
data
,
uint16_t
len
){
// jd, then pairs of accel & vel limits,
axlSettings_t
settings
;
uint16_t
rptr
=
0
;
for
(
uint8_t
a
=
0
;
a
<
AXL_NUM_DOF
;
a
++
){
settings
.
accelLimits
.
axis
[
a
]
=
ts_readFloat32
(
data
,
&
rptr
);
settings
.
velocityLimits
.
axis
[
a
]
=
ts_readFloat32
(
data
,
&
rptr
);
}
settings
.
queueStartDelayMS
=
ts_readUint32
(
data
,
&
rptr
);
settings
.
outActuatorID
=
ts_readUint8
(
data
,
&
rptr
);
// ship em...
axl_setSettings
(
settings
);
// don't stash data,
return
EP_ONDATA_ACCEPT
;
}
Endpoint
axlSettingsEP
(
&
osap
,
"axlSettings"
,
onAXLSettingsData
);
// -------------------------------------------------------- 8: Precalcd-move-adder;
EP_ONDATA_RESPONSES
onPrecalculatedMoveData
(
uint8_t
*
data
,
uint16_t
len
){
EP_ONDATA_RESPONSES
onPlannedMoveData
(
uint8_t
*
data
,
uint16_t
len
){
axlPlannedSegment_t
move
;
uint16_t
rptr
=
0
;
// location of move-in-sequence, to count continuity,
...
...
@@ -134,10 +128,23 @@ EP_ONDATA_RESPONSES onPrecalculatedMoveData(uint8_t* data, uint16_t len){
return
EP_ONDATA_REJECT
;
}
Endpoint
precalculatedMoveEP
(
&
osap
,
"plannedMovesIn"
,
onPrecalculatedMoveData
);
Endpoint
precalculatedMoveEP
(
&
osap
,
"plannedMovesIn"
,
onPlannedMoveData
);
// -------------------------------------------------------- 5: Halt Input
EP_ONDATA_RESPONSES
onHaltInData
(
uint8_t
*
data
,
uint16_t
len
){
axl_halt
(
AXL_HALT_REQUEST
);
return
EP_ONDATA_REJECT
;
}
Endpoint
haltInEP
(
&
osap
,
"haltIn"
,
onHaltInData
);
// -------------------------------------------------------- 6, 7: Outputs
Endpoint
queueAckOutEP
(
&
osap
,
"queueAckOut"
);
Endpoint
haltOutEP
(
&
osap
,
"haltOut"
);
// --------------------------------------------------------
6
: Motor Settings
// --------------------------------------------------------
8
: Motor Settings
uint8_t
axisPick
=
0
;
boolean
invert
=
false
;
...
...
@@ -196,14 +203,12 @@ void loop() {
// check for halt info...
axlDataLen
=
axl_getHaltPacket
(
axlData
);
if
(
axlDataLen
){
#warning here - ibid, stick in endpoint,
haltOutEP
.
write
(
axlData
,
axlDataLen
);
}
// check for on-queue-completion info...
axlDataLen
=
axl_getQueueAck
(
axlData
);
if
(
axlDataLen
){
#warning here - if we have an ack, stick it in the endpoint...
// and if that endpoint isn't clear to write, we're fukd, halt!
// and add an axl_halt(<string>) option to print those messages
queueAckOutEP
.
write
(
axlData
,
axlDataLen
);
}
// refresh stepper hw,
stepper_hw
->
dacRefresh
();
...
...
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