Skip to content

Commit

Permalink
#173 improve documentation of code
Browse files Browse the repository at this point in the history
  • Loading branch information
evolentini committed Dec 14, 2014
1 parent d9afa1e commit 42d0c9d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
7 changes: 3 additions & 4 deletions examples/blinking_echo/src/blinking_echo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 9 additions & 4 deletions modules/platforms/x86/src/ciaaDriverUart.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h> // Error number definitions
#include <errno.h>
#endif /* CIAADRVUART_ENABLE_FUNCIONALITY */

/*==================[macros and definitions]=================================*/
Expand Down Expand Up @@ -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: ");
Expand Down

0 comments on commit 42d0c9d

Please sign in to comment.