A #IN_START // If the Command Bit is OFF, force the
JC TIMI // time accumulator to the Preset value
CLR // and exit with boolean status = OFF.
SAVE
L #IN_PRESET
T #IN_OUT_ACCUM
BEU
TIMI: L #IN_OUT_ACCUM // Decrease the time accumulator by the
L "TIM_FY_OB1_RTC_ms" // milliseconds since last OB1 call
-I
T #IN_OUT_ACCUM // If the accumulated count is <=0,
L 0 // then the boolean status is set ON
<=I // and the accumulator is forced to
= L 0.0 // ZERO to prevent further negative
JCN OUTP // accumulation that could result in
T #IN_OUT_ACCUM // rollover of the 16-bit accumulator
OUTP: A L 0.0 // and consequent wrong timer output.
SAVE