예제 #1
0
void
Button(void)
{
	ButtonState up, down;

	Rte_Call_ButtonStateIn_GetButtonState(&up, &down);

	if (up == TRUE) {
		Rte_Write_ActionRequestOut_up(TRUE);
	}
	else {
		Rte_Write_ActionRequestOut_up(FALSE);
	}

	if (down == TRUE) {
		Rte_Write_ActionRequestOut_down(TRUE);
	}
	else {
		Rte_Write_ActionRequestOut_down(FALSE);
	}
}
예제 #2
0
void
Button(void)
{
	ButtonState up, down;
	LockState	state;
	LockState	lock;

	lock = FALSE;

	Rte_Call_se4_CheckpointReached();

	Rte_Call_LockStateIn_GetLockState(&state);
	/* ロックされている場合,LEDを付けて何もせずに終了 */
	if (state == TRUE) {
		Rte_Call_LedStateOut_SetLedState(TRUE);
		lock = TRUE;
	}
	else {
		Rte_Call_se1_CheckpointReached();
		Rte_Call_LedStateOut_SetLedState(FALSE);
	}

	Rte_Call_LockStateIn_GetLockState2(&state);
	/* ロックされている場合,LEDを付けて何もせずに終了 */
	if (state == TRUE) {
		Rte_Call_LedStateOut_SetLedState2(TRUE);
		lock = TRUE;
	}
	else {
		Rte_Call_se3_CheckpointReached();
		Rte_Call_se2_CheckpointReached();
		Rte_Call_LedStateOut_SetLedState2(FALSE);
	}

	Rte_Call_LockStateIn_GetLockState3(&state);
	/* ロックされている場合,LEDを付けて何もせずに終了 */
	if (state == TRUE) {
		Rte_Call_LedStateOut_SetLedState3(TRUE);
		lock = TRUE;
	}
	else {
		Rte_Call_se5_CheckpointReached();
		Rte_Call_LedStateOut_SetLedState3(FALSE);
	}

	if (lock == FALSE) {
		Rte_Call_ButtonStateIn_GetButtonState(&up, &down);

		if (up == TRUE) {
			Rte_Write_ActionRequestOut_up(TRUE);
		}
		else {
			Rte_Write_ActionRequestOut_up(FALSE);
		}

		if (down == TRUE) {
			Rte_Write_ActionRequestOut_down(TRUE);
		}
		else {
			Rte_Write_ActionRequestOut_down(FALSE);
		}
	}

	Rte_Call_se6_CheckpointReached();
	return;
}