mirror of
https://github.com/synthetos/g2.git
synced 2026-09-22 03:08:42 +08:00
Checkpoint bug fix in forward planning for dwells
This commit is contained in:
Executable → Regular
+15
-5
@@ -584,7 +584,9 @@ nvObj_t *nv_add_object(const char *token) // add an object to the body usi
|
||||
nvObj_t *nv = nv_body;
|
||||
for (uint8_t i=0; i<NV_BODY_LEN; i++) {
|
||||
if (nv->valuetype != TYPE_EMPTY) {
|
||||
if ((nv = nv->nx) == NULL) return(NULL); // not supposed to find a NULL; here for safety
|
||||
if ((nv = nv->nx) == NULL) { // not supposed to find a NULL; here for safety
|
||||
return(NULL);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
// load the index from the token or die trying
|
||||
@@ -600,7 +602,9 @@ nvObj_t *nv_add_integer(const char *token, const uint32_t value)// add an intege
|
||||
nvObj_t *nv = nv_body;
|
||||
for (uint8_t i=0; i<NV_BODY_LEN; i++) {
|
||||
if (nv->valuetype != TYPE_EMPTY) {
|
||||
if ((nv = nv->nx) == NULL) return(NULL); // not supposed to find a NULL; here for safety
|
||||
if ((nv = nv->nx) == NULL) { // not supposed to find a NULL; here for safety
|
||||
return(NULL);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
strncpy(nv->token, token, TOKEN_LEN);
|
||||
@@ -616,7 +620,9 @@ nvObj_t *nv_add_data(const char *token, const uint32_t value)// add an integer o
|
||||
nvObj_t *nv = nv_body;
|
||||
for (uint8_t i=0; i<NV_BODY_LEN; i++) {
|
||||
if (nv->valuetype != TYPE_EMPTY) {
|
||||
if ((nv = nv->nx) == NULL) return(NULL); // not supposed to find a NULL; here for safety
|
||||
if ((nv = nv->nx) == NULL) { // not supposed to find a NULL; here for safety
|
||||
return(NULL);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
strcpy(nv->token, token);
|
||||
@@ -633,7 +639,9 @@ nvObj_t *nv_add_float(const char *token, const float value) // add a float ob
|
||||
nvObj_t *nv = nv_body;
|
||||
for (uint8_t i=0; i<NV_BODY_LEN; i++) {
|
||||
if (nv->valuetype != TYPE_EMPTY) {
|
||||
if ((nv = nv->nx) == NULL) return(NULL); // not supposed to find a NULL; here for safety
|
||||
if ((nv = nv->nx) == NULL) { // not supposed to find a NULL; here for safety
|
||||
return(NULL);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
strncpy(nv->token, token, TOKEN_LEN);
|
||||
@@ -649,7 +657,9 @@ nvObj_t *nv_add_string(const char *token, const char *string) // add a string ob
|
||||
nvObj_t *nv = nv_body;
|
||||
for (uint8_t i=0; i<NV_BODY_LEN; i++) {
|
||||
if (nv->valuetype != TYPE_EMPTY) {
|
||||
if ((nv = nv->nx) == NULL) return(NULL); // not supposed to find a NULL; here for safety
|
||||
if ((nv = nv->nx) == NULL) { // not supposed to find a NULL; here for safety
|
||||
return(NULL);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
strncpy(nv->token, token, TOKEN_LEN);
|
||||
|
||||
Executable → Regular
Executable → Regular
@@ -152,7 +152,7 @@ static void _init_forward_diffs(float v_0, float v_1);
|
||||
static mpBuf_t *_plan_commands(mpBuf_t *bf) // plan or skip commands; return bf past last command
|
||||
{
|
||||
// must test for buffer state first as the buffer is only "safe" once it's >= PREPPED
|
||||
while ((bf->buffer_state >= MP_BUFFER_PREPPED) && (bf->block_type == BLOCK_TYPE_COMMAND)) {
|
||||
while ((bf->buffer_state >= MP_BUFFER_PREPPED) && (bf->block_type >= BLOCK_TYPE_COMMAND)) {
|
||||
if (bf->buffer_state != MP_BUFFER_PLANNED) { // skip already planned buffers
|
||||
bf->buffer_state = MP_BUFFER_PLANNED; // "planning" is just setting the state (for now)
|
||||
}
|
||||
|
||||
+6
-6
@@ -180,12 +180,12 @@ typedef enum { // bf->buffer_state values in incresing orde
|
||||
} bufferState;
|
||||
|
||||
typedef enum { // bf->block_type values
|
||||
BLOCK_TYPE_NULL = 0, // null move - does a no-op
|
||||
BLOCK_TYPE_ALINE, // acceleration planned line
|
||||
BLOCK_TYPE_DWELL, // delay with no movement
|
||||
BLOCK_TYPE_COMMAND, // general command
|
||||
BLOCK_TYPE_JSON_WAIT, // general command
|
||||
BLOCK_TYPE_TOOL, // T command
|
||||
BLOCK_TYPE_NULL = 0, // MUST=0 null move - does a no-op
|
||||
BLOCK_TYPE_ALINE = 1, // MUST=1 acceleration planned line
|
||||
BLOCK_TYPE_COMMAND = 2, // MUST=2 general command
|
||||
BLOCK_TYPE_DWELL, // Gcode dwell
|
||||
BLOCK_TYPE_JSON_WAIT, // JSON wait command
|
||||
BLOCK_TYPE_TOOL, // T command (T, not M6 tool change)
|
||||
BLOCK_TYPE_SPINDLE_SPEED, // S command
|
||||
BLOCK_TYPE_STOP, // program stop
|
||||
BLOCK_TYPE_END // program end
|
||||
|
||||
Reference in New Issue
Block a user