示例#1
0
status_t
ServiceView::Revert()
{
	if (IsRevertable())
		_Toggle();

	return B_OK;
}
示例#2
0
void
ServiceView::MessageReceived(BMessage* message)
{
	switch (message->what) {
		case kMsgToggleService:
			_Toggle();
			break;

		case kMsgEnableToggleButton:
			fEnableButton->SetEnabled(true);
			_UpdateEnableButton();
			break;

		default:
			BView::MessageReceived(message);
			break;
	}
}
示例#3
0
// `$INSTANCE_NAME`_UpdateBlinkingLeds - This function implements a Software PWM that toggles
// the LED every specified number of periods.  It is called by the RunStateMachine function
// which pre-scales the SysTick
inline static void `$INSTANCE_NAME`_UpdateBlinkingLeds()
{
    int row,col;
    for(row=0;row<`$INSTANCE_NAME`_NUMROWS;row++)
    {
        for(col=0;col<`$INSTANCE_NAME`_NUMCOLS;col++)
        {
            if(`$INSTANCE_NAME`_ledStates[row][col] == BLINK) // if the LED is set to blink then run the PWM
            {
                `$INSTANCE_NAME`_ledCurrentCount[row][col] -= 1;
                // if the counter = 0 then toggle the led and reset the count
                if( `$INSTANCE_NAME`_ledCurrentCount[row][col] == 0)
                {
                    `$INSTANCE_NAME`_Toggle(row,col);
                    `$INSTANCE_NAME`_ledCurrentCount[row][col] = `$INSTANCE_NAME`_ledTogglePeriods[row][col];
                }
            }
        }
    }
}