diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2008-02-19 15:34:41 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2008-02-19 15:34:41 +0000 |
commit | dcd80dadf36c91ac337030eea3e2d7bbf7a7d0f5 (patch) | |
tree | 1921a64b5747c0139b37debb9eea50b0a298e0f8 /demos/ARM7-AT91SAM7X-GCC/board.c | |
parent | 53b6f6d8df525c3f71d230c6ed2be39c64c871a5 (diff) | |
download | ChibiOS-dcd80dadf36c91ac337030eea3e2d7bbf7a7d0f5.tar.gz ChibiOS-dcd80dadf36c91ac337030eea3e2d7bbf7a7d0f5.tar.bz2 ChibiOS-dcd80dadf36c91ac337030eea3e2d7bbf7a7d0f5.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@194 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos/ARM7-AT91SAM7X-GCC/board.c')
-rw-r--r-- | demos/ARM7-AT91SAM7X-GCC/board.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/demos/ARM7-AT91SAM7X-GCC/board.c b/demos/ARM7-AT91SAM7X-GCC/board.c index fac56f18d..aef835ffa 100644 --- a/demos/ARM7-AT91SAM7X-GCC/board.c +++ b/demos/ARM7-AT91SAM7X-GCC/board.c @@ -31,7 +31,7 @@ static void SpuriousHandler(void) { }
/*
- * Timer 0 IRQ handling here.
+ * SYS IRQ handling here.
*/
__attribute__((naked))
static void SYSIrqHandler(void) {
@@ -39,6 +39,7 @@ static void SYSIrqHandler(void) { chSysIRQEnterI();
if (AT91C_BASE_PITC->PITC_PISR & AT91C_PITC_PITS) {
+// AT91C_BASE_PIOB->PIO_SODR = PIOB_LCD_BL; // LCD on.
chSysTimerHandlerI();
(void) AT91C_BASE_PITC->PITC_PIVR;
}
@@ -46,6 +47,9 @@ static void SYSIrqHandler(void) { chSysIRQExitI();
}
+/*
+ * Board initialization code.
+ */
void hwinit(void) {
int i;
@@ -104,7 +108,7 @@ void hwinit(void) { /*
* LCD pins setup.
*/
- AT91C_BASE_PIOB->PIO_SODR = PIOB_LCD_BL; // Set to high.
+ AT91C_BASE_PIOB->PIO_CODR = PIOB_LCD_BL; // Set to low.
AT91C_BASE_PIOB->PIO_OER = PIOB_LCD_BL; // Configure as output.
AT91C_BASE_SYS->PIOA_PPUDR = PIOB_LCD_BL; // Disable internal pullup resistor.
@@ -126,7 +130,10 @@ void hwinit(void) { /*
* PIT Initialization.
*/
- AIC_ConfigureIT(AT91C_ID_SYS, AT91C_AIC_SRCTYPE_POSITIVE_EDGE, SYSIrqHandler);
+ AIC_ConfigureIT(AT91C_ID_SYS,
+ AT91C_AIC_SRCTYPE_POSITIVE_EDGE | (AT91C_AIC_PRIOR_HIGHEST -1),
+ SYSIrqHandler);
+ AIC_EnableIT(AT91C_ID_SYS);
AT91C_BASE_PITC->PITC_PIMR = (MCK / 16 / CH_FREQUENCY) - 1;
AT91C_BASE_PITC->PITC_PIMR |= AT91C_PITC_PITEN | AT91C_PITC_PITIEN;
}
|