bug in the timealarm library

Viknet, why not add the method I posted above to your local copy of the library and give it a try.

If it tests out for you ok then I will add it to the next release.

Michael

edit: don't forget to add the new private data member to the header file:

uint8_t servicedAlarmId; // the alarm currently being serviced

and in the cpp file, change the serviceAlarms method so it uses this instead of the local variable i as follows:

void TimeAlarmsClass::serviceAlarms()
{
  if(! isServicing)
  {
    isServicing = true;
    for( servicedAlarmId = 0; servicedAlarmId < dtNBR_ALARMS; servicedAlarmId++)
    {
      if( Alarm[servicedAlarmId].Mode.isEnabled && (now() >= Alarm[servicedAlarmId].nextTrigger)  )
      {
        OnTick_t TickHandler = Alarm[i].onTickHandler;
        if(Alarm[servicedAlarmId].Mode.isOneShot)
          Alarm[servicedAlarmId].Mode.isEnabled = Alarm[servicedAlarmId].Mode.isAllocated = false;  // free the ID if mode is OnShot		
        else   
           Alarm[servicedAlarmId].updateNextTrigger();
        if( TickHandler != NULL) {        
          (*TickHandler)();     // call the handler  
        }
      }
    }
    isServicing = false;
  }
}