Skip to content

Commit

Permalink
馃┕ Fix memset block warning
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Jul 1, 2022
1 parent 0d34c2e commit 0d04aa9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Marlin/src/module/planner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2821,7 +2821,7 @@ void Planner::buffer_sync_block(TERN_(LASER_SYNCHRONOUS_M106_M107, uint8_t sync_
block_t * const block = get_next_free_block(next_buffer_head);

// Clear block
memset(block, 0, sizeof(block_t));
block->reset();

block->flag = sync_flag;

Expand Down
2 changes: 2 additions & 0 deletions Marlin/src/module/planner.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ typedef struct block_t {
block_laser_t laser;
#endif

void reset() { memset((char*)this, 0, sizeof(*this)); }

} block_t;

#if ANY(LIN_ADVANCE, SCARA_FEEDRATE_SCALING, GRADIENT_MIX, LCD_SHOW_E_TOTAL, POWER_LOSS_RECOVERY)
Expand Down

0 comments on commit 0d04aa9

Please sign in to comment.