Esempio n. 1
0
void WaterRule::set(byte hour, byte minute, byte duration) {
  this->hour = hour;
  this->minute = minute;
  this->duration = duration;
  enabled = true;
  createAlarms();
}
Esempio n. 2
0
/*!
 * \brief Initialize the interface to an Intersil X12xx hardware clock.
 *
 * \deprecated New applications must use NutRegisterRtc().
 *
 * \return 0 on success or -1 in case of an error.
 *
 */
int X12Init(void)
{
    int rc;
    u_long tmp;

    if ((rc = TwInit(0)) == 0)
    {
        rc = X12RtcGetStatus(&tmp);
    }
    
    // loading ands setting the alarm
    createAlarms();
    //load();
    alarmBStruct first = checkFirst();
	currentAlarm = first;
    X12RtcSetAlarm(1, &first.timeSet, 31);
    
	startAlarmThread();
    return (rc);
}
Esempio n. 3
0
void WaterRule::setEnabled(byte enabled) {
  this->enabled = enabled;
  createAlarms();
}