Skip to content

Commit

Permalink
Fix M600 / Compile Issue for Taller Frame (Zaribo etc)
Browse files Browse the repository at this point in the history
* Update fsensor.cpp

M600 Z_MAX_POS

* Update Marlin_main.cpp

M600 Z_MAX_POS
  • Loading branch information
vertigo235 authored Jun 30, 2019
2 parents ab65136 + 472da9c commit 952f947
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Firmware/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3001,7 +3001,7 @@ template<typename T>
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;
Expand Down
2 changes: 1 addition & 1 deletion Firmware/fsensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint8_t> to <uint16_t>");
static_assert(Z_MAX_POS < (Z_MAX_POS + 45 - FILAMENTCHANGE_ZADD), "Z-range too high, change fsensor_clamp_z<uint8_t> to <uint16_t>");
sprintf_P(buf, gcodeMove, fsensor_clamp_z<uint8_t>(current_position[Z_AXIS]) );
enquecommand_front(buf, false);
}
Expand Down

0 comments on commit 952f947

Please sign in to comment.