Page 1 of 1
Interrupts in 2.0.8
Posted: 03 Mar 2017 16:20
by schmidmi
I've got a question:
Is it allowed, to use GPT and external interrupts within the same sketch?
I've got the feeling that there are serious impacts between these interrupt sources.
Re: Interrupts in 2.0.8
Posted: 03 Mar 2017 18:29
by PoltoS
Sure! we even have a demo sketch with all interrupts together.
Re: Interrupts in 2.0.8
Posted: 24 Apr 2018 13:52
by perjar
@PoltoS: Which demo sketch would that be?
Re: Interrupts in 2.0.8
Posted: 24 Apr 2018 14:02
by mdietinger@gmail.com
I am using GPT and two interupts as well with my weather station project.
Is running stable for some months now.
Only important thing is to have only limited code within the interupt routines.
In my case I only have a counter within the routine.
If you don't follow that advice the application might crash from time to time.
Code: Select all
void int0_handler() // PIN17-wind sensor interupt
{
wind_pulses++;
}
void int1_handler() // PIN18-rain sensor interupt
{
rain_pulses++;
}
void gpt_handler() // 2" Timer
{
GPT_2sec++;
}
Re: Interrupts in 2.0.8
Posted: 26 Apr 2018 22:52
by PoltoS
@mdietinger Absolutelly correct comment! We suggest to use minimum of code in setters and getters and even less in interrupts. Those are generic recomendations for all interrupt handles