コード例 #1
0
ファイル: keypad.c プロジェクト: tmitchell/oosmos
static void NewSwitchWithContext(keypad * pKeypad, matrix * pMatrix, int Row, int Column, const char * pString)
{
  sw * pSwitch = NewSwitch(pMatrix, Row, Column);
  
  swSubscribeCloseEvent(pSwitch, &pKeypad->EventQueue, PressedEvent, (void *) pString);
  swSubscribeOpenEvent(pSwitch, &pKeypad->EventQueue, ReleasedEvent, (void *) pString);
}
コード例 #2
0
ファイル: keypad.c プロジェクト: tmitchell/oosmos
static void NewSwitchWithCodes(keypad * pKeypad, matrix * pMatrix, int Row, int Column, int PressedEventCode, int ReleasedEventCode)
{
  sw * pSwitch = NewSwitch(pMatrix, Row, Column);
  
  swSubscribeCloseEvent(pSwitch, &pKeypad->EventQueue, PressedEventCode, NULL);
  swSubscribeOpenEvent(pSwitch, &pKeypad->EventQueue, ReleasedEventCode, NULL);
}
コード例 #3
0
ファイル: switchtest.c プロジェクト: GDXN/oosmos
extern switchtest * switchtestNew(pin * pPin)
{
  oosmos_Allocate(pSwitchTest, switchtest, MAX_SWITCHTESTS, NULL);
  
  /*                                   StateName     Parent        Default     */
  /*                     ===================================================== */
  oosmos_StateMachineInit(pSwitchTest, StateMachine, NULL,         Idle_State);
    oosmos_LeafInit      (pSwitchTest, Idle_State,   StateMachine            );
  
  sw * pSwitch = swNew(pPin);
  
  swSubscribeOpenEvent(pSwitch, &pSwitchTest->EventQueue, OpenEvent, NULL);
  swSubscribeCloseEvent(pSwitch, &pSwitchTest->EventQueue, ClosedEvent, NULL);
  
  return pSwitchTest;
}