| 209 | */ |
| 210 | |
| 211 | static int myAnalogRead (struct wiringPiNodeStruct *node, int pin) |
| 212 | { |
| 213 | int piPin = node->fd ; |
| 214 | int chan = pin - node->pinBase ; |
| 215 | int temp = -9997 ; |
| 216 | int rh = -9997 ; |
| 217 | int try ; |
| 218 | |
| 219 | if (chan > 1) |
| 220 | return -9999 ; // Bad parameters |
| 221 | |
| 222 | for (try = 0 ; try < 10 ; ++try) |
| 223 | { |
| 224 | if (myReadRHT03 (piPin, &temp, &rh)) |
| 225 | return chan == 0 ? temp : rh ; |
| 226 | } |
| 227 | |
| 228 | return -9998 ; |
| 229 | } |
| 230 | |
| 231 | |
| 232 | /* |
nothing calls this directly
no test coverage detected