File tree Expand file tree Collapse file tree 1 file changed +0
-19
lines changed Expand file tree Collapse file tree 1 file changed +0
-19
lines changed Original file line number Diff line number Diff line change @@ -109,44 +109,25 @@ template <int MAX_MOTORS> int SmartServoClass<MAX_MOTORS>::readByteCmd(uint8_t i
109109}
110110
111111template <int MAX_MOTORS> int SmartServoClass<MAX_MOTORS>::ping(uint8_t id) {
112- timestamps[0 + (id-1) * 6] = millis();
113112 mutex.lock();
114- timestamps[1 + (id-1) * 6] = millis();
115113 writeCmd(id, OP_PING);
116- timestamps[2 + (id-1) * 6] = millis();
117114 // TODO: check return
118115 receiveResponse(6);
119- timestamps[3 + (id-1) * 6] = millis();
120116 if (_rxLen==6 &&
121117 _rxBuf[0]==0xff &&
122118 _rxBuf[1]==0xf5 &&
123119 _rxBuf[2]==id &&
124120 _rxBuf[3]==2) {
125121
126- timestamps[4 + (id-1) * 6] = millis();
127122 mutex.unlock();
128- timestamps[5 + (id-1) * 6] = millis();
129123 return _rxBuf[4];
130124 }
131- timestamps[4 + (id-1) * 6] = millis();
132125 mutex.unlock();
133126 errors++;
134127 if (onError) onError();
135- timestamps[5 + (id-1) * 6] = millis();
136128 return -1;
137129}
138130
139- template <int MAX_MOTORS> void SmartServoClass<MAX_MOTORS>::printTimestamps() {
140- Serial.print("\n-> ");
141- for (int i = 0; i<6; i++) {
142- for (int j = 0; j<6; j++) {
143- Serial.print(timestamps[6*i + j]);
144- Serial.print( " " );
145- }
146- Serial.println("");
147- }
148- }
149-
150131/*
151132// ATTENTION: RESET also changes the ID of the motor
152133
You can’t perform that action at this time.
0 commit comments