Skip to content

Commit

Permalink
Merge pull request #683 from Paciente8159/fix-G39-hmap-clear
Browse files Browse the repository at this point in the history
fix G39 hmap reset compile error
  • Loading branch information
Paciente8159 committed Apr 26, 2024
2 parents f6eced2 + a630cc0 commit 026261b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions uCNC/src/core/motion_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -1266,6 +1266,10 @@ uint8_t mc_build_hmap(float *target, float *offset, float retract_h, motion_data

return STATUS_OK;
}

void mc_clear_hmap(void){
memset(hmap_offsets, 0, sizeof(hmap_offsets));
}
#endif

#ifdef ENABLE_MOTION_CONTROL_PLANNER_HIJACKING
Expand Down
1 change: 1 addition & 0 deletions uCNC/src/core/motion_control.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ extern "C"

#ifdef ENABLE_G39_H_MAPPING
uint8_t mc_build_hmap(float *target, float *offset, float retract_h, motion_data_t *block_data);
void mc_clear_hmap(void);
#endif

#ifdef ENABLE_MOTION_CONTROL_PLANNER_HIJACKING
Expand Down
2 changes: 1 addition & 1 deletion uCNC/src/core/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1784,7 +1784,7 @@ uint8_t parser_exec_command(parser_state_t *new_state, parser_words_t *words, pa
}
else{
// clear the map
memset(hmap_offsets, 0, sizeof(hmap_offsets));
mc_clear_hmap();
new_state->groups.height_map_active = 0;
}
}
Expand Down

0 comments on commit 026261b

Please sign in to comment.