Showing the changes to interface/src/SerialInterface.cpp (1 of 1 file). Show all
Unified · Split
| @@ -31,13 +31,14 @@ const short NO_READ_MAXIMUM = 10; · 30 unmodified lines | |||
| 31 | const short SAMPLES_TO_DISCARD = 100; | 31 | const short SAMPLES_TO_DISCARD = 100; |
| 32 | 32 | ||
| 33 | void SerialInterface::pair() { | 33 | void SerialInterface::pair() { |
| 34 | |||
| 35 | #ifdef __APPLE__ | ||
| 34 | // look for a matching gyro setup | 36 | // look for a matching gyro setup |
| 35 | DIR *devDir; | 37 | DIR *devDir; |
| 36 | struct dirent *entry; | 38 | struct dirent *entry; |
| 37 | int matchStatus; | 39 | int matchStatus; |
| 38 | regex_t regex; | 40 | regex_t regex; |
| 39 | 41 | ||
| 40 | #ifdef __APPLE__ | ||
| 41 | // for now this only works on OS X, where the usb serial shows up as /dev/tty.usb* | 42 | // for now this only works on OS X, where the usb serial shows up as /dev/tty.usb* |
| 42 | if((devDir = opendir("/dev"))) { | 43 | if((devDir = opendir("/dev"))) { |
| 43 | while((entry = readdir(devDir))) { | 44 | while((entry = readdir(devDir))) { |
| @@ -56,6 +57,7 @@ void SerialInterface::pair() { · 12 unmodified lines | |||
| 56 | closedir(devDir); | 57 | closedir(devDir); |
| 57 | } | 58 | } |
| 58 | #endif | 59 | #endif |
| 60 | |||
| 59 | } | 61 | } |
| 60 | 62 | ||
| 61 | // Init the serial port to the specified values | 63 | // Init the serial port to the specified values |