AMX Event Manager
K
A
DAK
109
void cdecl sttaskA(void) /* Task A */
{/* Wait forever for motor on */
if (ajevwat(motorgroup, MOTORON, MOTORON, 0, 0) == AEROK) {
:
Motor is on.
Process accordingly.
:
}
}
void cdecl sttaskB(void) /* Task B */
{/* Wait 5 seconds for motor */
/* on and at maximum speed */
if (ajevwat(motorgroup, MOTOREVT, MOTORON + MOTORMAX,
1, ajtmcnv(5000)) == AERTMO) {
:
Motor not on and up to speed.
Take recovery action.
:
}
else {:
Motor is on and up to speed.
Process accordingly.
:
}
}