def test_method(self): rtc = self.config.rtc # Read periodic IRQ rate rate = rtc.irq_rate_read() self.info("Periodic IRQ rate was %ldHz."% (rate,)) self.info( "Counting 20 interrupts:") for freq in [2**i for i in xrange(1, 7)]: # powers of 2 self.info("setting %2ld Hz, counting 20 events..." % (freq,)) rtc.irq_rate_set(freq) rtc.periodic_interrupt_on() for i in range(20): rtc.read() rtc.periodic_interrupt_off() self.info(" counted 20.") return self.passed("period test ran") #XXX
def _rtc_counter(): irqcount = 0 while irqcount < 5: count, status = rtc.read() # will block irqcount += 1 self.info(" counted %d (rtc count = %d, status = %s)" % (irqcount, count, status)) return irqcount
def test_method(self): rtc = self.config.rtc # Read periodic IRQ rate rate = rtc.irq_rate_read() self.info("Periodic IRQ rate was %ldHz." % (rate, )) self.info("Counting 20 interrupts:") for freq in [2**i for i in xrange(1, 7)]: # powers of 2 self.info("setting %2ld Hz, counting 20 events..." % (freq, )) rtc.irq_rate_set(freq) rtc.periodic_interrupt_on() for i in range(20): rtc.read() rtc.periodic_interrupt_off() self.info(" counted 20.") return self.passed("period test ran") #XXX
def _rtc_counter(): irqcount = 0 while irqcount < 5: rd, wr, ex = select.select([rtc], [], [], 5) if rtc in rd: count, status = rtc.read() # will not block irqcount += 1 self.info(" counted %d (rtc count = %d, status = %s)" % (irqcount, count, status)) return irqcount
def test_method(self): rtc = self.config.rtc # Read the RTC time/date tm = rtc.time_read() self.info("Current RTC date/time is: %s" % (tm,)) tm.add_seconds(10) rtc.alarm_set(tm) # Read the current alarm settings tm = rtc.alarm_read() self.info("Alarm time now set to: %s" % (tm,)) start = now() rtc.alarm_interrupt_on() self.info("Waiting 10 seconds for alarm...") count, status = rtc.read() self.info("okay. Alarm rang.") rtc.alarm_interrupt_off() self.assert_approximately_equal(now() - start, 10, 1) return self.passed("alarm in specified time")
def test_method(self): rtc = self.config.rtc # Read the RTC time/date tm = rtc.time_read() self.info("Current RTC date/time is: %s" % (tm, )) tm.add_seconds(10) rtc.alarm_set(tm) # Read the current alarm settings tm = rtc.alarm_read() self.info("Alarm time now set to: %s" % (tm, )) start = now() rtc.alarm_interrupt_on() self.info("Waiting 10 seconds for alarm...") count, status = rtc.read() self.info("okay. Alarm rang.") rtc.alarm_interrupt_off() self.assert_approximately_equal(now() - start, 10, 1) return self.passed("alarm in specified time")