git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1545 35acf78f-673a-0410-8e92-d51de3d6d3f4

This commit is contained in:
gdisirio 2010-01-25 18:50:35 +00:00
parent 41a4ecfc80
commit a66602c99d
11 changed files with 29 additions and 28 deletions

View File

@ -126,7 +126,7 @@ struct _SerialDriver {
* Virtual Methods Table. * Virtual Methods Table.
*/ */
const struct SerialDriverVMT *vmt; const struct SerialDriverVMT *vmt;
_serial_driver_data; _serial_driver_data
}; };
/*===========================================================================*/ /*===========================================================================*/

View File

@ -121,7 +121,7 @@ typedef struct {
uint8_t ob[SERIAL_BUFFERS_SIZE]; \ uint8_t ob[SERIAL_BUFFERS_SIZE]; \
/* End of the mandatory fields.*/ \ /* End of the mandatory fields.*/ \
/* Pointer to the USART registers block.*/ \ /* Pointer to the USART registers block.*/ \
AT91PS_USART usart AT91PS_USART usart;
/*===========================================================================*/ /*===========================================================================*/
/* Driver macros. */ /* Driver macros. */

View File

@ -142,7 +142,7 @@ typedef struct {
uint8_t ob[SERIAL_BUFFERS_SIZE]; \ uint8_t ob[SERIAL_BUFFERS_SIZE]; \
/* End of the mandatory fields.*/ \ /* End of the mandatory fields.*/ \
/* Pointer to the USART registers block.*/ \ /* Pointer to the USART registers block.*/ \
UART *uart UART *uart;
/*===========================================================================*/ /*===========================================================================*/
/* Driver macros. */ /* Driver macros. */

View File

@ -130,7 +130,7 @@ typedef struct {
/* Data socket for simulated serial port.*/ \ /* Data socket for simulated serial port.*/ \
SOCKET com_data; \ SOCKET com_data; \
/* Port readable name.*/ \ /* Port readable name.*/ \
const char *com_name const char *com_name;
/*===========================================================================*/ /*===========================================================================*/
/* Driver macros. */ /* Driver macros. */

View File

@ -190,7 +190,7 @@ typedef struct {
uint8_t ob[SERIAL_BUFFERS_SIZE]; \ uint8_t ob[SERIAL_BUFFERS_SIZE]; \
/* End of the mandatory fields.*/ \ /* End of the mandatory fields.*/ \
/* Pointer to the USART registers block.*/ \ /* Pointer to the USART registers block.*/ \
USART_TypeDef *usart USART_TypeDef *usart;
/*===========================================================================*/ /*===========================================================================*/
/* Driver macros. */ /* Driver macros. */

View File

@ -126,7 +126,7 @@ typedef struct {
/* Data socket for simulated serial port.*/ \ /* Data socket for simulated serial port.*/ \
SOCKET com_data; \ SOCKET com_data; \
/* Port readable name.*/ \ /* Port readable name.*/ \
const char *com_name const char *com_name;
/*===========================================================================*/ /*===========================================================================*/
/* External declarations. */ /* External declarations. */

View File

@ -212,10 +212,11 @@ void sdIncomingDataI(SerialDriver *sdp, uint8_t b) {
* the interrupt source when this happens). * the interrupt source when this happens).
*/ */
msg_t sdRequestDataI(SerialDriver *sdp) { msg_t sdRequestDataI(SerialDriver *sdp) {
msg_t b;
chDbgCheck(sdp != NULL, "sdRequestDataI"); chDbgCheck(sdp != NULL, "sdRequestDataI");
msg_t b = chOQGetI(&sdp->oqueue); b = chOQGetI(&sdp->oqueue);
if (b < Q_OK) if (b < Q_OK)
chEvtBroadcastI(&sdp->oevent); chEvtBroadcastI(&sdp->oevent);
return b; return b;

View File

@ -67,7 +67,7 @@ typedef struct {
* @brief @p SerialDriver specific data. * @brief @p SerialDriver specific data.
*/ */
#define _serial_driver_data \ #define _serial_driver_data \
_base_asynchronous_channel_data; \ _base_asynchronous_channel_data \
/* Driver state.*/ \ /* Driver state.*/ \
sdstate_t state; \ sdstate_t state; \
/* Current configuration data.*/ \ /* Current configuration data.*/ \

View File

@ -31,7 +31,7 @@
* @brief @p BaseChannel specific methods. * @brief @p BaseChannel specific methods.
*/ */
#define _base_channel_methods \ #define _base_channel_methods \
_base_sequental_stream_methods; \ _base_sequental_stream_methods \
/* Channel output check.*/ \ /* Channel output check.*/ \
bool_t (*putwouldblock)(void *instance); \ bool_t (*putwouldblock)(void *instance); \
/* Channel input check.*/ \ /* Channel input check.*/ \
@ -44,7 +44,7 @@
size_t (*writet)(void *instance, const uint8_t *bp, \ size_t (*writet)(void *instance, const uint8_t *bp, \
size_t n, systime_t time); \ size_t n, systime_t time); \
/* Channel read method with timeout specification.*/ \ /* Channel read method with timeout specification.*/ \
size_t (*readt)(void *instance, uint8_t *bp, size_t n, systime_t time) size_t (*readt)(void *instance, uint8_t *bp, size_t n, systime_t time);
/** /**
* @brief @p BaseChannel specific data. * @brief @p BaseChannel specific data.
@ -58,7 +58,7 @@
* @brief @p BaseChannel virtual methods table. * @brief @p BaseChannel virtual methods table.
*/ */
struct BaseChannelVMT { \ struct BaseChannelVMT { \
_base_channel_methods; \ _base_channel_methods \
}; };
/** /**
@ -73,7 +73,7 @@ typedef struct {
* Virtual Methods Table. * Virtual Methods Table.
*/ */
const struct BaseChannelVMT *vmt; const struct BaseChannelVMT *vmt;
_base_channel_data; _base_channel_data
} BaseChannel; } BaseChannel;
/** /**
@ -209,17 +209,17 @@ typedef struct {
* @brief @p BaseAsynchronousChannel specific data. * @brief @p BaseAsynchronousChannel specific data.
*/ */
#define _base_asynchronous_channel_data \ #define _base_asynchronous_channel_data \
_base_channel_data; \ _base_channel_data \
/* Data Available EventSource.*/ \ /* Data Available EventSource.*/ \
EventSource ievent; \ EventSource ievent; \
/* Data Transmitted EventSource.*/ \ /* Data Transmitted EventSource.*/ \
EventSource oevent EventSource oevent;
/** /**
* @brief @p BaseAsynchronousChannel virtual methods table. * @brief @p BaseAsynchronousChannel virtual methods table.
*/ */
struct BaseAsynchronousChannelVMT { struct BaseAsynchronousChannelVMT {
_base_asynchronous_channel_methods; _base_asynchronous_channel_methods
}; };
/** /**
@ -234,7 +234,7 @@ typedef struct {
* Virtual Methods Table. * Virtual Methods Table.
*/ */
const struct BaseAsynchronousChannelVMT *vmt; const struct BaseAsynchronousChannelVMT *vmt;
_base_asynchronous_channel_data; _base_asynchronous_channel_data
} BaseAsynchronousChannel; } BaseAsynchronousChannel;
/** /**

View File

@ -34,7 +34,7 @@
/* Stream write buffer method.*/ \ /* Stream write buffer method.*/ \
size_t (*write)(void *instance, const uint8_t *bp, size_t n); \ size_t (*write)(void *instance, const uint8_t *bp, size_t n); \
/* Stream read buffer method.*/ \ /* Stream read buffer method.*/ \
size_t (*read)(void *instance, uint8_t *bp, size_t n) size_t (*read)(void *instance, uint8_t *bp, size_t n);
/** /**
* @brief @p BaseSequentialStream specific data. * @brief @p BaseSequentialStream specific data.
@ -47,7 +47,7 @@
* @brief @p BaseSequentialStream virtual methods table. * @brief @p BaseSequentialStream virtual methods table.
*/ */
struct BaseSequentialStreamVMT { struct BaseSequentialStreamVMT {
_base_sequental_stream_methods; _base_sequental_stream_methods
}; };
/** /**
@ -60,7 +60,7 @@ typedef struct {
* Virtual Methods Table. * Virtual Methods Table.
*/ */
const struct BaseSequentialStreamVMT *vmt; const struct BaseSequentialStreamVMT *vmt;
_base_sequental_stream_data; _base_sequental_stream_data
} BaseSequentialStream; } BaseSequentialStream;
/** /**