git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@198 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
f87e32d85c
commit
05c3be1b2c
|
@ -40,8 +40,8 @@ static void SYSIrqHandler(void) {
|
||||||
chSysIRQEnterI();
|
chSysIRQEnterI();
|
||||||
|
|
||||||
if (AT91C_BASE_PITC->PITC_PISR & AT91C_PITC_PITS) {
|
if (AT91C_BASE_PITC->PITC_PISR & AT91C_PITC_PITS) {
|
||||||
chSysTimerHandlerI();
|
|
||||||
(void) AT91C_BASE_PITC->PITC_PIVR;
|
(void) AT91C_BASE_PITC->PITC_PIVR;
|
||||||
|
chSysTimerHandlerI();
|
||||||
}
|
}
|
||||||
|
|
||||||
chSysIRQExitI();
|
chSysIRQExitI();
|
||||||
|
|
|
@ -9,6 +9,8 @@ The demo runs on an Olimex SAM7-EX256 board.
|
||||||
** The Demo **
|
** The Demo **
|
||||||
|
|
||||||
The demo currently just flashes the LCD background using a thread.
|
The demo currently just flashes the LCD background using a thread.
|
||||||
|
The button SW1 prints an "Hello World!" string on COM1, the button SW2
|
||||||
|
activates che ChibiOS/RT test suite, output on COM1.
|
||||||
|
|
||||||
** Build Procedure **
|
** Build Procedure **
|
||||||
|
|
||||||
|
|
|
@ -24,12 +24,12 @@
|
||||||
#include "at91lib/aic.h"
|
#include "at91lib/aic.h"
|
||||||
|
|
||||||
FullDuplexDriver COM1;
|
FullDuplexDriver COM1;
|
||||||
BYTE8 ib1[SERIAL_BUFFERS_SIZE];
|
static BYTE8 ib1[SERIAL_BUFFERS_SIZE];
|
||||||
BYTE8 ob1[SERIAL_BUFFERS_SIZE];
|
static BYTE8 ob1[SERIAL_BUFFERS_SIZE];
|
||||||
|
|
||||||
FullDuplexDriver COM2;
|
FullDuplexDriver COM2;
|
||||||
BYTE8 ib2[SERIAL_BUFFERS_SIZE];
|
static BYTE8 ib2[SERIAL_BUFFERS_SIZE];
|
||||||
BYTE8 ob2[SERIAL_BUFFERS_SIZE];
|
static BYTE8 ob2[SERIAL_BUFFERS_SIZE];
|
||||||
|
|
||||||
static void SetError(AT91_REG csr, FullDuplexDriver *com) {
|
static void SetError(AT91_REG csr, FullDuplexDriver *com) {
|
||||||
UWORD16 sts = 0;
|
UWORD16 sts = 0;
|
||||||
|
@ -46,29 +46,24 @@ static void SetError(AT91_REG csr, FullDuplexDriver *com) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Tries hard to clear all the pending interrupt sources, we dont want to
|
* Serves the pending sources on the USART.
|
||||||
* go through the whole ISR and have another interrupt soon after.
|
|
||||||
*/
|
*/
|
||||||
static void ServeInterrupt(AT91PS_USART u, FullDuplexDriver *com) {
|
static void ServeInterrupt(AT91PS_USART u, FullDuplexDriver *com) {
|
||||||
|
|
||||||
while (u->US_CSR & u->US_IMR) {
|
if (u->US_CSR & AT91C_US_RXRDY)
|
||||||
|
|
||||||
if (u->US_CSR & AT91C_US_RXRDY) {
|
|
||||||
chFDDIncomingDataI(com, u->US_RHR);
|
chFDDIncomingDataI(com, u->US_RHR);
|
||||||
}
|
if (u->US_CSR & AT91C_US_TXRDY) {
|
||||||
else if (u->US_CSR & AT91C_US_TXRDY) {
|
|
||||||
t_msg b = chFDDRequestDataI(com);
|
t_msg b = chFDDRequestDataI(com);
|
||||||
if (b < Q_OK)
|
if (b < Q_OK)
|
||||||
u->US_IDR = AT91C_US_TXRDY;
|
u->US_IDR = AT91C_US_TXRDY;
|
||||||
else
|
else
|
||||||
u->US_THR = b;
|
u->US_THR = b;
|
||||||
}
|
}
|
||||||
else {
|
if (u->US_CSR & (AT91C_US_OVRE | AT91C_US_FRAME | AT91C_US_PARE | AT91C_US_RXBRK)) {
|
||||||
SetError(u->US_CSR, com);
|
SetError(u->US_CSR, com);
|
||||||
u->US_CR = AT91C_US_RSTSTA;
|
u->US_CR = AT91C_US_RSTSTA;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
__attribute__((naked, weak))
|
__attribute__((naked, weak))
|
||||||
void USART0IrqHandler(void) {
|
void USART0IrqHandler(void) {
|
||||||
|
|
|
@ -46,7 +46,7 @@ AVR-AT90CANx-GCC - Port on AVR AT90CAN128, not complete yet.
|
||||||
SAM7S and SAM7XC but no tests were performed. Other SAM7 processors should
|
SAM7S and SAM7XC but no tests were performed. Other SAM7 processors should
|
||||||
also be useable with limited changes.
|
also be useable with limited changes.
|
||||||
The demo currently just performs basic operations, will be enhanced in next
|
The demo currently just performs basic operations, will be enhanced in next
|
||||||
ChibiOS/RT releases.
|
ChibiOS/RT releases, see the demo readme.txt file.
|
||||||
The kernel is *unchanged* compared to version 0.5.3, just the new port and
|
The kernel is *unchanged* compared to version 0.5.3, just the new port and
|
||||||
the new demo were added.
|
the new demo were added.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue