MCPcopy Create free account
hub / github.com/SmingHub/Sming / removeChannel

Method removeChannel

Sming/Libraries/Servo/Servo.cpp:77–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77bool Servo::removeChannel(ServoChannel* channel)
78{
79 if(channel == nullptr) {
80 return false;
81 }
82
83 int i = findChannel(channel);
84 if(i < 0) {
85 // Channel not active
86 return false;
87 }
88
89 pinMode(channel->getPin(), INPUT);
90
91 channels[i] = nullptr;
92 --channelCount;
93
94 updateTimer.startOnce();
95 return true;
96}
97
98void Servo::updateChannel(ServoChannel*)
99{

Callers 1

detachMethod · 0.80

Calls 3

getPinMethod · 0.80
startOnceMethod · 0.80
pinModeFunction · 0.50

Tested by

no test coverage detected