-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIRQ.c
43 lines (39 loc) · 1.48 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
/******************************************************************************/
/* IRQ.C: IRQ Handlers */
/******************************************************************************/
/* This file is part of the uVision/ARM development tools. */
/* Copyright (c) 2005-2009 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. */
/******************************************************************************/
unsigned long ticks = 0;
unsigned char ClockLEDOn; /* On for 30 ms every 50 ms */
unsigned char ClockLEDOff; /* On for 20 ms every 50 ms */
unsigned char ClockANI; /* Clock for Animation 150 ms */
void SysTick_Handler (void) { /* SysTick Interrupt Handler (10ms) */
ticks++;
switch (ticks) {
case 3:
ClockLEDOff = 1;
break;
case 5:
ClockLEDOn = 1;
break;
case 8:
ClockLEDOff = 1;
break;
case 10:
ClockLEDOn = 1;
break;
case 13:
ClockLEDOff = 1;
break;
case 15:
ticks = 0;
ClockANI = 1;
ClockLEDOn = 1;
default:
break;
}
}