Float maths updates for 2.0.x parity (#11213)

Co-Authored-By: ejtagle <ejtagle@hotmail.com>
This commit is contained in:
Scott Lahteine
2018-07-06 21:44:33 -05:00
committed by GitHub
parent fc9f4ce2c0
commit ccb225f43a
25 changed files with 317 additions and 353 deletions

View File

@@ -107,14 +107,14 @@ enum ADCSensorState : char {
#define ACTUAL_ADC_SAMPLES MAX(int(MIN_ADC_ISR_LOOPS), int(SensorsReady))
#if HAS_PID_HEATING
#define PID_K2 (1.0-PID_K1)
#define PID_dT ((OVERSAMPLENR * float(ACTUAL_ADC_SAMPLES)) / (F_CPU / 64.0 / 256.0))
#define PID_K2 (1.0f-PID_K1)
#define PID_dT ((OVERSAMPLENR * float(ACTUAL_ADC_SAMPLES)) / (F_CPU / 64.0f / 256.0f))
// Apply the scale factors to the PID values
#define scalePID_i(i) ( (i) * PID_dT )
#define unscalePID_i(i) ( (i) / PID_dT )
#define scalePID_d(d) ( (d) / PID_dT )
#define unscalePID_d(d) ( (d) * PID_dT )
#define scalePID_i(i) ( (i) * float(PID_dT) )
#define unscalePID_i(i) ( (i) / float(PID_dT) )
#define scalePID_d(d) ( (d) / float(PID_dT) )
#define unscalePID_d(d) ( (d) * float(PID_dT) )
#endif
class Temperature {