MCPcopy Create free account
hub / github.com/WiringPi/WiringPi / waitForConversion

Function waitForConversion

wiringPi/mcp3422.c:47–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45 */
46
47void waitForConversion(int fd, unsigned char *buffer, int n)
48{
49 for (;;) {
50 ssize_t bytes_read = read(fd, buffer, n);
51 if (bytes_read != n) {
52 perror("Error reading from file descriptor");
53 return;
54 }
55
56 if ((buffer[n - 1] & 0x80) == 0)
57 break;
58
59 delay(1);
60 }
61}
62
63/*
64 * myAnalogRead:

Callers 1

myAnalogReadFunction · 0.85

Calls 1

delayFunction · 0.70

Tested by

no test coverage detected