-
Notifications
You must be signed in to change notification settings - Fork 0
/
interrupts.c
61 lines (46 loc) · 1.69 KB
/
interrupts.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
/******************************************************************************/
/*Files to Include */
/******************************************************************************/
#if defined(__XC)
#include <xc.h> /* XC8 General Include File */
#elif defined(HI_TECH_C)
#include <htc.h> /* HiTech General Include File */
#endif
#include <stdint.h> /* For uint8_t definition */
#include <stdbool.h> /* For true/false definition */
#include "user.h"
/******************************************************************************/
/* Interrupt Routines */
/******************************************************************************/
/* Baseline devices don't have interrupts. Note that some PIC16's
* are baseline devices. Unfortunately the baseline detection macro is
* _PIC12 */
#ifndef _PIC12
void interrupt isr(void)
{
/* This code stub shows general interrupt handling. Note that these
conditional statements are not handled within 3 seperate if blocks.
Do not use a seperate if block for each interrupt flag to avoid run
time errors. */
if (INTF) {
send_shutter_release();
INTF = 0; // clear interrupt flag
}
#if 0
/* TODO Add interrupt routine code here. */
/* Determine which flag generated the interrupt */
if(<Interrupt Flag 1>)
{
<Interrupt Flag 1=0>; /* Clear Interrupt Flag 1 */
}
else if (<Interrupt Flag 2>)
{
<Interrupt Flag 2=0>; /* Clear Interrupt Flag 2 */
}
else
{
/* Unhandled interrupts */
}
#endif
}
#endif