-->
Page 1 of 1

i2s output

PostPosted: Sat Dec 10, 2016 8:22 pm
by craiglindley
Is it OK to call i2s_write_lr inside an interrupt service routine?

Re: i2s output

PostPosted: Sun Dec 11, 2016 5:08 am
by Barnabybear
Hi, I’m sure someone will answer your question directly but from my experience, I had lots of problems with WDT resets if I used any sort of lengthy interrupt routine. To get round this I used the interrupt routine to set a flag and exit the interrupt, this was then picked up but the main body of the sketch. I know this may not suit all applications but it works for me.
Code: Select all  attachInterrupt(0, zero_cross, FALLING);

Code: Select allvoid zero_cross() {
  zero_cross_trig = true;}

Code: Select allvoid loop() {

  while (!zero_cross_trig);
// your interrupt code here
    zero_cross_trig = false;