Attachment 'ej_intext.c'
Download 1 ej_intext.c
2 #include <pic/p16f877a.h>
3 #define FOSC_HZ 20000000
4 #include <pinio.h>
5 #include <delayms.h>
6 #include <interrupt.h>
7 BYTE bandera=0;
8 void funcion_con_mucho_codigo(void)
9 {
10 //codigo
11 bandera=0;
12 }
13 ISR_MAIN(funcion_interrupcion_global)
14 {
15 if(int_ext_flag()==TRUE)
16 {
17 bandera=1;
18 int_ext_free_flag();
19 }
20 }
21 int main (void)
22 {
23 delayms(100);
24 enable_int_ext(L_TO_H);
25 enable_int_global();
26 set_pullup_portb(TRUE);
27 while(TRUE)
28 {
29 if(bandera==1) funcion_con_mucho_codigo();
30 }
31 disable_int_ext();
32 return 0;
33 }
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.