mirror of https://github.com/rusefi/ChibiOS.git
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@612 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
b7eba42be8
commit
e2b6b440e1
|
@ -83,7 +83,7 @@ ASRC = ../../ports/ARM7-AT91SAM7X/chcore.c \
|
|||
TSRC =
|
||||
|
||||
# List ASM source files here
|
||||
ASMSRC = ../../ports/ARM7/crt0.s ../../ports/ARM7/chsys.s \
|
||||
ASMSRC = ../../ports/ARM7/crt0.s ../../ports/ARM7/chsysasm.s \
|
||||
../../ports/ARM7-AT91SAM7X/vectors.s
|
||||
|
||||
# List all user directories here
|
||||
|
|
|
@ -83,7 +83,7 @@ TSRC = ../../ports/ARM7-AT91SAM7X/chcore.c \
|
|||
board.c main.c
|
||||
|
||||
# List ASM source files here
|
||||
ASMSRC = ../../ports/ARM7/crt0.s ../../ports/ARM7/chsys.s \
|
||||
ASMSRC = ../../ports/ARM7/crt0.s ../../ports/ARM7/chsysasm.s \
|
||||
../../ports/ARM7-AT91SAM7X/vectors.s
|
||||
|
||||
# List all user directories here
|
||||
|
|
|
@ -26,31 +26,31 @@
|
|||
|
||||
extern void FiqHandler(void);
|
||||
|
||||
__attribute__((naked))
|
||||
static void SpuriousHandler(void) {
|
||||
CH_IRQ_HANDLER static void SpuriousHandler(void) {
|
||||
|
||||
chSysIRQEnterI();
|
||||
CH_IRQ_PROLOGUE();
|
||||
|
||||
AT91C_BASE_AIC->AIC_EOICR = 0;
|
||||
|
||||
chSysIRQExitI();
|
||||
CH_IRQ_EPILOGUE();
|
||||
}
|
||||
|
||||
/*
|
||||
* SYS IRQ handling here.
|
||||
*/
|
||||
__attribute__((naked))
|
||||
static void SYSIrqHandler(void) {
|
||||
CH_IRQ_HANDLER static void SYSIrqHandler(void) {
|
||||
|
||||
chSysIRQEnterI();
|
||||
CH_IRQ_PROLOGUE();
|
||||
|
||||
if (AT91C_BASE_PITC->PITC_PISR & AT91C_PITC_PITS) {
|
||||
(void) AT91C_BASE_PITC->PITC_PIVR;
|
||||
chSysLockI();
|
||||
chSysTimerHandlerI();
|
||||
chSysUnlockI();
|
||||
}
|
||||
AT91C_BASE_AIC->AIC_EOICR = 0; \
|
||||
|
||||
chSysIRQExitI();
|
||||
CH_IRQ_EPILOGUE();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -30,6 +30,15 @@
|
|||
* that this is not related to the compiler optimization options.*/
|
||||
#define CH_OPTIMIZE_SPEED
|
||||
|
||||
/** Configuration option: If enabled then the used of nested @p chSysLock() /
|
||||
* @p chSysUnlock() operations is allowed.<br>
|
||||
* For performance and code size reasons the recommended setting is leave
|
||||
* this option disabled.<br>
|
||||
* You can use this option if you need to merge ChibiOS/RT with external
|
||||
* libraries that require nested lock/unlock operations.
|
||||
*/
|
||||
//#define CH_USE_NESTED_LOCKS
|
||||
|
||||
/** Configuration option: if specified then the kernel performs the round
|
||||
* robin scheduling algorithm on threads of equal priority. */
|
||||
#define CH_USE_ROUNDROBIN
|
||||
|
|
|
@ -95,7 +95,7 @@ ASRC = ../../ports/ARM7-AT91SAM7X/chcore.c \
|
|||
TSRC =
|
||||
|
||||
# List ASM source files here
|
||||
ASMSRC = ../../ports/ARM7/crt0.s ../../ports/ARM7/chsys.s \
|
||||
ASMSRC = ../../ports/ARM7/crt0.s ../../ports/ARM7/chsysasm.s \
|
||||
../../ports/ARM7-AT91SAM7X/vectors.s
|
||||
|
||||
# List all user directories here
|
||||
|
|
|
@ -96,7 +96,7 @@ TSRC = ../../ports/ARM7-AT91SAM7X/chcore.c \
|
|||
board.c main.c
|
||||
|
||||
# List ASM source files here
|
||||
ASMSRC = ../../ports/ARM7/crt0.s ../../ports/ARM7/chsys.s \
|
||||
ASMSRC = ../../ports/ARM7/crt0.s ../../ports/ARM7/chsysasm.s \
|
||||
../../ports/ARM7-AT91SAM7X/vectors.s
|
||||
|
||||
# List all user directories here
|
||||
|
|
|
@ -27,31 +27,31 @@
|
|||
|
||||
extern void FiqHandler(void);
|
||||
|
||||
__attribute__((naked))
|
||||
static void SpuriousHandler(void) {
|
||||
CH_IRQ_HANDLER static void SpuriousHandler(void) {
|
||||
|
||||
chSysIRQEnterI();
|
||||
CH_IRQ_PROLOGUE();
|
||||
|
||||
AT91C_BASE_AIC->AIC_EOICR = 0;
|
||||
|
||||
chSysIRQExitI();
|
||||
CH_IRQ_EPILOGUE();
|
||||
}
|
||||
|
||||
/*
|
||||
* SYS IRQ handling here.
|
||||
*/
|
||||
__attribute__((naked))
|
||||
static void SYSIrqHandler(void) {
|
||||
CH_IRQ_HANDLER static void SYSIrqHandler(void) {
|
||||
|
||||
chSysIRQEnterI();
|
||||
CH_IRQ_PROLOGUE();
|
||||
|
||||
if (AT91C_BASE_PITC->PITC_PISR & AT91C_PITC_PITS) {
|
||||
(void) AT91C_BASE_PITC->PITC_PIVR;
|
||||
chSysLockI();
|
||||
chSysTimerHandlerI();
|
||||
chSysUnlockI();
|
||||
}
|
||||
AT91C_BASE_AIC->AIC_EOICR = 0; \
|
||||
|
||||
chSysIRQExitI();
|
||||
CH_IRQ_EPILOGUE();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -30,6 +30,15 @@
|
|||
* that this is not related to the compiler optimization options.*/
|
||||
#define CH_OPTIMIZE_SPEED
|
||||
|
||||
/** Configuration option: If enabled then the used of nested @p chSysLock() /
|
||||
* @p chSysUnlock() operations is allowed.<br>
|
||||
* For performance and code size reasons the recommended setting is leave
|
||||
* this option disabled.<br>
|
||||
* You can use this option if you need to merge ChibiOS/RT with external
|
||||
* libraries that require nested lock/unlock operations.
|
||||
*/
|
||||
//#define CH_USE_NESTED_LOCKS
|
||||
|
||||
/** Configuration option: if specified then the kernel performs the round
|
||||
* robin scheduling algorithm on threads of equal priority. */
|
||||
#define CH_USE_ROUNDROBIN
|
||||
|
|
|
@ -93,7 +93,7 @@ TCSRC =
|
|||
TCPPSRC =
|
||||
|
||||
# List ASM source files here
|
||||
ASMSRC = ../../ports/ARM7/crt0.s ../../ports/ARM7/chsys.s \
|
||||
ASMSRC = ../../ports/ARM7/crt0.s ../../ports/ARM7/chsysasm.s \
|
||||
../../ports/ARM7-LPC214x/vectors.s
|
||||
|
||||
# List all user directories here
|
||||
|
|
|
@ -93,7 +93,7 @@ TCSRC = ../../ports/ARM7-LPC214x/chcore.c \
|
|||
TCPPSRC = ../../src/lib/ch.cpp main.cpp
|
||||
|
||||
# List ASM source files here
|
||||
ASMSRC = ../../ports/ARM7/crt0.s ../../ports/ARM7/chsys.s \
|
||||
ASMSRC = ../../ports/ARM7/crt0.s ../../ports/ARM7/chsysasm.s \
|
||||
../../ports/ARM7-LPC214x/vectors.s
|
||||
|
||||
# List all user directories here
|
||||
|
|
|
@ -31,30 +31,28 @@
|
|||
/*
|
||||
* Non-vectored IRQs handling here.
|
||||
*/
|
||||
__attribute__((naked))
|
||||
static void IrqHandler(void) {
|
||||
CH_IRQ_HANDLER static void IrqHandler(void) {
|
||||
|
||||
chSysIRQEnterI();
|
||||
CH_IRQ_PROLOGUE();
|
||||
|
||||
/* nothing */
|
||||
VICVectAddr = 0;
|
||||
|
||||
chSysIRQExitI();
|
||||
CH_IRQ_EPILOGUE();
|
||||
}
|
||||
|
||||
/*
|
||||
* Timer 0 IRQ handling here.
|
||||
*/
|
||||
__attribute__((naked))
|
||||
static void T0IrqHandler(void) {
|
||||
CH_IRQ_HANDLER static void T0IrqHandler(void) {
|
||||
|
||||
chSysIRQEnterI();
|
||||
CH_IRQ_PROLOGUE();
|
||||
|
||||
T0IR = 1; /* Clear interrupt on match MR0. */
|
||||
chSysTimerHandlerI();
|
||||
VICVectAddr = 0;
|
||||
|
||||
chSysIRQExitI();
|
||||
CH_IRQ_EPILOGUE();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -30,6 +30,15 @@
|
|||
* that this is not related to the compiler optimization options.*/
|
||||
#define CH_OPTIMIZE_SPEED
|
||||
|
||||
/** Configuration option: If enabled then the used of nested @p chSysLock() /
|
||||
* @p chSysUnlock() operations is allowed.<br>
|
||||
* For performance and code size reasons the recommended setting is leave
|
||||
* this option disabled.<br>
|
||||
* You can use this option if you need to merge ChibiOS/RT with external
|
||||
* libraries that require nested lock/unlock operations.
|
||||
*/
|
||||
//#define CH_USE_NESTED_LOCKS
|
||||
|
||||
/** Configuration option: if specified then the kernel performs the round
|
||||
* robin scheduling algorithm on threads of equal priority. */
|
||||
#define CH_USE_ROUNDROBIN
|
||||
|
|
|
@ -80,7 +80,7 @@ ASRC = ../../ports/ARM7-LPC214x/chcore.c \
|
|||
TSRC =
|
||||
|
||||
# List ASM source files here
|
||||
ASMSRC = ../../ports/ARM7/crt0.s ../../ports/ARM7/chsys.s \
|
||||
ASMSRC = ../../ports/ARM7/crt0.s ../../ports/ARM7/chsysasm.s \
|
||||
../../ports/ARM7-LPC214x/vectors.s
|
||||
|
||||
# List all user directories here
|
||||
|
|
|
@ -80,7 +80,7 @@ TSRC = ../../ports/ARM7-LPC214x/chcore.c \
|
|||
board.c main.c
|
||||
|
||||
# List ASM source files here
|
||||
ASMSRC = ../../ports/ARM7/crt0.s ../../ports/ARM7/chsys.s \
|
||||
ASMSRC = ../../ports/ARM7/crt0.s ../../ports/ARM7/chsysasm.s \
|
||||
../../ports/ARM7-LPC214x/vectors.s
|
||||
|
||||
# List all user directories here
|
||||
|
|
|
@ -31,30 +31,28 @@
|
|||
/*
|
||||
* Non-vectored IRQs handling here.
|
||||
*/
|
||||
__attribute__((naked))
|
||||
static void IrqHandler(void) {
|
||||
CH_IRQ_HANDLER static void IrqHandler(void) {
|
||||
|
||||
chSysIRQEnterI();
|
||||
CH_IRQ_PROLOGUE();
|
||||
|
||||
/* nothing */
|
||||
VICVectAddr = 0;
|
||||
|
||||
chSysIRQExitI();
|
||||
CH_IRQ_EPILOGUE();
|
||||
}
|
||||
|
||||
/*
|
||||
* Timer 0 IRQ handling here.
|
||||
*/
|
||||
__attribute__((naked))
|
||||
static void T0IrqHandler(void) {
|
||||
CH_IRQ_HANDLER static void T0IrqHandler(void) {
|
||||
|
||||
chSysIRQEnterI();
|
||||
CH_IRQ_PROLOGUE();
|
||||
|
||||
T0IR = 1; /* Clear interrupt on match MR0. */
|
||||
chSysTimerHandlerI();
|
||||
VICVectAddr = 0;
|
||||
|
||||
chSysIRQExitI();
|
||||
CH_IRQ_EPILOGUE();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -30,6 +30,15 @@
|
|||
* that this is not related to the compiler optimization options.*/
|
||||
//#define CH_OPTIMIZE_SPEED
|
||||
|
||||
/** Configuration option: If enabled then the used of nested @p chSysLock() /
|
||||
* @p chSysUnlock() operations is allowed.<br>
|
||||
* For performance and code size reasons the recommended setting is leave
|
||||
* this option disabled.<br>
|
||||
* You can use this option if you need to merge ChibiOS/RT with external
|
||||
* libraries that require nested lock/unlock operations.
|
||||
*/
|
||||
//#define CH_USE_NESTED_LOCKS
|
||||
|
||||
/** Configuration option: if specified then the kernel performs the round
|
||||
* robin scheduling algorithm on threads of equal priority. */
|
||||
#define CH_USE_ROUNDROBIN
|
||||
|
|
|
@ -84,7 +84,7 @@ TSRC = ../../ports/ARM7-LPC214x/chcore.c \
|
|||
board.c buzzer.c mmcsd.c main.c
|
||||
|
||||
# List ASM source files here
|
||||
ASMSRC = ../../ports/ARM7/crt0.s ../../ports/ARM7/chsys.s \
|
||||
ASMSRC = ../../ports/ARM7/crt0.s ../../ports/ARM7/chsysasm.s \
|
||||
../../ports/ARM7-LPC214x/vectors.s
|
||||
|
||||
# List all user directories here
|
||||
|
|
|
@ -31,30 +31,28 @@
|
|||
/*
|
||||
* Non-vectored IRQs handling here.
|
||||
*/
|
||||
__attribute__((naked))
|
||||
static void IrqHandler(void) {
|
||||
CH_IRQ_HANDLER static void IrqHandler(void) {
|
||||
|
||||
chSysIRQEnterI();
|
||||
CH_IRQ_PROLOGUE();
|
||||
|
||||
/* nothing */
|
||||
VICVectAddr = 0;
|
||||
|
||||
chSysIRQExitI();
|
||||
CH_IRQ_EPILOGUE();
|
||||
}
|
||||
|
||||
/*
|
||||
* Timer 0 IRQ handling here.
|
||||
*/
|
||||
__attribute__((naked))
|
||||
static void T0IrqHandler(void) {
|
||||
CH_IRQ_HANDLER static void T0IrqHandler(void) {
|
||||
|
||||
chSysIRQEnterI();
|
||||
CH_IRQ_PROLOGUE();
|
||||
|
||||
T0IR = 1; /* Clear interrupt on match MR0. */
|
||||
chSysTimerHandlerI();
|
||||
VICVectAddr = 0;
|
||||
|
||||
chSysIRQExitI();
|
||||
CH_IRQ_EPILOGUE();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -30,6 +30,15 @@
|
|||
* that this is not related to the compiler optimization options.*/
|
||||
#define CH_OPTIMIZE_SPEED
|
||||
|
||||
/** Configuration option: If enabled then the used of nested @p chSysLock() /
|
||||
* @p chSysUnlock() operations is allowed.<br>
|
||||
* For performance and code size reasons the recommended setting is leave
|
||||
* this option disabled.<br>
|
||||
* You can use this option if you need to merge ChibiOS/RT with external
|
||||
* libraries that require nested lock/unlock operations.
|
||||
*/
|
||||
//#define CH_USE_NESTED_LOCKS
|
||||
|
||||
/** Configuration option: if specified then the kernel performs the round
|
||||
* robin scheduling algorithm on threads of equal priority. */
|
||||
#define CH_USE_ROUNDROBIN
|
||||
|
|
|
@ -22,15 +22,15 @@
|
|||
#include "board.h"
|
||||
#include "avr_serial.h"
|
||||
|
||||
SYS_IRQ_HANDLER(TIMER0_COMP_vect) {
|
||||
CH_IRQ_HANDLER(TIMER0_COMP_vect) {
|
||||
|
||||
SYS_IRQ_PROLOGUE();
|
||||
CH_IRQ_PROLOGUE();
|
||||
|
||||
chSysLockI();
|
||||
chSysTimerHandlerI();
|
||||
chSysUnlockI();
|
||||
|
||||
SYS_IRQ_EPILOGUE();
|
||||
CH_IRQ_EPILOGUE();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -22,15 +22,15 @@
|
|||
#include "board.h"
|
||||
#include "avr_serial.h"
|
||||
|
||||
SYS_IRQ_HANDLER(TIMER0_COMP_vect) {
|
||||
CH_IRQ_HANDLER(TIMER0_COMP_vect) {
|
||||
|
||||
SYS_IRQ_PROLOGUE();
|
||||
CH_IRQ_PROLOGUE();
|
||||
|
||||
chSysLockI();
|
||||
chSysTimerHandlerI();
|
||||
chSysUnlockI();
|
||||
|
||||
SYS_IRQ_EPILOGUE();
|
||||
CH_IRQ_EPILOGUE();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -30,6 +30,15 @@
|
|||
* that this is not related to the compiler optimization options.*/
|
||||
#define CH_OPTIMIZE_SPEED
|
||||
|
||||
/** Configuration option: If enabled then the used of nested @p chSysLock() /
|
||||
* @p chSysUnlock() operations is allowed.<br>
|
||||
* For performance and code size reasons the recommended setting is leave
|
||||
* this option disabled.<br>
|
||||
* You can use this option if you need to merge ChibiOS/RT with external
|
||||
* libraries that require nested lock/unlock operations.
|
||||
*/
|
||||
//#define CH_USE_NESTED_LOCKS
|
||||
|
||||
/** Configuration option: if specified then the kernel performs the round
|
||||
* robin scheduling algorithm on threads of equal priority. */
|
||||
#define CH_USE_ROUNDROBIN
|
||||
|
|
|
@ -85,13 +85,13 @@ void hwinit(void) {
|
|||
InitSerial();
|
||||
}
|
||||
|
||||
SYS_IRQ_HANDLER(TIMERA0_VECTOR) tmr0irq(void) {
|
||||
CH_IRQ_HANDLER(TIMERA0_VECTOR) tmr0irq(void) {
|
||||
|
||||
SYS_IRQ_PROLOGUE();
|
||||
CH_IRQ_PROLOGUE();
|
||||
|
||||
chSysLockI();
|
||||
chSysTimerHandlerI();
|
||||
chSysUnlockI();
|
||||
|
||||
SYS_IRQ_EPILOGUE();
|
||||
CH_IRQ_EPILOGUE();
|
||||
}
|
||||
|
|
|
@ -35,6 +35,15 @@
|
|||
* that this is not related to the compiler optimization options.*/
|
||||
#define CH_OPTIMIZE_SPEED
|
||||
|
||||
/** Configuration option: If enabled then the used of nested @p chSysLock() /
|
||||
* @p chSysUnlock() operations is allowed.<br>
|
||||
* For performance and code size reasons the recommended setting is leave
|
||||
* this option disabled.<br>
|
||||
* You can use this option if you need to merge ChibiOS/RT with external
|
||||
* libraries that require nested lock/unlock operations.
|
||||
*/
|
||||
//#define CH_USE_NESTED_LOCKS
|
||||
|
||||
/** Configuration option: if specified then the kernel performs the round
|
||||
* robin scheduling algorithm on threads of equal priority. */
|
||||
#define CH_USE_ROUNDROBIN
|
||||
|
|
|
@ -30,6 +30,15 @@
|
|||
* that this is not related to the compiler optimization options.*/
|
||||
#define CH_OPTIMIZE_SPEED
|
||||
|
||||
/** Configuration option: If enabled then the used of nested @p chSysLock() /
|
||||
* @p chSysUnlock() operations is allowed.<br>
|
||||
* For performance and code size reasons the recommended setting is leave
|
||||
* this option disabled.<br>
|
||||
* You can use this option if you need to merge ChibiOS/RT with external
|
||||
* libraries that require nested lock/unlock operations.
|
||||
*/
|
||||
//#define CH_USE_NESTED_LOCKS
|
||||
|
||||
/** Configuration option: if specified then the kernel performs the round
|
||||
* robin scheduling algorithm on threads of equal priority. */
|
||||
#define CH_USE_ROUNDROBIN
|
||||
|
|
|
@ -126,9 +126,11 @@ static void ServeInterrupt(void) {
|
|||
|
||||
CH_IRQ_HANDLER void EMACIrqHandler(void) {
|
||||
|
||||
chSysIRQEnterI();
|
||||
CH_IRQ_PROLOGUE();
|
||||
|
||||
ServeInterrupt();
|
||||
chSysIRQExitI();
|
||||
|
||||
CH_IRQ_EPILOGUE();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -76,16 +76,20 @@ static void ServeInterrupt(AT91PS_USART u, FullDuplexDriver *com) {
|
|||
|
||||
CH_IRQ_HANDLER void USART0IrqHandler(void) {
|
||||
|
||||
chSysIRQEnterI();
|
||||
CH_IRQ_PROLOGUE();
|
||||
|
||||
ServeInterrupt(AT91C_BASE_US0, &COM1);
|
||||
chSysIRQExitI();
|
||||
|
||||
CH_IRQ_EPILOGUE();
|
||||
}
|
||||
|
||||
CH_IRQ_HANDLER void USART1IrqHandler(void) {
|
||||
|
||||
chSysIRQEnterI();
|
||||
CH_IRQ_PROLOGUE();
|
||||
|
||||
ServeInterrupt(AT91C_BASE_US1, &COM2);
|
||||
chSysIRQExitI();
|
||||
|
||||
CH_IRQ_EPILOGUE();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -111,18 +111,22 @@ static void ServeInterrupt(UART *u, FullDuplexDriver *com) {
|
|||
|
||||
CH_IRQ_HANDLER void UART0IrqHandler(void) {
|
||||
|
||||
chSysIRQEnterI();
|
||||
CH_IRQ_PROLOGUE();
|
||||
|
||||
ServeInterrupt(U0Base, &COM1);
|
||||
VICVectAddr = 0;
|
||||
chSysIRQExitI();
|
||||
|
||||
CH_IRQ_EPILOGUE();
|
||||
}
|
||||
|
||||
CH_IRQ_HANDLER void UART1IrqHandler(void) {
|
||||
|
||||
chSysIRQEnterI();
|
||||
CH_IRQ_PROLOGUE();
|
||||
|
||||
ServeInterrupt(U1Base, &COM2);
|
||||
VICVectAddr = 0;
|
||||
chSysIRQExitI();
|
||||
|
||||
CH_IRQ_EPILOGUE();
|
||||
}
|
||||
|
||||
#ifdef FIFO_PRELOAD
|
||||
|
|
|
@ -85,11 +85,13 @@ static void ServeInterrupt(USART_TypeDef *u, FullDuplexDriver *com) {
|
|||
/*
|
||||
* USART1 IRQ service routine.
|
||||
*/
|
||||
SYS_IRQ_HANDLER void VectorD4(void) {
|
||||
CH_IRQ_HANDLER void VectorD4(void) {
|
||||
|
||||
CH_IRQ_PROLOGUE();
|
||||
|
||||
chSysIRQEnterI();
|
||||
ServeInterrupt(USART1, &COM1);
|
||||
chSysIRQExitI();
|
||||
|
||||
CH_IRQ_EPILOGUE();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -106,11 +108,13 @@ static void OutNotify1(void) {
|
|||
/*
|
||||
* USART2 IRQ service routine.
|
||||
*/
|
||||
SYS_IRQ_HANDLER void VectorD8(void) {
|
||||
CH_IRQ_HANDLER void VectorD8(void) {
|
||||
|
||||
CH_IRQ_PROLOGUE();
|
||||
|
||||
chSysIRQEnterI();
|
||||
ServeInterrupt(USART2, &COM2);
|
||||
chSysIRQExitI();
|
||||
|
||||
CH_IRQ_EPILOGUE();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -127,11 +131,13 @@ static void OutNotify2(void) {
|
|||
/*
|
||||
* USART3 IRQ service routine.
|
||||
*/
|
||||
SYS_IRQ_HANDLER void VectorDC(void) {
|
||||
CH_IRQ_HANDLER void VectorDC(void) {
|
||||
|
||||
CH_IRQ_PROLOGUE();
|
||||
|
||||
chSysIRQEnterI();
|
||||
ServeInterrupt(USART3, &COM3);
|
||||
chSysIRQExitI();
|
||||
|
||||
CH_IRQ_EPILOGUE();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -65,13 +65,15 @@ void threadstart(void) {
|
|||
* This interrupt is used as system tick.
|
||||
* @note The timer is initialized in the board setup code.
|
||||
*/
|
||||
SYS_IRQ_HANDLER void SysTickVector(void) {
|
||||
CH_IRQ_HANDLER void SysTickVector(void) {
|
||||
|
||||
CH_IRQ_PROLOGUE();
|
||||
|
||||
chSysIRQEnterI();
|
||||
chSysLockI();
|
||||
chSysTimerHandlerI();
|
||||
chSysUnlockI();
|
||||
chSysIRQExitI();
|
||||
|
||||
CH_IRQ_EPILOGUE();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -40,10 +40,10 @@ FullDuplexDriver SER1;
|
|||
static uint8_t ib1[SERIAL_BUFFERS_SIZE];
|
||||
static uint8_t ob1[SERIAL_BUFFERS_SIZE];
|
||||
|
||||
SYS_IRQ_HANDLER(USART0_RX_vect) {
|
||||
CH_IRQ_HANDLER(USART0_RX_vect) {
|
||||
uint8_t sra;
|
||||
|
||||
SYS_IRQ_PROLOGUE();
|
||||
CH_IRQ_PROLOGUE();
|
||||
|
||||
sra = UCSR0A;
|
||||
if (sra & ((1 << DOR) | (1 << UPE) | (1 << FE)))
|
||||
|
@ -52,13 +52,13 @@ SYS_IRQ_HANDLER(USART0_RX_vect) {
|
|||
chFDDIncomingDataI(&SER1, UDR0);
|
||||
chSysUnlockI();
|
||||
|
||||
SYS_IRQ_EPILOGUE();
|
||||
CH_IRQ_EPILOGUE();
|
||||
}
|
||||
|
||||
SYS_IRQ_HANDLER(USART0_UDRE_vect) {
|
||||
CH_IRQ_HANDLER(USART0_UDRE_vect) {
|
||||
msg_t b;
|
||||
|
||||
SYS_IRQ_PROLOGUE();
|
||||
CH_IRQ_PROLOGUE();
|
||||
|
||||
chSysLockI();
|
||||
b = chFDDRequestDataI(&SER1);
|
||||
|
@ -68,7 +68,7 @@ SYS_IRQ_HANDLER(USART0_UDRE_vect) {
|
|||
else
|
||||
UDR0 = b;
|
||||
|
||||
SYS_IRQ_EPILOGUE();
|
||||
CH_IRQ_EPILOGUE();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -99,10 +99,10 @@ FullDuplexDriver SER2;
|
|||
static uint8_t ib2[SERIAL_BUFFERS_SIZE];
|
||||
static uint8_t ob2[SERIAL_BUFFERS_SIZE];
|
||||
|
||||
SYS_IRQ_HANDLER(USART1_RX_vect) {
|
||||
CH_IRQ_HANDLER(USART1_RX_vect) {
|
||||
uint8_t sra;
|
||||
|
||||
SYS_IRQ_PROLOGUE();
|
||||
CH_IRQ_PROLOGUE();
|
||||
|
||||
sra = UCSR1A;
|
||||
if (sra & ((1 << DOR) | (1 << UPE) | (1 << FE)))
|
||||
|
@ -111,13 +111,13 @@ SYS_IRQ_HANDLER(USART1_RX_vect) {
|
|||
chFDDIncomingDataI(&SER2, UDR1);
|
||||
chSysUnlockI();
|
||||
|
||||
SYS_IRQ_EPILOGUE();
|
||||
CH_IRQ_EPILOGUE();
|
||||
}
|
||||
|
||||
SYS_IRQ_HANDLER(USART1_UDRE_vect) {
|
||||
CH_IRQ_HANDLER(USART1_UDRE_vect) {
|
||||
msg_t b;
|
||||
|
||||
SYS_IRQ_PROLOGUE();
|
||||
CH_IRQ_PROLOGUE();
|
||||
|
||||
chSysLockI();
|
||||
b = chFDDRequestDataI(&SER2);
|
||||
|
@ -127,7 +127,7 @@ SYS_IRQ_HANDLER(USART1_UDRE_vect) {
|
|||
else
|
||||
UDR1 = b;
|
||||
|
||||
SYS_IRQ_EPILOGUE();
|
||||
CH_IRQ_EPILOGUE();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -208,10 +208,18 @@ asm ("" : : : "r18", "r19", "r20", "r21", "r22", "r23", "r24", \
|
|||
*/
|
||||
#define sys_enable_from_isr()
|
||||
|
||||
#if ENABLE_WFI_IDLE != 0
|
||||
/**
|
||||
* Disables all the interrupt sources, even those having a priority higher
|
||||
* to the kernel.
|
||||
* In this port it is no different than sys_disable() because the simple
|
||||
* interrupt handling
|
||||
*/
|
||||
#define sys_disable_all() sys_disable()
|
||||
|
||||
/**
|
||||
* This port function is implemented as inlined code for performance reasons.
|
||||
*/
|
||||
#if ENABLE_WFI_IDLE != 0
|
||||
#define sys_wait_for_interrupt() { \
|
||||
asm volatile ("sleep"); \
|
||||
}
|
||||
|
|
|
@ -176,10 +176,18 @@ if (chSchRescRequiredI()) \
|
|||
*/
|
||||
#define sys_enable_from_isr()
|
||||
|
||||
#if ENABLE_WFI_IDLE != 0
|
||||
/**
|
||||
* Disables all the interrupt sources, even those having a priority higher
|
||||
* to the kernel.
|
||||
* In this port it is no different than sys_disable() because the simple
|
||||
* interrupt handling
|
||||
*/
|
||||
#define sys_disable_all() sys_disable()
|
||||
|
||||
/**
|
||||
* This port function is implemented as inlined code for performance reasons.
|
||||
*/
|
||||
#if ENABLE_WFI_IDLE != 0
|
||||
#define sys_wait_for_interrupt() { \
|
||||
asm volatile ("wfi"); \
|
||||
}
|
||||
|
|
|
@ -44,10 +44,10 @@ FullDuplexDriver COM1;
|
|||
static uint8_t ib1[SERIAL_BUFFERS_SIZE];
|
||||
static uint8_t ob1[SERIAL_BUFFERS_SIZE];
|
||||
|
||||
SYS_IRQ_HANDLER(USART0TX_VECTOR) u0txirq(void) {
|
||||
CH_IRQ_HANDLER(USART0TX_VECTOR) u0txirq(void) {
|
||||
msg_t b;
|
||||
|
||||
SYS_IRQ_PROLOGUE();
|
||||
CH_IRQ_PROLOGUE();
|
||||
|
||||
chSysLockI();
|
||||
b = chFDDRequestDataI(&COM1);
|
||||
|
@ -57,13 +57,13 @@ SYS_IRQ_HANDLER(USART0TX_VECTOR) u0txirq(void) {
|
|||
else
|
||||
U0TXBUF = b;
|
||||
|
||||
SYS_IRQ_EPILOGUE();
|
||||
CH_IRQ_EPILOGUE();
|
||||
}
|
||||
|
||||
SYS_IRQ_HANDLER(USART0RX_VECTOR) u0rxirq(void) {
|
||||
CH_IRQ_HANDLER(USART0RX_VECTOR) u0rxirq(void) {
|
||||
uint8_t urctl;
|
||||
|
||||
SYS_IRQ_PROLOGUE();
|
||||
CH_IRQ_PROLOGUE();
|
||||
|
||||
if ((urctl = U0RCTL) & RXERR)
|
||||
SetError(urctl, &COM1);
|
||||
|
@ -71,7 +71,7 @@ SYS_IRQ_HANDLER(USART0RX_VECTOR) u0rxirq(void) {
|
|||
chFDDIncomingDataI(&COM1, U0RXBUF);
|
||||
chSysUnlockI();
|
||||
|
||||
SYS_IRQ_EPILOGUE();
|
||||
CH_IRQ_EPILOGUE();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -116,10 +116,10 @@ FullDuplexDriver COM2;
|
|||
static uint8_t ib2[SERIAL_BUFFERS_SIZE];
|
||||
static uint8_t ob2[SERIAL_BUFFERS_SIZE];
|
||||
|
||||
SYS_IRQ_HANDLER(USART1TX_VECTOR) u1txirq(void) {
|
||||
CH_IRQ_HANDLER(USART1TX_VECTOR) u1txirq(void) {
|
||||
msg_t b;
|
||||
|
||||
SYS_IRQ_PROLOGUE();
|
||||
CH_IRQ_PROLOGUE();
|
||||
|
||||
chSysLockI();
|
||||
b = chFDDRequestDataI(&COM2);
|
||||
|
@ -129,13 +129,13 @@ SYS_IRQ_HANDLER(USART1TX_VECTOR) u1txirq(void) {
|
|||
else
|
||||
U1TXBUF = b;
|
||||
|
||||
SYS_IRQ_EPILOGUE();
|
||||
CH_IRQ_EPILOGUE();
|
||||
}
|
||||
|
||||
SYS_IRQ_HANDLER(USART1RX_VECTOR) u1rxirq(void) {
|
||||
CH_IRQ_HANDLER(USART1RX_VECTOR) u1rxirq(void) {
|
||||
uint8_t urctl;
|
||||
|
||||
SYS_IRQ_PROLOGUE();
|
||||
CH_IRQ_PROLOGUE();
|
||||
|
||||
if ((urctl = U1RCTL) & RXERR)
|
||||
SetError(urctl, &COM2);
|
||||
|
@ -143,10 +143,9 @@ SYS_IRQ_HANDLER(USART1RX_VECTOR) u1rxirq(void) {
|
|||
chFDDIncomingDataI(&COM2, U1RXBUF);
|
||||
chSysUnlockI();
|
||||
|
||||
SYS_IRQ_EPILOGUE();
|
||||
CH_IRQ_EPILOGUE();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Invoked by the high driver when one or more bytes are inserted in the
|
||||
* output queue.
|
||||
|
|
|
@ -120,7 +120,9 @@ void chSysLock(void) {
|
|||
*/
|
||||
void chSysUnlock(void) {
|
||||
|
||||
#ifdef CH_USE_NESTED_LOCKS
|
||||
chDbgAssert(currp->p_locks > 0, "chinit.c, chSysUnlock()");
|
||||
#endif
|
||||
chSysUnlockInline();
|
||||
}
|
||||
#endif /* !CH_OPTIMIZE_SPEED */
|
||||
|
|
|
@ -148,7 +148,7 @@
|
|||
* @note Usually IRQ handlers functions are also declared naked.
|
||||
* @note On some architectures this macro can be empty.
|
||||
*/
|
||||
#define chSysIRQEnterI() SYS_IRQ_PROLOGUE()
|
||||
#define CH_IRQ_PROLOGUE() SYS_IRQ_PROLOGUE()
|
||||
|
||||
/**
|
||||
* IRQ handler exit code.
|
||||
|
@ -156,7 +156,7 @@
|
|||
* @note This macro usually performs the final reschedulation by using
|
||||
* \p chSchRescRequiredI() and \p chSchDoRescheduleI().
|
||||
*/
|
||||
#define chSysIRQExitI() SYS_IRQ_EPILOGUE()
|
||||
#define CH_IRQ_EPILOGUE() SYS_IRQ_EPILOGUE()
|
||||
|
||||
/**
|
||||
* Standard modifier for IRQ handler functions.
|
||||
|
|
Loading…
Reference in New Issue