Hi Seb,

On 2011/04/06 15:28, Sebastien Lelong wrote:

Currently, in ISR, I read time and
check if equals to alarm time. If so, alarm is active:

--
rtc_init()
rtc_calibrate(0)

-- let's say we're April 23rd 2011, it's 10:56:12 o'clock.
-- Alarm is set at 10:56:17
var  byte*3  datenow = 0x230411
var  byte*3  timenow = 0x125610
var  byte*3  alarmtime = 0x175610

rtc_set_yymmdd_bcd(datenow)
rtc_set_hhmmss_bcd(timenow)
rtc_set_alarm_hhmmss_bcd(alarmtime)

rtc_set_alarm(true)
rtc_set_alarm_period(RTC_ALARM_PERIOD_SECOND)
rtc_set_alarm_repeat(10)

-- isr

var bit alarm_is_ringing = false
procedure school_is_over() is
    pragma interrupt
    if ! PIR3_RTCCIF then
       return
    end if
    if !alarm_is_ringing then
       timenow   = rtc_get_hhmmss_bcd()
       if timenow == alarmtime then
          alarm_is_ringing = true
       end if
    end if
    if alarm_is_ringing != 10 then

Gives a warning! alarm_is_ringing is a bit variable!

       if ALRMRPT then

What is ALRMRPT, and where is it set with which value???

          onboard_led = !onboard_led
       end if
    end if
    PIR3_RTCCIF = false -- clear flag
end procedure


You better had attached a (subset of) your complete program.

Regards, Rob.


--
R. Hamerling, Netherlands --- http://www.robh.nl

--
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en.

Reply via email to