Use native ADC resolution where possible (#15719)

This commit is contained in:
LinFor
2019-11-07 02:49:17 +03:00
committed by Scott Lahteine
parent 9201197878
commit a84e3d1b80
17 changed files with 77 additions and 43 deletions

View File

@ -23,6 +23,7 @@
#include "../inc/MarlinConfig.h"
#include "../module/planner.h"
#include "../module/thermistor/thermistors.h"
class FilamentWidthSensor {
public:
@ -66,7 +67,7 @@ public:
}
// Convert raw measurement to mm
static inline float raw_to_mm(const uint16_t v) { return v * 5.0f * RECIPROCAL(16383.0f); }
static inline float raw_to_mm(const uint16_t v) { return v * 5.0f * RECIPROCAL(float(MAX_RAW_THERMISTOR_VALUE)); }
static inline float raw_to_mm() { return raw_to_mm(raw); }
// A scaled reading is ready