/*
 * DPOTCTRL.c
 *
 * Created: 2.1.2013 16:28:43
 *  Author: MichalM11x
 */ 


#define INPUT_PERM (0)
#define INPUT_TEMP (1)

#include "usbdrv.h"
#include "MD_POT.h"
#include "MD_USB.h"

extern semafors *hold;
extern digpot *pots;
static volatile unsigned int time;

ISR (TIMER2_COMP_vect)  // timer0 interrupt
{}


int main(void)
{
	sei();         //enable interrupts
	DDRB = 0x0f;
	DDRC = 0x7f; //Port C acts as output
	DDRD = 0xeb;
	//PORTD |= 0xeb;
	PORTC = 0xfe; //Pins PC0/~INT,PC1/~CS,PC2/UD are powered on 
	PORTC |= STATUS_LED;
	
	fPot_null(pots);
	
	//pots->new[0] = 5;	
	usb_init();
	wdt_enable(WDTO_1S); // if watchdog timer is not reset for 1s mu is restarted

	
	
    while(1)	
    {	
		wdt_reset(); // watchdog reset
		usbPoll();
	}
}