MCPcopy Create free account
hub / github.com/Duet3D/RepRapFirmware / GetChange

Method GetChange

src/Display/RotaryEncoder.cpp:97–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97int RotaryEncoder::GetChange() noexcept
98{
99 int r;
100 if (encoderChange >= ppc - 1)
101 {
102 r = (encoderChange + 1)/ppc;
103 }
104 else if (encoderChange <= 1 - ppc)
105 {
106 r = -((1 - encoderChange)/ppc);
107 }
108 else
109 {
110 r = 0;
111 }
112 encoderChange -= (r * ppc);
113 return (reverseDirection) ? -r : r;
114}
115
116bool RotaryEncoder::GetButtonPress() noexcept
117{

Callers 1

SpinMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected