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

This commit is contained in:
gdisirio 2010-01-06 12:55:12 +00:00
parent bc489e39a8
commit 7e4202ae46
9 changed files with 81 additions and 78 deletions

View File

@ -10,9 +10,8 @@ members of the LPC2000 family should be an easy task.
** The Demo **
The demo blinks the leds on the board by using multiple threads. By pressing
the buttons on the board it is possible to activate the buzzer and send a
message over the serial ports. Pressing both buttons activates the test
procedure on the serial port 1.
the buttons on the board it is possible to send a message over the serial
port or activate the test procedure.
See main.c for details. Buzzer.c contains an interesting device driver
example that uses a physical timer for the waveform generation and a virtual
timer for the sound duration.

View File

@ -5,7 +5,7 @@ Settings: CCLK=48, MAMCR=2, MAMTIM=3 (3 wait states)
*** ChibiOS/RT test suite
***
*** Kernel: 1.3.7unstable
*** Kernel: 1.3.8unstable
*** Architecture: ARM7TDMI
*** GCC Version: 4.4.2
@ -89,51 +89,51 @@ Settings: CCLK=48, MAMCR=2, MAMTIM=3 (3 wait states)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.1 (Benchmark, messages #1)
--- Score : 144491 msgs/S, 288982 ctxswc/S
--- Score : 144506 msgs/S, 289012 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.2 (Benchmark, messages #2)
--- Score : 114693 msgs/S, 229386 ctxswc/S
--- Score : 114706 msgs/S, 229412 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.3 (Benchmark, messages #3)
--- Score : 114693 msgs/S, 229386 ctxswc/S
--- Score : 114706 msgs/S, 229412 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.4 (Benchmark, context switch)
--- Score : 501456 ctxswc/S
--- Score : 501520 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.5 (Benchmark, threads, full cycle)
--- Score : 107717 threads/S
--- Score : 107731 threads/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.6 (Benchmark, threads, create only)
--- Score : 150398 threads/S
--- Score : 150417 threads/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.7 (Benchmark, mass reschedulation, 5 threads)
--- Score : 36509 reschedulations/S, 219054 ctxswc/S
--- Score : 36514 reschedulations/S, 219084 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.8 (Benchmark, round robin context switching)
--- Score : 340980 reschedulations/S, 340980 ctxswc/S
--- Score : 341020 reschedulations/S, 341020 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.9 (Benchmark, I/O Queues throughput)
--- Score : 357264 bytes/S
--- Score : 357308 bytes/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.10 (Benchmark, virtual timers set/reset)
--- Score : 333324 timers/S
--- Score : 333360 timers/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.11 (Benchmark, semaphores wait/signal)
--- Score : 623180 wait+signal/S
--- Score : 623248 wait+signal/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.12 (Benchmark, mutexes lock/unlock)
--- Score : 380356 lock+unlock/S
--- Score : 380408 lock+unlock/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.13 (Benchmark, RAM footprint)

View File

@ -5,7 +5,7 @@ Settings: MCLK=XT2CLK 8MHz
*** ChibiOS/RT test suite
***
*** Kernel: 1.3.7unstable
*** Kernel: 1.3.8unstable
*** Architecture: MSP430
*** GCC Version: 3.2.3
@ -89,51 +89,51 @@ Settings: MCLK=XT2CLK 8MHz
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.1 (Benchmark, messages #1)
--- Score : 20944 msgs/S, 41888 ctxswc/S
--- Score : 20963 msgs/S, 41926 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.2 (Benchmark, messages #2)
--- Score : 17347 msgs/S, 34694 ctxswc/S
--- Score : 17363 msgs/S, 34726 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.3 (Benchmark, messages #3)
--- Score : 17347 msgs/S, 34694 ctxswc/S
--- Score : 17363 msgs/S, 34726 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.4 (Benchmark, context switch)
--- Score : 64224 ctxswc/S
--- Score : 64288 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.5 (Benchmark, threads, full cycle)
--- Score : 14272 threads/S
--- Score : 14288 threads/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.6 (Benchmark, threads, create only)
--- Score : 18383 threads/S
--- Score : 18404 threads/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.7 (Benchmark, mass reschedulation, 5 threads)
--- Score : 5347 reschedulations/S, 32082 ctxswc/S
--- Score : 5350 reschedulations/S, 32100 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.8 (Benchmark, round robin context switching)
--- Score : 46308 reschedulations/S, 46308 ctxswc/S
--- Score : 46372 reschedulations/S, 46372 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.9 (Benchmark, I/O Queues throughput)
--- Score : 54320 bytes/S
--- Score : 54380 bytes/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.10 (Benchmark, virtual timers set/reset)
--- Score : 60896 timers/S
--- Score : 60970 timers/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.11 (Benchmark, semaphores wait/signal)
--- Score : 150520 wait+signal/S
--- Score : 150700 wait+signal/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.12 (Benchmark, mutexes lock/unlock)
--- Score : 83980 lock+unlock/S
--- Score : 84076 lock+unlock/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.13 (Benchmark, RAM footprint)

View File

@ -152,7 +152,6 @@ static void serve_interrupt(SerialDriver *sdp) {
break;
case IIR_SRC_TX:
{
#if LPC214x_UART_FIFO_PRELOAD > 0
int i = LPC214x_UART_FIFO_PRELOAD;
do {
msg_t b;
@ -169,15 +168,6 @@ static void serve_interrupt(SerialDriver *sdp) {
}
u->UART_THR = b;
} while (--i);
#else
chSysLockFromIsr();
msg_t b = sdRequestDataI(sdp);
chSysUnlockFromIsr();
if (b < Q_OK)
u->UART_IER &= ~IER_THRE;
else
u->UART_THR = b;
#endif
}
break;
default:
@ -187,20 +177,18 @@ static void serve_interrupt(SerialDriver *sdp) {
}
}
#if LPC214x_UART_FIFO_PRELOAD > 0
/**
* @brief Attempts a TX FIFO preload.
*/
static void preload(SerialDriver *sdp) {
UART *u = sdp->sd.uart;
if (u->UART_LSR & LSR_THRE) {
int i = LPC214x_UART_FIFO_PRELOAD;
do {
chSysLockFromIsr();
msg_t b = chOQGetI(&sdp->sd.oqueue);
chSysUnlockFromIsr();
if (b < Q_OK) {
chSysLockFromIsr();
chEvtBroadcastI(&sdp->bac.oevent);
chSysUnlockFromIsr();
return;
}
u->UART_THR = b;
@ -208,38 +196,25 @@ static void preload(SerialDriver *sdp) {
}
u->UART_IER |= IER_THRE;
}
#endif
/**
* @brief Driver SD1 output notification.
*/
#if USE_LPC214x_UART0 || defined(__DOXYGEN__)
static void notify1(void) {
#if LPC214x_UART_FIFO_PRELOAD > 0
preload(&SD1);
#else
UART *u = U0Base;
if (u->UART_LSR & LSR_THRE) {
chSysLockFromIsr();
u->UART_THR = chOQGetI(&SD1.sd.oqueue);
chSysUnlockFromIsr();
}
u->UART_IER |= IER_THRE;
#endif
}
#endif
/**
* @brief Driver SD2 output notification.
*/
#if USE_LPC214x_UART1 || defined(__DOXYGEN__)
static void notify2(void) {
#if LPC214x_UART_FIFO_PRELOAD > 0
preload(&SD2);
#else
UART *u = U1Base;
if (u->UART_LSR & LSR_THRE)
u->UART_THR = chOQGetI(&SD2.sd.oqueue);
u->UART_IER |= IER_THRE;
#endif
}
#endif
@ -247,6 +222,9 @@ static void notify2(void) {
/* Driver interrupt handlers. */
/*===========================================================================*/
/**
* @brief UART0 IRQ handler.
*/
#if USE_LPC214x_UART0 || defined(__DOXYGEN__)
CH_IRQ_HANDLER(UART0IrqHandler) {
@ -259,6 +237,10 @@ CH_IRQ_HANDLER(UART0IrqHandler) {
}
#endif
/**
* @brief UART1 IRQ handler.
*/
#if USE_LPC214x_UART1 || defined(__DOXYGEN__)
CH_IRQ_HANDLER(UART1IrqHandler) {

View File

@ -59,13 +59,10 @@
* @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.
* 16 the minimum is 1.
* @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
@ -89,6 +86,10 @@
/* Derived constants and error checks. */
/*===========================================================================*/
#if (LPC214x_UART_FIFO_PRELOAD < 1) || (LPC214x_UART_FIFO_PRELOAD > 16)
#error "invalid LPC214x_UART_FIFO_PRELOAD setting"
#endif
/*===========================================================================*/
/* Driver data structures and types. */
/*===========================================================================*/

View File

@ -47,9 +47,12 @@ BaseChannel CD1;
static size_t writes(void *ip, const uint8_t *bp, size_t n) {
size_t ret;
(void)ip;
return fwrite(bp, 1, n, stdout);
ret = fwrite(bp, 1, n, stdout);
fflush(stdout);
return ret;
}
static size_t reads(void *ip, uint8_t *bp, size_t n) {
@ -87,10 +90,13 @@ static msg_t gett(void *ip, systime_t time) {
}
static size_t writet(void *ip, const uint8_t *bp, size_t n, systime_t time) {
size_t ret;
(void)ip;
(void)time;
return fwrite(bp, 1, n, stdout);
ret = fwrite(bp, 1, n, stdout);
fflush(stdout);
return ret;
}
static size_t readt(void *ip, uint8_t *bp, size_t n, systime_t time) {

View File

@ -79,10 +79,11 @@ static void set_error(SerialDriver *sdp, uint8_t urctl) {
static void notify1(void) {
if (!(U0IE & UTXIE0)) {
chSysLockFromIsr();
U0TXBUF = (uint8_t)sdRequestDataI(&SD1);
chSysUnlockFromIsr();
U0IE |= UTXIE0;
msg_t b = sdRequestDataI(&SD1);
if (b != Q_EMPTY) {
U0IE |= UTXIE0;
U0TXBUF = (uint8_t)b;
}
}
}
@ -122,8 +123,11 @@ static void usart0_deinit(void) {
static void notify2(void) {
if (!(U1IE & UTXIE1)) {
U1TXBUF = (uint8_t)sdRequestDataI(&SD2);
U1IE |= UTXIE1;
msg_t b = sdRequestDataI(&SD2);
if (b != Q_EMPTY) {
U1IE |= UTXIE1;
U1TXBUF = (uint8_t)b;
}
}
}

View File

@ -47,9 +47,12 @@ BaseChannel CD1;
static size_t writes(void *ip, const uint8_t *bp, size_t n) {
size_t ret;
(void)ip;
return fwrite(bp, 1, n, stdout);
ret = fwrite(bp, 1, n, stdout);
fflush(stdout);
return ret;
}
static size_t reads(void *ip, uint8_t *bp, size_t n) {
@ -87,10 +90,13 @@ static msg_t gett(void *ip, systime_t time) {
}
static size_t writet(void *ip, const uint8_t *bp, size_t n, systime_t time) {
size_t ret;
(void)ip;
(void)time;
return fwrite(bp, 1, n, stdout);
ret = fwrite(bp, 1, n, stdout);
fflush(stdout);
return ret;
}
static size_t readt(void *ip, uint8_t *bp, size_t n, systime_t time) {

View File

@ -3,6 +3,8 @@
*****************************************************************************
*** 1.3.8 ***
- FIX: Fixed spurious character generation in MSP430 serial driver (bug
2926838).
- NEW: Introduced an abstract streams interface BaseSequentialStream.
- NEW: Added timeout specification to the I/O queues read/write primitives.
- CHANGE: Modified the BaseChannel interface in order to make it a
@ -15,6 +17,9 @@
replicated by specifying TIME_IMMEDIATE as timeout. Another difference is
that specifying zero as bytes number is like specifying the largest size_t
plus one, zero was an illegal value before.
- CHANGE: Simplified the LPC214x driver by removing the option to not use the
FIFO preload feature. Setting LPC214x_UART_FIFO_PRELOAD to 1 results in
the same behavior.
- Documentation fixes and improvements, testing strategy explained.
*** 1.3.7 ***