Hello all,

Some time ago I made a library for the clock IC DS3231. This library is 
part of Jallib release 1.7.0.

This IC has an I2C interface and is capable of handling two alarms. When an 
alarm is activated an interrupt is generated. 

Reading the alarm flag from the IC also uses - of course- the I2C interface 
but the I2C interface is also used by the main program. 

I thought that if I would disable all interrupts when calling the I2C 
routines from the main program and only enable it while not used by the 
main program that I could call the  same I2C routines from the interrupt 
routine and so be able to read the alarm flag from the IC to see if alarm 1 
or alarm 2 was activated. 

Unfortunately this did not work. 

I thought that when an interrupt is called some info is saved and after the 
interrupt restored but I also thought that I could then call any routine 
from the interrupt as long that I am certain that no I2C transfer was 
active (which should be since the interrupt is disabled when the main 
program is using the I2C routines).

Any ideas why this does not work? Am I missing something?

What the current sample program does is just setting a global flag in the 
interrupt routine and the main program polls this flag and then reads the 
alarm flag of the IC via I2C but this undermines a bit the use of the 
interrupt.

Thanks.

Kind regards,

Rob

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jallib+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/ff12f63c-0d1d-4897-8ca4-511869ab68c0n%40googlegroups.com.

Reply via email to