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); }
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); }
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; }