Biomedical Engineering Reference
In-Depth Information
default:
State FAILURE;
break;
}
break;
case NOISE_WINDOW:
Event GetEvent();
switch( Event ) {
case TOUT:
Tout AlertTout ;
State ALERT ;
break;
case SENSE:
TimeStamp SenseTime ;
Tout Tout - Elapsed() ;
break;
default:
State FAILURE;
break;
}
break;
case FAILURE:
default:
break;
}
}
The variables for this implementation of the state machine are:
Unsigned char State: keeps the current state of the machine. In addition to the vari-
ous states of the machine, this variable can also have the value of FAILURE to ter-
minate operation of the device in case of failure.
Unsigned char Event: represents the event that occurred.
Unsigned int Tout: global variable used to tell GetEvent() of a desired timeout.
Unsigned int RefractoryTout: keeps the programmed refractory period minus 100 ms.
These 100 ms correspond to the time that the machine spends in the noise window.
Unsigned int AlertTout: keeps the programmed period minus the programmed refrac-
tory minus the programmed pacing pulse width.
Unsigned int TimeStamp: keeps the time at which a sense event is detected within the
noise window.
Unsigned int SenseTime: keeps the time at which the last ventricular event is detected.
It is used to calculate whether a sensed event that happens within the alert state should
be classi
fi
ed as normal or as noise.
Auxiliary routines used by the main routine are:
Unsigned char GetEvent(): waits for the occurrence of an event. Its return value cor-
responds to the event that happened. Please note that the microcontroller will spend
most of its time within this routine.
Void DisableSense(): prevents sense events from being reported by GetEvent(). This
function could be used in an implantable device to turn off
ff
sensing circuitry when not
needed in order to reduce power consumption.
Search WWH ::




Custom Search