History

fix conditional implementation of SerialInterface

Stephen Birarda committed 13 years ago

Commit 5b8541e1 parent 6a7b4062 files · +5 −4Browse files

Showing the changes to interface/src/SerialInterface.cpp (1 of 2 files). Show all

Unified · Split

interface/src/SerialInterface.cpp+4−3
@@ -30,8 +30,6 @@ const int ZERO_OFFSET = 2048; · 29 unmodified lines
3030 const short NO_READ_MAXIMUM_MSECS = 3000;
3131 const short SAMPLES_TO_DISCARD = 100;
3232
33−#ifdef UNIX
34−
3533 void SerialInterface::pair() {
3634
3735 #ifdef __APPLE__
@@ -65,6 +63,7 @@ void SerialInterface::pair() { · 27 unmodified lines
6563 // Init the serial port to the specified values
6664 int SerialInterface::init(char* portname, int baud)
6765 {
66+#ifdef __APPLE__
6867 serial_fd = open(portname, O_RDWR | O_NOCTTY | O_NDELAY);
6968
7069 printf("Attemping to open serial interface: %s\n", portname);
@@ -104,6 +103,7 @@ int SerialInterface::init(char* portname, int baud) · 33 unmodified lines
104103 active = true;
105104
106105 return 0;
106+#endif
107107 }
108108
109109 // Reset Trailing averages to the current measurement
@@ -161,6 +161,7 @@ void SerialInterface::renderLevels(int width, int height) { · 51 unmodified lines
161161
162162 }
163163 void SerialInterface::readData() {
164+#ifdef __APPLE__
164165 // This array sets the rate of trailing averaging for each channel.
165166 // If the sensor rate is 100Hz, 0.001 will make the long term average a 10-second average
166167 const float AVG_RATE[] = {0.01, 0.01, 0.01, 0.01, 0.01, 0.01};
@@ -215,6 +216,7 @@ void SerialInterface::readData() { · 48 unmodified lines
215216 } else {
216217 gettimeofday(&lastGoodRead, NULL);
217218 }
219+#endif
218220 }
219221
220222 void SerialInterface::resetSerial() {
@@ -234,7 +236,6 @@ void SerialInterface::resetSerial() { · 13 unmodified lines
234236 }
235237 }
236238
237−#endif
238239
239240
240241