From 99b790cc92a3af0c58058271d3669723149c178d Mon Sep 17 00:00:00 2001 From: Boyd Date: Mon, 31 Mar 2025 20:30:23 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20Fix=20GCC14=20/=20C++23=20volati?= =?UTF-8?q?le=20warnings=20(#27768)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/module/planner.cpp | 4 +++- Marlin/src/module/planner.h | 6 +++++- ini/gd32.ini | 1 - 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 630557180b..561d13fa2a 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -1582,7 +1582,9 @@ void Planner::quick_stop() { const bool was_enabled = stepper.suspend(); // Drop all queue entries - block_buffer_nonbusy = block_buffer_head = block_buffer_tail; + const uint8_t tail_value = block_buffer_tail; // Read tail value once + block_buffer_head = tail_value; + block_buffer_nonbusy = tail_value; // Restart the block delay for the first movement - As the queue was // forced to empty, there's no risk the ISR will touch this. diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index b2df5824de..318be33131 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -816,7 +816,11 @@ class Planner { FORCE_INLINE static uint8_t nonbusy_movesplanned() { return block_dec_mod(block_buffer_head, block_buffer_nonbusy); } // Remove all blocks from the buffer - FORCE_INLINE static void clear_block_buffer() { block_buffer_nonbusy = block_buffer_head = block_buffer_tail = 0; } + FORCE_INLINE static void clear_block_buffer() { + block_buffer_tail = 0; + block_buffer_head = 0; + block_buffer_nonbusy = 0; + } // Check if movement queue is full FORCE_INLINE static bool is_full() { return block_buffer_tail == next_block_index(block_buffer_head); } diff --git a/ini/gd32.ini b/ini/gd32.ini index 2e5bcea3b5..1286772786 100644 --- a/ini/gd32.ini +++ b/ini/gd32.ini @@ -21,7 +21,6 @@ build_flags = -std=gnu++23 -DADC_RESOLUTION=12 -DCORE_DEBUG -Wno-deprecated-declarations - -Wno-volatile extra_scripts = ${common.extra_scripts} #