diff options
author | David Crocker <dcrocker@eschertech.com> | 2019-10-19 12:09:19 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2019-10-19 12:09:19 +0300 |
commit | 02c935062002ea863c3bb8c697b0a340eaf9f8ef (patch) | |
tree | ab816960040c2eca6c088b7c9aafb27a22be1c04 /src/Endstops/LocalZProbe.cpp | |
parent | 52155fe59efa861b3c5b86efed03e77ee133d701 (diff) |
Interim commit towards 3.0beta11
Diffstat (limited to 'src/Endstops/LocalZProbe.cpp')
-rw-r--r-- | src/Endstops/LocalZProbe.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Endstops/LocalZProbe.cpp b/src/Endstops/LocalZProbe.cpp index fbb59cf3..710cb6d1 100644 --- a/src/Endstops/LocalZProbe.cpp +++ b/src/Endstops/LocalZProbe.cpp @@ -41,7 +41,7 @@ GCodeResult LocalZProbe::Configure(GCodeBuffer& gb, const StringRef &reply, bool break; default: - access[0] = PinAccess::readWithPullup; + access[0] = PinAccess::read; access[1] = PinAccess::write0; break; } @@ -75,20 +75,21 @@ bool LocalZProbe::AssignPorts(const char* pinNames, const StringRef& reply) // This is called by the tick ISR to get the raw Z probe reading to feed to the filter uint16_t LocalZProbe::GetRawReading() const { + constexpr uint16_t MaxReading = 1000 << (AdcBits - 10); switch (type) { case ZProbeType::analog: case ZProbeType::dumbModulated: case ZProbeType::alternateAnalog: - return min<uint16_t>(inputPort.ReadAnalog(), 4000); + return min<uint16_t>(inputPort.ReadAnalog(), MaxReading); case ZProbeType::digital: case ZProbeType::unfilteredDigital: case ZProbeType::blTouch: - return (inputPort.Read()) ? 4000 : 0; + return (inputPort.Read()) ? MaxReading : 0; default: - return 4000; + return MaxReading; } } |