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

@ -43,7 +43,7 @@
/* /*
* Interface implementation, the following functions just invoke the equivalent * Interface implementation, the following functions just invoke the equivalent
* queue-level function or macro. * queue-level function or macro.
*/ */
static size_t writes(void *ip, const uint8_t *bp, size_t n) { static size_t writes(void *ip, const uint8_t *bp, size_t n) {
@ -97,7 +97,7 @@ static const struct SerialDriverVMT vmt = {
/*===========================================================================*/ /*===========================================================================*/
/** /**
* @brief Serial Driver initialization. * @brief Serial Driver initialization.
*/ */
void sdInit(void) { void sdInit(void) {
@ -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,12 +44,12 @@
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.
* @note It is empty because @p BaseChannel is only an interface without * @note It is empty because @p BaseChannel is only an interface without
* implementation. * implementation.
*/ */
#define _base_channel_data \ #define _base_channel_data \
_base_sequental_stream_data _base_sequental_stream_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 \
}; };
/** /**
@ -66,14 +66,14 @@ struct BaseChannelVMT { \
* *
* @brief Base channel class. * @brief Base channel class.
* @details This class represents a generic, byte-wide, I/O channel. This class * @details This class represents a generic, byte-wide, I/O channel. This class
* introduces generic I/O primitives with timeout specification. * introduces generic I/O primitives with timeout specification.
*/ */
typedef struct { 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
}; };
/** /**
@ -227,21 +227,21 @@ struct BaseAsynchronousChannelVMT {
* *
* @brief Base asynchronous channel class. * @brief Base asynchronous channel class.
* @details This class extends @p BaseChannel by adding event sources fields * @details This class extends @p BaseChannel by adding event sources fields
* for asynchronous I/O for use in an event-driven environment. * for asynchronous I/O for use in an event-driven environment.
*/ */
typedef struct { 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;
/** /**
* @brief Returns the write event source. * @brief Returns the write event source.
* @details The write event source is broadcasted when the channel is ready * @details The write event source is broadcasted when the channel is ready
* for write operations. This usually happens when the internal * for write operations. This usually happens when the internal
* output queue becomes empty. * output queue becomes empty.
* @param[in] ip pointer to a @p BaseAsynchronousChannel or derived class * @param[in] ip pointer to a @p BaseAsynchronousChannel or derived class
* @return A pointer to an @p EventSource object. * @return A pointer to an @p EventSource object.
*/ */

View File

@ -28,7 +28,7 @@
#define _DEBUG_H_ #define _DEBUG_H_
/** /**
* @brief Trace buffer entries. * @brief Trace buffer entries.
*/ */
#ifndef TRACE_BUFFER_SIZE #ifndef TRACE_BUFFER_SIZE
#define TRACE_BUFFER_SIZE 64 #define TRACE_BUFFER_SIZE 64
@ -53,7 +53,7 @@
#endif #endif
/** /**
* @brief Trace buffer record. * @brief Trace buffer record.
*/ */
typedef struct { typedef struct {
void *cse_wtobjp; /**< Object where going to sleep.*/ void *cse_wtobjp; /**< Object where going to sleep.*/
@ -63,7 +63,7 @@ typedef struct {
} CtxSwcEvent; } CtxSwcEvent;
/** /**
* @brief Trace buffer header. * @brief Trace buffer header.
*/ */
typedef struct { typedef struct {
unsigned tb_size; /**< Trace buffer size (records).*/ unsigned tb_size; /**< Trace buffer size (records).*/

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;
/** /**