static bool Idle_State_Code(void * pObject, oosmos_sRegion * pRegion, const oosmos_sEvent * pEvent) { switchtest * pSwitchTest = (switchtest *) pObject; switch (pEvent->Code) { case OpenEvent: return prtFormatted("Switch %p opened\n", pSwitchTest); case ClosedEvent: return prtFormatted("Switch %p closed\n", pSwitchTest); } return false; }
static bool Idle_State_Code(void * pObject, oosmos_sRegion * pRegion, const oosmos_sEvent * pEvent) { switch (pEvent->Code) { case PressedEvent: { const char * pString = (const char *) pEvent->pContext; return prtFormatted("Pressed %s\n", pString); } case ReleasedEvent: { const char * pString = (const char *) pEvent->pContext; return prtFormatted("Released %s\n", pString); } case FourPressedEvent: return prtFormatted("Pressed Four\n"); case FourReleasedEvent: return prtFormatted("Released Four\n"); } return false; }
static bool Idle_State_Code(void * pObject, oosmos_sRegion * pRegion, const oosmos_sEvent * pEvent) { encodertest * pExample = (encodertest *) pObject; switch (pEvent->Code) { case ChangeEvent: { prtFormatted("Encoder %p %d\n", pExample, encoderGetCount(pExample->m_pEncoder)); return true; } } return false; }
static void Predict(reg * pReg, float Value) { prtFormatted("Predict value at time %.4f: %.4f\n", Value, regPredictY(pReg, Value)); }