qpcpp/doxygen/snippets/qep_qtran.cpp

21 lines
484 B
C++
Raw Normal View History

// state handler function for the Blinky HSM ..................................
Q_STATE_DEF(Blinky, off) {
QState status;
2012-08-14 18:00:48 -04:00
switch (e->sig) {
case Q_ENTRY_SIG: {
BSP_ledOff();
status = Q_RET_HANDLED;
break;
2012-08-14 18:00:48 -04:00
}
case TIMEOUT_SIG: {
status = tran(&on); // <--- transition
break;
}
default: {
status = super(&top);
break;
2012-08-14 18:00:48 -04:00
}
}
return status;
2012-08-14 18:00:48 -04:00
}