-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathisr_manager.c
64 lines (57 loc) · 2.1 KB
/
isr_manager.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
61
62
63
64
/*
* File: isr_manager.c
* Author: mrchu
*
* Created on 6 de agosto de 2023, 06:19 PM
*/
#include "main.h"
/*******************************************************************************
* Function: void ISR_Init(void)
* Description: Habilita prioridad de interrupcion y las habilita
* Precondition: None
* Parameters: None
* Return Values: None
* Remarks:
******************************************************************************/
void ISR_Initialize(void){
RCONbits.IPEN=1; //Interrupt Priority Enable bit, Enable priority level on interrupt
INTCONbits.GIEL=1;
INTCONbits.GIEH=1;
}
/*******************************************************************************
* Function: void ISR_Close(void)
* Description: Deshabilita las interrupciones
* Precondition: None
* Parameters: None
* Return Values: None
* Remarks:
******************************************************************************/
void ISR_Close(void){
INTCONbits.GIEL = 0;
INTCONbits.GIEH = 0;
}
/*******************************************************************************
* Function: void __interrupt(high_priority) INTERRUPT_HighManager(void)
* Description: Rutina de atencion para las interripciones de alta prioridad
* Precondition: None
* Parameters: None
* Return Values: None
* Remarks:
******************************************************************************/
void __interrupt(high_priority) INTERRUPT_HighManager(void){
if(INTCONbits.TMR0IE && INTCONbits.TMR0IF){
INTCONbits.TMR0IF = 0;
TMR0_OVR_FLAG = true;
WRITETIMER0(0xF830);
}
}
/*******************************************************************************
* Function: void __interrupt(low_priority) INTERRUPT_LowManager(void)
* Description: Rutina de atencion para las interripciones de baja prioridad
* Precondition: None
* Parameters: None
* Return Values: None
* Remarks:
******************************************************************************/
void __interrupt(low_priority) INTERRUPT_LowManager(void){
}