-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIRQ.c
60 lines (46 loc) · 2.74 KB
/
IRQ.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/******************************************************************************/
/* IRQ.C: IRQ Handler */
/******************************************************************************/
/* This file is part of the uVision/ARM development tools. */
/* Copyright (c) 2005-2006 Keil Software. All rights reserved. */
/* This software may only be used under the terms of a valid, current, */
/* end user licence from KEIL for a compatible version of KEIL software */
/* development tools. Nothing else gives you the right to use this software. */
/******************************************************************************/
#include <LPC23xx.H> /* LPC23xx definitions */
//short AD_last; /* Last converted value */
//unsigned char clock_1s; /* Flag activated each second */
///* Import function for turning LEDs on or off */
//extern void LED_On (unsigned int num);
//extern void LED_Off(unsigned int num);
///* Timer0 IRQ: Executed periodically */
//__irq void T0_IRQHandler (void) {
// static int clk_cntr;
// unsigned int n;
// unsigned int v;
// DACR = 0xFFFF8000; /* DAC Output set to Middle Point */
// clk_cntr++;
// if (clk_cntr >= 1000) {
// clk_cntr = 0;
// clock_1s = 1; /* Activate flag every 1 second */
// }
// v = (5*AD_last) >> 9; /* Scale the Value */
// for (n = 0; n < 8; n++) /* Show the Value */
// if (n < v) LED_On (n); /* Turn LED On */
// else LED_Off(n); /* Turn LED Off */
// AD0CR |= 0x01000000; /* Start A/D Conversion */
// T0IR = 1; /* Clear interrupt flag */
// VICVectAddr = 0; /* Acknowledge Interrupt */
//}
///* A/D IRQ: Executed when A/D Conversion is done */
//__irq void ADC_IRQHandler(void) {
// AD_last = (AD0DR0 >> 6) & 0x3FF; /* Read Conversion Result */
// DACR = 0xFFFF8000; /* DAC Output set to Middle Point */
// VICVectAddr = 0; /* Acknowledge Interrupt */
//}
/* Timer0 ISR */
__irq void T0_IRQHandler (void) {
PWM1TCR = 0; /* Disable PWM Timer Counters and PWM mode */
T0IR = 0xFF;
VICVectAddr = 0; /* Acknowledge interrupt */
}