Interrupts in 2.0.8

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
Post Reply
schmidmi
Posts: 55
Joined: 01 Dec 2016 16:45
Location: Germany (Karlsruhe)

Interrupts in 2.0.8

Post 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.
User avatar
PoltoS
Posts: 7565
Joined: 26 Jan 2011 19:36

Re: Interrupts in 2.0.8

Post by PoltoS »

Sure! we even have a demo sketch with all interrupts together.
perjar
Posts: 57
Joined: 08 Apr 2018 18:02

Re: Interrupts in 2.0.8

Post by perjar »

@PoltoS: Which demo sketch would that be?
mdietinger@gmail.com
Posts: 39
Joined: 12 Aug 2016 12:08

Re: Interrupts in 2.0.8

Post 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++;
}
User avatar
PoltoS
Posts: 7565
Joined: 26 Jan 2011 19:36

Re: Interrupts in 2.0.8

Post 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
Post Reply