Пример #1
0
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;
}
Пример #2
0
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;
}
Пример #3
0
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;
}
Пример #4
0
static void Predict(reg * pReg, float Value)
{
  prtFormatted("Predict value at time %.4f: %.4f\n", Value, regPredictY(pReg, Value));
}