diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 2e8cff9a..aacb73c0 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -3001,7 +3001,7 @@ template static T gcode_M600_filament_change_z_shift() { #ifdef FILAMENTCHANGE_ZADD - static_assert(Z_MAX_POS < (255 - FILAMENTCHANGE_ZADD), "Z-range too high, change the T type from uint8_t to uint16_t"); + static_assert(Z_MAX_POS < (Z_MAX_POS + 45 - FILAMENTCHANGE_ZADD), "Z-range too high, change the T type from uint8_t to uint16_t"); // avoid floating point arithmetics when not necessary - results in shorter code T ztmp = T( current_position[Z_AXIS] ); T z_shift = 0; diff --git a/Firmware/fsensor.cpp b/Firmware/fsensor.cpp index 840c5260..20078912 100755 --- a/Firmware/fsensor.cpp +++ b/Firmware/fsensor.cpp @@ -543,7 +543,7 @@ void fsensor_enque_M600(){ // 8bit arithmetics in fsensor_clamp_z is 10B shorter than 16bit (not talking about float ;) ) // The compile-time static_assert here ensures, that the computation gets enough bits in case of Z-range too high, // i.e. makes the user change the data type, which also results in larger code - static_assert(Z_MAX_POS < (255 - FILAMENTCHANGE_ZADD), "Z-range too high, change fsensor_clamp_z to "); + static_assert(Z_MAX_POS < (Z_MAX_POS + 45 - FILAMENTCHANGE_ZADD), "Z-range too high, change fsensor_clamp_z to "); sprintf_P(buf, gcodeMove, fsensor_clamp_z(current_position[Z_AXIS]) ); enquecommand_front(buf, false); }