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

This commit is contained in:
gdisirio 2010-01-02 12:41:56 +00:00
parent 93a5207c97
commit 61038954f7
13 changed files with 184 additions and 163 deletions

View File

@ -38,7 +38,7 @@
* settings file. This file can be used to include platform specific * settings file. This file can be used to include platform specific
* header files or to override the low level drivers settings. * header files or to override the low level drivers settings.
*/ */
/*#include "mcuconf.h"*/ #include "mcuconf.h"
/*===========================================================================*/ /*===========================================================================*/
/* PAL driver related settings. */ /* PAL driver related settings. */
@ -48,7 +48,7 @@
* @brief Enables the PAL subsystem. * @brief Enables the PAL subsystem.
*/ */
#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) #if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__)
#define CH_HAL_USE_PAL FALSE #define CH_HAL_USE_PAL TRUE
#endif #endif
/*===========================================================================*/ /*===========================================================================*/
@ -106,6 +106,12 @@
#define CH_HAL_USE_SERIAL TRUE #define CH_HAL_USE_SERIAL TRUE
#endif #endif
/*
* Default SERIAL settings overrides (uncomment to override).
*/
/*#define SERIAL_DEFAULT_BITRATE 38400*/
/*#define SERIAL_BUFFERS_SIZE 64*/
/*===========================================================================*/ /*===========================================================================*/
/* SPI driver related settings. */ /* SPI driver related settings. */
/*===========================================================================*/ /*===========================================================================*/

View File

@ -38,7 +38,7 @@
* settings file. This file can be used to include platform specific * settings file. This file can be used to include platform specific
* header files or to override the low level drivers settings. * header files or to override the low level drivers settings.
*/ */
/*#include "mcuconf.h"*/ #include "mcuconf.h"
/*===========================================================================*/ /*===========================================================================*/
/* PAL driver related settings. */ /* PAL driver related settings. */
@ -48,7 +48,7 @@
* @brief Enables the PAL subsystem. * @brief Enables the PAL subsystem.
*/ */
#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) #if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__)
#define CH_HAL_USE_PAL FALSE #define CH_HAL_USE_PAL TRUE
#endif #endif
/*===========================================================================*/ /*===========================================================================*/
@ -106,6 +106,12 @@
#define CH_HAL_USE_SERIAL TRUE #define CH_HAL_USE_SERIAL TRUE
#endif #endif
/*
* Default SERIAL settings overrides (uncomment to override).
*/
/*#define SERIAL_DEFAULT_BITRATE 38400*/
/*#define SERIAL_BUFFERS_SIZE 64*/
/*===========================================================================*/ /*===========================================================================*/
/* SPI driver related settings. */ /* SPI driver related settings. */
/*===========================================================================*/ /*===========================================================================*/

View File

@ -38,7 +38,7 @@
* settings file. This file can be used to include platform specific * settings file. This file can be used to include platform specific
* header files or to override the low level drivers settings. * header files or to override the low level drivers settings.
*/ */
/*#include "mcuconf.h"*/ #include "mcuconf.h"
/*===========================================================================*/ /*===========================================================================*/
/* PAL driver related settings. */ /* PAL driver related settings. */
@ -48,7 +48,7 @@
* @brief Enables the PAL subsystem. * @brief Enables the PAL subsystem.
*/ */
#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) #if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__)
#define CH_HAL_USE_PAL FALSE #define CH_HAL_USE_PAL TRUE
#endif #endif
/*===========================================================================*/ /*===========================================================================*/
@ -106,6 +106,12 @@
#define CH_HAL_USE_SERIAL TRUE #define CH_HAL_USE_SERIAL TRUE
#endif #endif
/*
* Default SERIAL settings overrides (uncomment to override).
*/
/*#define SERIAL_DEFAULT_BITRATE 38400*/
/*#define SERIAL_BUFFERS_SIZE 64*/
/*===========================================================================*/ /*===========================================================================*/
/* SPI driver related settings. */ /* SPI driver related settings. */
/*===========================================================================*/ /*===========================================================================*/

View File

@ -38,7 +38,7 @@
* settings file. This file can be used to include platform specific * settings file. This file can be used to include platform specific
* header files or to override the low level drivers settings. * header files or to override the low level drivers settings.
*/ */
/*#include "mcuconf.h"*/ #include "mcuconf.h"
/*===========================================================================*/ /*===========================================================================*/
/* PAL driver related settings. */ /* PAL driver related settings. */
@ -106,6 +106,12 @@
#define CH_HAL_USE_SERIAL TRUE #define CH_HAL_USE_SERIAL TRUE
#endif #endif
/*
* Default SERIAL settings overrides (uncomment to override).
*/
/*#define SERIAL_DEFAULT_BITRATE 38400*/
/*#define SERIAL_BUFFERS_SIZE 64*/
/*===========================================================================*/ /*===========================================================================*/
/* SPI driver related settings. */ /* SPI driver related settings. */
/*===========================================================================*/ /*===========================================================================*/

View File

@ -38,7 +38,7 @@
* settings file. This file can be used to include platform specific * settings file. This file can be used to include platform specific
* header files or to override the low level drivers settings. * header files or to override the low level drivers settings.
*/ */
/*#include "mcuconf.h"*/ #include "mcuconf.h"
/*===========================================================================*/ /*===========================================================================*/
/* PAL driver related settings. */ /* PAL driver related settings. */
@ -48,7 +48,7 @@
* @brief Enables the PAL subsystem. * @brief Enables the PAL subsystem.
*/ */
#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) #if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__)
#define CH_HAL_USE_PAL FALSE #define CH_HAL_USE_PAL TRUE
#endif #endif
/*===========================================================================*/ /*===========================================================================*/
@ -106,6 +106,12 @@
#define CH_HAL_USE_SERIAL TRUE #define CH_HAL_USE_SERIAL TRUE
#endif #endif
/*
* Default SERIAL settings overrides (uncomment to override).
*/
/*#define SERIAL_DEFAULT_BITRATE 38400*/
/*#define SERIAL_BUFFERS_SIZE 64*/
/*===========================================================================*/ /*===========================================================================*/
/* SPI driver related settings. */ /* SPI driver related settings. */
/*===========================================================================*/ /*===========================================================================*/

View File

@ -89,51 +89,51 @@ Settings: MCK=48.054857, MC_FMR = AT91C_MC_FWS_1FWS (1 wait state)
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 11.1 (Benchmark, messages #1) --- Test Case 11.1 (Benchmark, messages #1)
--- Score : 114930 msgs/S, 229860 ctxswc/S --- Score : 114965 msgs/S, 229930 ctxswc/S
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 11.2 (Benchmark, messages #2) --- Test Case 11.2 (Benchmark, messages #2)
--- Score : 90551 msgs/S, 181102 ctxswc/S --- Score : 90579 msgs/S, 181158 ctxswc/S
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 11.3 (Benchmark, messages #3) --- Test Case 11.3 (Benchmark, messages #3)
--- Score : 90551 msgs/S, 181102 ctxswc/S --- Score : 90579 msgs/S, 181158 ctxswc/S
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 11.4 (Benchmark, context switch) --- Test Case 11.4 (Benchmark, context switch)
--- Score : 391096 ctxswc/S --- Score : 391224 ctxswc/S
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 11.5 (Benchmark, threads, full cycle) --- Test Case 11.5 (Benchmark, threads, full cycle)
--- Score : 82571 threads/S --- Score : 82600 threads/S
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 11.6 (Benchmark, threads, create only) --- Test Case 11.6 (Benchmark, threads, create only)
--- Score : 115480 threads/S --- Score : 115522 threads/S
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 11.7 (Benchmark, mass reschedulation, 5 threads) --- Test Case 11.7 (Benchmark, mass reschedulation, 5 threads)
--- Score : 28340 reschedulations/S, 170040 ctxswc/S --- Score : 28350 reschedulations/S, 170100 ctxswc/S
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 11.8 (Benchmark, round robin context switching) --- Test Case 11.8 (Benchmark, round robin context switching)
--- Score : 258076 reschedulations/S, 258076 ctxswc/S --- Score : 258160 reschedulations/S, 258160 ctxswc/S
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 11.9 (Benchmark, I/O Queues throughput) --- Test Case 11.9 (Benchmark, I/O Queues throughput)
--- Score : 249188 bytes/S --- Score : 249280 bytes/S
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 11.10 (Benchmark, virtual timers set/reset) --- Test Case 11.10 (Benchmark, virtual timers set/reset)
--- Score : 264162 timers/S --- Score : 264256 timers/S
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 11.11 (Benchmark, semaphores wait/signal) --- Test Case 11.11 (Benchmark, semaphores wait/signal)
--- Score : 466472 wait+signal/S --- Score : 466632 wait+signal/S
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 11.12 (Benchmark, mutexes lock/unlock) --- Test Case 11.12 (Benchmark, mutexes lock/unlock)
--- Score : 317696 lock+unlock/S --- Score : 317812 lock+unlock/S
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 11.13 (Benchmark, RAM footprint) --- Test Case 11.13 (Benchmark, RAM footprint)

View File

@ -89,51 +89,51 @@ Settings: CCLK=48, MAMCR=2, MAMTIM=3 (3 wait states)
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 11.1 (Benchmark, messages #1) --- Test Case 11.1 (Benchmark, messages #1)
--- Score : 144470 msgs/S, 288940 ctxswc/S --- Score : 144491 msgs/S, 288982 ctxswc/S
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 11.2 (Benchmark, messages #2) --- Test Case 11.2 (Benchmark, messages #2)
--- Score : 114678 msgs/S, 229356 ctxswc/S --- Score : 114693 msgs/S, 229386 ctxswc/S
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 11.3 (Benchmark, messages #3) --- Test Case 11.3 (Benchmark, messages #3)
--- Score : 114678 msgs/S, 229356 ctxswc/S --- Score : 114693 msgs/S, 229386 ctxswc/S
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 11.4 (Benchmark, context switch) --- Test Case 11.4 (Benchmark, context switch)
--- Score : 501392 ctxswc/S --- Score : 501456 ctxswc/S
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 11.5 (Benchmark, threads, full cycle) --- Test Case 11.5 (Benchmark, threads, full cycle)
--- Score : 107703 threads/S --- Score : 107717 threads/S
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 11.6 (Benchmark, threads, create only) --- Test Case 11.6 (Benchmark, threads, create only)
--- Score : 150379 threads/S --- Score : 150398 threads/S
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 11.7 (Benchmark, mass reschedulation, 5 threads) --- Test Case 11.7 (Benchmark, mass reschedulation, 5 threads)
--- Score : 36504 reschedulations/S, 219024 ctxswc/S --- Score : 36509 reschedulations/S, 219054 ctxswc/S
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 11.8 (Benchmark, round robin context switching) --- Test Case 11.8 (Benchmark, round robin context switching)
--- Score : 340940 reschedulations/S, 340940 ctxswc/S --- Score : 340980 reschedulations/S, 340980 ctxswc/S
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 11.9 (Benchmark, I/O Queues throughput) --- Test Case 11.9 (Benchmark, I/O Queues throughput)
--- Score : 357216 bytes/S --- Score : 357264 bytes/S
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 11.10 (Benchmark, virtual timers set/reset) --- Test Case 11.10 (Benchmark, virtual timers set/reset)
--- Score : 333278 timers/S --- Score : 333324 timers/S
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 11.11 (Benchmark, semaphores wait/signal) --- Test Case 11.11 (Benchmark, semaphores wait/signal)
--- Score : 623080 wait+signal/S --- Score : 623180 wait+signal/S
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 11.12 (Benchmark, mutexes lock/unlock) --- Test Case 11.12 (Benchmark, mutexes lock/unlock)
--- Score : 380308 lock+unlock/S --- Score : 380356 lock+unlock/S
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 11.13 (Benchmark, RAM footprint) --- Test Case 11.13 (Benchmark, RAM footprint)

View File

@ -131,8 +131,6 @@ static void serve_interrupt(SerialDriver *sdp) {
UART *u = sdp->sd.uart; UART *u = sdp->sd.uart;
while (TRUE) { while (TRUE) {
int i;
switch (u->UART_IIR & IIR_SRC_MASK) { switch (u->UART_IIR & IIR_SRC_MASK) {
case IIR_SRC_NONE: case IIR_SRC_NONE:
return; return;
@ -153,8 +151,9 @@ static void serve_interrupt(SerialDriver *sdp) {
} }
break; break;
case IIR_SRC_TX: case IIR_SRC_TX:
#if UART_FIFO_PRELOAD > 0 {
i = UART_FIFO_PRELOAD; #if LPC214x_UART_FIFO_PRELOAD > 0
int i = LPC214x_UART_FIFO_PRELOAD;
do { do {
msg_t b; msg_t b;
@ -179,6 +178,7 @@ static void serve_interrupt(SerialDriver *sdp) {
else else
u->UART_THR = b; u->UART_THR = b;
#endif #endif
}
break; break;
default: default:
(void) u->UART_THR; (void) u->UART_THR;
@ -187,12 +187,12 @@ static void serve_interrupt(SerialDriver *sdp) {
} }
} }
#if UART_FIFO_PRELOAD > 0 #if LPC214x_UART_FIFO_PRELOAD > 0
static void preload(SerialDriver *sdp) { static void preload(SerialDriver *sdp) {
UART *u = sdp->sd.uart; UART *u = sdp->sd.uart;
if (u->UART_LSR & LSR_THRE) { if (u->UART_LSR & LSR_THRE) {
int i = UART_FIFO_PRELOAD; int i = LPC214x_UART_FIFO_PRELOAD;
do { do {
chSysLockFromIsr(); chSysLockFromIsr();
msg_t b = chOQGetI(&sdp->sd.oqueue); msg_t b = chOQGetI(&sdp->sd.oqueue);
@ -212,7 +212,7 @@ static void preload(SerialDriver *sdp) {
#if USE_LPC214x_UART0 || defined(__DOXYGEN__) #if USE_LPC214x_UART0 || defined(__DOXYGEN__)
static void notify1(void) { static void notify1(void) {
#if UART_FIFO_PRELOAD > 0 #if LPC214x_UART_FIFO_PRELOAD > 0
preload(&SD1); preload(&SD1);
#else #else
@ -220,7 +220,7 @@ static void notify1(void) {
if (u->UART_LSR & LSR_THRE) { if (u->UART_LSR & LSR_THRE) {
chSysLockFromIsr(); chSysLockFromIsr();
u->UART_THR = chOQGetI(&SD1.sd_oqueue); u->UART_THR = chOQGetI(&SD1.sd.oqueue);
chSysUnlockFromIsr(); chSysUnlockFromIsr();
} }
u->UART_IER |= IER_THRE; u->UART_IER |= IER_THRE;
@ -230,14 +230,14 @@ static void notify1(void) {
#if USE_LPC214x_UART1 || defined(__DOXYGEN__) #if USE_LPC214x_UART1 || defined(__DOXYGEN__)
static void notify2(void) { static void notify2(void) {
#if UART_FIFO_PRELOAD > 0 #if LPC214x_UART_FIFO_PRELOAD > 0
preload(&SD2); preload(&SD2);
#else #else
UART *u = U1Base; UART *u = U1Base;
if (u->UART_LSR & LSR_THRE) if (u->UART_LSR & LSR_THRE)
u->UART_THR = chOQGetI(&SD2.sd_oqueue); u->UART_THR = chOQGetI(&SD2.sd.oqueue);
u->UART_IER |= IER_THRE; u->UART_IER |= IER_THRE;
#endif #endif
} }

View File

@ -37,22 +37,6 @@
/* Driver pre-compile time settings. */ /* Driver pre-compile time settings. */
/*===========================================================================*/ /*===========================================================================*/
/**
* @brief FIFO preload parameter.
* @details Configuration parameter, this values defines how many bytes are
* preloaded in the HW transmit FIFO for each interrupt, the maximum value is
* 16 the minimum is 2, the value 0 disables the feature.
* @note An high value reduces the number of interrupts generated but can
* also increase the worst case interrupt response time because the
* preload loops.
* @note The value zero disables the feature and reverts to a simpler code
* that will generate an interrupt for each output byte but is much
* smaller and simpler.
*/
#if !defined(UART_FIFO_PRELOAD) || defined(__DOXYGEN__)
#define UART_FIFO_PRELOAD 16
#endif
/** /**
* @brief UART0 driver enable switch. * @brief UART0 driver enable switch.
* @details If set to @p TRUE the support for USART1 is included. * @details If set to @p TRUE the support for USART1 is included.
@ -71,6 +55,22 @@
#define USE_LPC214x_UART1 TRUE #define USE_LPC214x_UART1 TRUE
#endif #endif
/**
* @brief FIFO preload parameter.
* @details Configuration parameter, this values defines how many bytes are
* preloaded in the HW transmit FIFO for each interrupt, the maximum value is
* 16 the minimum is 2, the value 0 disables the feature.
* @note An high value reduces the number of interrupts generated but can
* also increase the worst case interrupt response time because the
* preload loops.
* @note The value zero disables the feature and reverts to a simpler code
* that will generate an interrupt for each output byte but is much
* smaller and simpler.
*/
#if !defined(UART_FIFO_PRELOAD) || defined(__DOXYGEN__)
#define LPC214x_UART_FIFO_PRELOAD 16
#endif
/** /**
* @brief UART1 interrupt priority level setting. * @brief UART1 interrupt priority level setting.
*/ */

View File

@ -37,13 +37,6 @@
/* Driver pre-compile time settings. */ /* Driver pre-compile time settings. */
/*===========================================================================*/ /*===========================================================================*/
/**
* @brief Enables the mutual exclusion APIs on the SPI bus.
*/
#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
#define SPI_USE_MUTUAL_EXCLUSION TRUE
#endif
/** /**
* @brief SPI1 (SSP) driver enable switch. * @brief SPI1 (SSP) driver enable switch.
* @details If set to @p TRUE the support for SPI0 is included. * @details If set to @p TRUE the support for SPI0 is included.
@ -57,10 +50,6 @@
/* Derived constants and error checks. */ /* Derived constants and error checks. */
/*===========================================================================*/ /*===========================================================================*/
#if SPI_USE_MUTUAL_EXCLUSION && !CH_USE_MUTEXES && !CH_USE_SEMAPHORES
#error "SPI_USE_MUTUAL_EXCLUSION requires CH_USE_MUTEXES and/or CH_USE_SEMAPHORES"
#endif
/*===========================================================================*/ /*===========================================================================*/
/* Driver data structures and types. */ /* Driver data structures and types. */
/*===========================================================================*/ /*===========================================================================*/

View File

@ -9,6 +9,8 @@
- FIX: Fixed section separators comments into the HAL-related files. Now all - FIX: Fixed section separators comments into the HAL-related files. Now all
the files should use the same style. the files should use the same style.
- NEW: Improved HAL configuration file. - NEW: Improved HAL configuration file.
- NEW: Introduced a new, per-project, MCU configuration file mcuconf.h that
contains all the drivers related settings.
- NEW: Readability improvements to the channels code. - NEW: Readability improvements to the channels code.
- NEW: Serial driver model improvements, added states management and checks, - NEW: Serial driver model improvements, added states management and checks,
added a new SD_NOISE_ERROR error event. added a new SD_NOISE_ERROR error event.