diff --git a/examples/blinking_echo/src/blinking_echo.c b/examples/blinking_echo/src/blinking_echo.c index 0a9fa0e3..065cec4b 100644 --- a/examples/blinking_echo/src/blinking_echo.c +++ b/examples/blinking_echo/src/blinking_echo.c @@ -37,10 +37,9 @@ ** ** This is a mini example of the CIAA Firmware to test the periodical ** task excecution and serial port funcionality. - ** To run this sample in x86 plataform you mut enable the funcionality - ** of uart device setting a value of une or more of folowing macros - ** of uart device setting a value of one or more of folowing macros - ** defined in header file /plataforms/x86/inc/ciaaDriverUart_Internal.h + ** To run this sample in x86 plataform you must enable the funcionality of + ** uart device setting a value of une or more of folowing macros defined + ** in header file modules/plataforms/x86/inc/ciaaDriverUart_Internal.h **/ /** \addtogroup CIAA_Firmware CIAA Firmware diff --git a/modules/platforms/x86/src/ciaaDriverUart.c b/modules/platforms/x86/src/ciaaDriverUart.c index a073799f..b8d9a161 100644 --- a/modules/platforms/x86/src/ciaaDriverUart.c +++ b/modules/platforms/x86/src/ciaaDriverUart.c @@ -73,7 +73,7 @@ #include #include #include - #include // Error number definitions + #include #endif /* CIAADRVUART_ENABLE_FUNCIONALITY */ /*==================[macros and definitions]=================================*/ @@ -250,10 +250,15 @@ ciaaDevices_deviceType * ciaaDriverUart_serialOpen(ciaaDevices_deviceType * devi } if (uart->fileDescriptor) { /* configure serial port opstions */ - //result = tcsetattr(uart->fileDescriptor, TCSANOW, &uart->deviceOptions); /* Issue #173, Under MAC OS X the function returns error even when the port is properly configured */ - result = 0; - tcsetattr(uart->fileDescriptor, TCSANOW, &uart->deviceOptions); + #if 0 + /* This is the correct code, but in MAC OS X returns error if an thread was created previously to this call */ + result = tcsetattr(uart->fileDescriptor, TCSANOW, &uart->deviceOptions); + #else + /* This is a turn around to avoid the error on MAC OS X, in Linux it's unnecessary */ + result = 0; + tcsetattr(uart->fileDescriptor, TCSANOW, &uart->deviceOptions); + #endif if (result) { perror("Error setting serial port parameters: ");