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
478ff3e8
Commit
478ff3e8
authored
3 years ago
by
Jake Read
Browse files
Options
Downloads
Patches
Plain Diff
at successful ucbus ring test
parent
eed7f8f7
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
firmware/stepper-drop/src/main.cpp
+18
-2
18 additions, 2 deletions
firmware/stepper-drop/src/main.cpp
firmware/stepper-drop/src/osape-d51
+1
-1
1 addition, 1 deletion
firmware/stepper-drop/src/osape-d51
firmware/stepper-drop/src/syserror.cpp
+3
-40
3 additions, 40 deletions
firmware/stepper-drop/src/syserror.cpp
with
22 additions
and
43 deletions
firmware/stepper-drop/src/main.cpp
+
18
−
2
View file @
478ff3e8
...
@@ -151,6 +151,7 @@ void setup() {
...
@@ -151,6 +151,7 @@ void setup() {
ERRLIGHT_SETUP
;
ERRLIGHT_SETUP
;
CLKLIGHT_SETUP
;
CLKLIGHT_SETUP
;
DEBUG1PIN_SETUP
;
DEBUG1PIN_SETUP
;
/*
// limit switch
// limit switch
//limitSetup();
//limitSetup();
// osap
// osap
...
@@ -175,6 +176,10 @@ void setup() {
...
@@ -175,6 +176,10 @@ void setup() {
osapAddVertex(homeStateEp); // 8
osapAddVertex(homeStateEp); // 8
// stepper init
// stepper init
stepper_hw->init(false, c_scale);
stepper_hw->init(false, c_scale);
*/
// bare serial
Serial
.
begin
(
9600
);
ucBusDrop_setup
(
true
,
0
);
}
}
// have available,
// have available,
...
@@ -185,9 +190,20 @@ void setup() {
...
@@ -185,9 +190,20 @@ void setup() {
unsigned
long
lastTx
=
0
;
unsigned
long
lastTx
=
0
;
uint8_t
tstTx
[
14
]
=
{
1
,
2
,
3
,
4
,
5
,
0
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
};
uint8_t
tstTx
[
14
]
=
{
1
,
2
,
3
,
4
,
5
,
0
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
};
uint8_t
tstRx
[
256
];
void
loop
()
{
void
loop
()
{
osapLoop
();
if
(
ucBusDrop_ctrB
()){
stepper_hw
->
dacRefresh
();
ERRLIGHT_TOGGLE
;
uint16_t
len
=
ucBusDrop_readB
(
tstRx
);
logPacket
(
tstRx
,
len
);
if
(
ucBusDrop_ctsB
()){
CLKLIGHT_TOGGLE
;
ucBusDrop_transmitB
(
tstRx
,
len
);
}
}
//osapLoop();
//stepper_hw->dacRefresh();
#ifdef TEST_TX
#ifdef TEST_TX
if
(
millis
()
>
lastTx
+
500
){
if
(
millis
()
>
lastTx
+
500
){
lastTx
=
millis
();
lastTx
=
millis
();
...
...
This diff is collapsed.
Click to expand it.
osape-d51
@
7d0be7a5
Compare
e926d28a
...
7d0be7a5
Subproject commit
e926d28ae33499d1bbb96df5933fba47e7d5eec7
Subproject commit
7d0be7a5c309aab2a3300116c7e9fd2c425fc6cb
This diff is collapsed.
Click to expand it.
firmware/stepper-drop/src/syserror.cpp
+
3
−
40
View file @
478ff3e8
...
@@ -24,37 +24,6 @@ boolean writeLenBytes(unsigned char* dest, uint16_t* dptr, uint16_t len){
...
@@ -24,37 +24,6 @@ boolean writeLenBytes(unsigned char* dest, uint16_t* dptr, uint16_t len){
}
}
*/
*/
#ifdef UCBUS_IS_DROP
//uint8_t escape[512];
//uint8_t escapeHeader[10] = { PK_BUSF_KEY, 0, 0, 0, 0, PK_PTR, PK_PORTF_KEY, 0, 0, PK_DEST };
// config-your-own-ll-escape-hatch
void
sysError
(
String
msg
){
//ERRLIGHT_ON;
/*
uint32_t len = msg.length();
errBuf[0] = PK_LLERR; // the ll-errmsg-key
errBuf[1] = len & 255;
errBuf[2] = (len >> 8) & 255;
errBuf[3] = (len >> 16) & 255;
errBuf[4] = (len >> 24) & 255;
msg.getBytes(&(errBuf[5]), len + 1);
// write header,
memcpy(escape, escapeHeader, 10);
// write segsize, checksum
uint16_t wptr = 10;
ts_writeUint16(128, escape, &wptr);
ts_writeUint16(len + 5, escape, &wptr);
memcpy(&(escape[wptr]), errBuf, len + 5);
// transmit on ucbus
// potential here to hang-up and do while(!(ucBusDrop->cts())) ... I *think* that would clear on an interrupt
ucBusDrop->transmit(escape, len + wptr + 5);
*/
}
#else
// config-your-own-ll-escape-hatch
// config-your-own-ll-escape-hatch
void
sysError
(
String
msg
){
void
sysError
(
String
msg
){
// whatever you want,
// whatever you want,
...
@@ -69,17 +38,11 @@ void sysError(String msg){
...
@@ -69,17 +38,11 @@ void sysError(String msg){
errBuf
[
6
]
=
(
len
>>
24
)
&
255
;
errBuf
[
6
]
=
(
len
>>
24
)
&
255
;
msg
.
getBytes
(
&
(
errBuf
[
7
]),
len
+
1
);
msg
.
getBytes
(
&
(
errBuf
[
7
]),
len
+
1
);
size_t
ecl
=
cobsEncode
(
errBuf
,
len
+
7
,
errEncoded
);
size_t
ecl
=
cobsEncode
(
errBuf
,
len
+
7
,
errEncoded
);
// direct escape
errEncoded
[
ecl
]
=
0
;
// add delimiter
//if(Serial.availableForWrite() > (int64_t)ecl){
// escape:
Serial
.
write
(
errEncoded
,
ecl
);
Serial
.
write
(
errEncoded
,
ecl
+
1
);
Serial
.
flush
();
//} else {
// ERRLIGHT_ON;
//}
}
}
#endif
void
logPacket
(
uint8_t
*
pck
,
uint16_t
len
){
void
logPacket
(
uint8_t
*
pck
,
uint16_t
len
){
String
errmsg
;
String
errmsg
;
errmsg
.
reserve
(
1024
);
errmsg
.
reserve
(
1024
);
...
...
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