- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
#define RETURN 100
void interrupt[INT0_vect] INT0_interrupt(void)
{
char i,temp;
/*Filter it to makes sure it was not only noise*/
for (temp= 0;temp< 5;) //Five samples noise filter
{
if(!(PIND & (1<<PD2)))
temp++;
else
temp = RETURN;
}
if(temp != RETURN)
{
/*Place your zero cross action here*/
...
}
}
3_dar 10.08.2016 19:26 # +14
Что это?
bormand 10.08.2016 19:28 # +16
inkanus-gray 10.08.2016 19:47 # +13
Из Watcom C:
The __interrupt keyword may be used with function definitions for functions that handle computer interrupts. All registers are saved before the function begins execution and restored prior to returning from the interrupt. The machine language return instruction for the function is changed to iret (interrupt return). Functions written using __interrupt are suitable for attaching to the interrupt vector using the library function _dos_setvect. Open Watcom C16 and C32 provide the predefined macros interrupt and _interrupt for convenience and compatibility with the Microsoft C compiler. They may be used in place of __interrupt.
Надо покопаться. Может быть, и в других компиляторах есть похожая директива.
guesto 10.08.2016 22:13 # +13
у борланда была тоже такая кейворда
inkanus-gray 11.08.2016 09:54 # +15
guesto 10.08.2016 22:13 # +10
inkanus-gray 11.08.2016 09:53 # +13
kurwa 11.08.2016 10:33 # +13
dxd 11.08.2016 11:00 # +13
dm_fomenok 10.08.2016 19:58 # +11
kegdan 11.08.2016 12:04 # +15
fajes_rown 10.08.2016 21:26 # +19
LispGovno 10.08.2016 21:42 # +11
__declspec(naked)
и
иногда
__asm
bormand 11.08.2016 06:34 # +14
> __asm
amd64
pedarok 10.08.2016 22:03 # +11