Skip to content

Commit 42d0c9d

Browse files
committed
#173 improve documentation of code
1 parent d9afa1e commit 42d0c9d

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

examples/blinking_echo/src/blinking_echo.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,9 @@
3737
**
3838
** This is a mini example of the CIAA Firmware to test the periodical
3939
** task excecution and serial port funcionality.
40-
** To run this sample in x86 plataform you mut enable the funcionality
41-
** of uart device setting a value of une or more of folowing macros
42-
** of uart device setting a value of one or more of folowing macros
43-
** defined in header file /plataforms/x86/inc/ciaaDriverUart_Internal.h
40+
** To run this sample in x86 plataform you must enable the funcionality of
41+
** uart device setting a value of une or more of folowing macros defined
42+
** in header file modules/plataforms/x86/inc/ciaaDriverUart_Internal.h
4443
**/
4544

4645
/** \addtogroup CIAA_Firmware CIAA Firmware

modules/platforms/x86/src/ciaaDriverUart.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
#include <string.h>
7474
#include <unistd.h>
7575
#include <stdlib.h>
76-
#include <errno.h> // Error number definitions
76+
#include <errno.h>
7777
#endif /* CIAADRVUART_ENABLE_FUNCIONALITY */
7878

7979
/*==================[macros and definitions]=================================*/
@@ -250,10 +250,15 @@ ciaaDevices_deviceType * ciaaDriverUart_serialOpen(ciaaDevices_deviceType * devi
250250
}
251251
if (uart->fileDescriptor) {
252252
/* configure serial port opstions */
253-
//result = tcsetattr(uart->fileDescriptor, TCSANOW, &uart->deviceOptions);
254253
/* Issue #173, Under MAC OS X the function returns error even when the port is properly configured */
255-
result = 0;
256-
tcsetattr(uart->fileDescriptor, TCSANOW, &uart->deviceOptions);
254+
#if 0
255+
/* This is the correct code, but in MAC OS X returns error if an thread was created previously to this call */
256+
result = tcsetattr(uart->fileDescriptor, TCSANOW, &uart->deviceOptions);
257+
#else
258+
/* This is a turn around to avoid the error on MAC OS X, in Linux it's unnecessary */
259+
result = 0;
260+
tcsetattr(uart->fileDescriptor, TCSANOW, &uart->deviceOptions);
261+
#endif
257262
if (result)
258263
{
259264
perror("Error setting serial port parameters: ");

0 commit comments

Comments
 (0)