You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compiling MAX31865.cpp without MAX31865_USE_AUTO_MODE produces the warning:
Marlin/src/libs/MAX31865.cpp: In member function 'void MAX31865::begin(max31865_numwires_t, const_float_t, const_float_t, const_float_t)':
Marlin/src/libs/../HAL/shared/Delay.h:167:40: warning: large integer implicitly truncated to unsigned type [-Woverflow]
#define DELAY_US(x) DELAY_CYCLES((x) * ((F_CPU) / 1000000UL))
~~~~^~~~~~~~~~~~~~~~~~~~~~~
Marlin/src/libs/MAX31865.cpp:221:5: note: in expansion of macro 'DELAY_US'
DELAY_US(63000);
^~~~~~~~
and immediate MINTEMP error where applicable.
Changing line 199 of src/libs/MAX31865.cpp from DELAY_US(63000) to delay(63) resolves the compile warning and MINTEMP error. Sensing through a MAX31865 then behaves as expected.
Bug Timeline
Unknown (new user)
Expected behavior
Temperature reading through MAX31865.
Actual behavior
Compile warning and MINTEMP error
Steps to Reproduce
Configure to use a MAX31865 and desired sensor. Ensure MAX31865_USE_AUTO_MODE is not enabled. Compile and flash.
thisiskeithb
changed the title
[BUG] (MAX31865.cpp implicit truncation results in MINTEMP error)
[BUG] MAX31865.cpp implicit truncation results in MINTEMP error
Mar 22, 2025
I'd have to check the data sheet, but 63000 micro-seconds is 63 milliseconds, so it's probably about right for this kind of device. The warning can be eliminated by adding UL suffix to the values. Bare integers are usually native signed int type as defined for the compiler target.
enableBias();
DELAY_US(2000UL); // according to the datasheet, 10.5τ+1msec (see below)oneShot();
DELAY_US(63000UL);
So then the question is whether this fixes the MINTEMP for you. If it does, then we can apply this patch rather than use what may be a too-small delay.
Uh oh!
There was an error while loading. Please reload this page.
Did you test the latest
bugfix-2.1.x
code?Yes, and the problem still exists.
Bug Description
Compiling MAX31865.cpp without MAX31865_USE_AUTO_MODE produces the warning:
and immediate MINTEMP error where applicable.
Changing line 199 of src/libs/MAX31865.cpp from
DELAY_US(63000)
todelay(63)
resolves the compile warning and MINTEMP error. Sensing through a MAX31865 then behaves as expected.Bug Timeline
Unknown (new user)
Expected behavior
Temperature reading through MAX31865.
Actual behavior
Compile warning and MINTEMP error
Steps to Reproduce
Configure to use a MAX31865 and desired sensor. Ensure MAX31865_USE_AUTO_MODE is not enabled. Compile and flash.
Version of Marlin Firmware
bugfix-2.1.x (Mar 20 2025 20:16:36)
Additional information & file uploads
Yes, config is wonky -- trying for minimal
x.zip
.
The text was updated successfully, but these errors were encountered: