summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
4c1beae)
+// #include "ser_at91.h"
#include <drv/ser.h>
#include <drv/ser_p.h>
#include <drv/ser.h>
#include <drv/ser_p.h>
+#define SERIRQ_PRIORITY 4 ///< default priority for serial irqs.
/**
* \name Overridable serial bus hooks
/**
* \name Overridable serial bus hooks
/* Set the vector. */ \
AIC_SVR(US0_ID) = uart0_irq_dispatcher; \
/* Initialize to edge triggered with defined priority. */ \
/* Set the vector. */ \
AIC_SVR(US0_ID) = uart0_irq_dispatcher; \
/* Initialize to edge triggered with defined priority. */ \
- AIC_SMR(US0_ID) = AIC_SRCTYPE_INT_EDGE_TRIGGERED; \
+ AIC_SMR(US0_ID) = AIC_SRCTYPE_INT_EDGE_TRIGGERED | SERIRQ_PRIORITY; \
/* Enable the USART IRQ */ \
AIC_IECR = BV(US0_ID); \
PMC_PCER = BV(US0_ID); \
/* Enable the USART IRQ */ \
AIC_IECR = BV(US0_ID); \
PMC_PCER = BV(US0_ID); \
* Invoked to send one character.
*/
#define SER_UART0_BUS_TXCHAR(c) do { \
* Invoked to send one character.
*/
#define SER_UART0_BUS_TXCHAR(c) do { \
/* Set the vector. */ \
AIC_SVR(US1_ID) = uart1_irq_dispatcher; \
/* Initialize to edge triggered with defined priority. */ \
/* Set the vector. */ \
AIC_SVR(US1_ID) = uart1_irq_dispatcher; \
/* Initialize to edge triggered with defined priority. */ \
- AIC_SMR(US1_ID) = AIC_SRCTYPE_INT_EDGE_TRIGGERED; \
+ AIC_SMR(US1_ID) = AIC_SRCTYPE_INT_EDGE_TRIGGERED | SERIRQ_PRIORITY; \
/* Enable the USART IRQ */ \
AIC_IECR = BV(US1_ID); \
PMC_PCER = BV(US1_ID); \
/* Enable the USART IRQ */ \
AIC_IECR = BV(US1_ID); \
PMC_PCER = BV(US1_ID); \
#ifndef SER_UART1_BUS_TXCHAR
/** \sa SER_UART1_BUS_TXCHAR */
#define SER_UART1_BUS_TXCHAR(c) do { \
#ifndef SER_UART1_BUS_TXCHAR
/** \sa SER_UART1_BUS_TXCHAR */
#define SER_UART1_BUS_TXCHAR(c) do { \
else
{
char c = fifo_pop(txfifo);
else
{
char c = fifo_pop(txfifo);
- kprintf("USART0 tx char: %c\n", c);
SER_UART0_BUS_TXCHAR(c);
}
SER_UART0_BUS_TXCHAR(c);
}
if (fifo_isfull(rxfifo))
ser_uart0->status |= SERRF_RXFIFOOVERRUN;
else
if (fifo_isfull(rxfifo))
ser_uart0->status |= SERRF_RXFIFOOVERRUN;
else
- {
- kprintf("USART0 recv char: %c\n", c);
IRQ_ENTRY();
if (US0_IMR & BV(US_RXRDY))
IRQ_ENTRY();
if (US0_IMR & BV(US_RXRDY))
- {
- kprintf("IRQ RX USART0\n");
if (US0_IMR & BV(US_TXRDY))
if (US0_IMR & BV(US_TXRDY))
- {
- kprintf("IRQ TX USART0\n");
else
{
char c = fifo_pop(txfifo);
else
{
char c = fifo_pop(txfifo);
- kprintf("USART1 tx char: %c\n", c);
SER_UART1_BUS_TXCHAR(c);
}
SER_UART1_BUS_TXCHAR(c);
}
if (fifo_isfull(rxfifo))
ser_uart1->status |= SERRF_RXFIFOOVERRUN;
else
if (fifo_isfull(rxfifo))
ser_uart1->status |= SERRF_RXFIFOOVERRUN;
else
- {
- kprintf("USART1 recv char: %c\n", c);
IRQ_ENTRY();
if (US1_IMR & BV(US_RXRDY))
IRQ_ENTRY();
if (US1_IMR & BV(US_RXRDY))
- {
- kprintf("IRQ RX USART1\n");
if (US1_IMR & BV(US_TXRDY))
if (US1_IMR & BV(US_TXRDY))
- {
- kprintf("IRQ TX USART1\n");