/**************************************************************************

Switch Module

Color: P4
Overtime: P3
Full Court: P1

**************************************************************************/

/*---------------------------- Include Files ----------------------------*/
#include <stdio.h>
#include <timers12.h>
#include "PWM.h"
#include "ADS12.h"
#include "game.h"

#include "switch.h"


/*--------------------------- Module Defines ----------------------------*/
/*---------------------------- Module Types -----------------------------*/
/*-------------------------- Module Variables ---------------------------*/
/*-------------------------- Module Functions ---------------------------*/
/*----------------------------- Module Code -----------------------------*/

void InitSwitch(void) {

	DDRP &= (BIT4LO | BIT3LO | BIT1LO);
}

team_t ReturnColor(void) {

	if((PTP & BIT4HI) == BIT4HI)
		return GREEN_TEAM;
	else
		return RED_TEAM;
}

unsigned char ReturnOvertime(void) {
	if((PTP & BIT3HI) == BIT3HI)
		return 1;
	else
		return 0;
}

unsigned char ReturnCourt(void) {
	if((PTP & BIT1HI) == BIT1HI)
		return 1;
	else
		return 0;
}