X-Git-Url: http://git.linex4red.de/pub/lufa.git/blobdiff_plain/bbcdaaa6dc6024911a280e5fda6b4a43f71fb98e..cfe054474ffafddcbba0f6d3f46d3f02473fac96:/Projects/AVRISP/AVRISP.c?ds=inline diff --git a/Projects/AVRISP/AVRISP.c b/Projects/AVRISP/AVRISP.c index 0491102b4..f14b6545a 100644 --- a/Projects/AVRISP/AVRISP.c +++ b/Projects/AVRISP/AVRISP.c @@ -34,6 +34,10 @@ * the project and is responsible for the initial application hardware configuration. */ +// TODO: Add in software SPI for lower programming speeds below 125KHz +// TODO: Add in VTARGET detection +// TODO: Add reversed target connector checks + #include "AVRISP.h" /** Main program entry point. This routine contains the overall program flow, including initial @@ -42,8 +46,8 @@ int main(void) { SetupHardware(); - - printf("AVRISP-MKII Clone\r\n"); + + V2Params_LoadEEPROMParamValues(); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); @@ -66,9 +70,13 @@ void SetupHardware(void) clock_prescale_set(clock_div_1); /* Hardware Initialization */ - SerialStream_Init(9600, false); LEDs_Init(); USB_Init(); + + /* Millisecond timer initialization for timeout checking */ + OCR0A = ((F_CPU / 64) / 1000); + TCCR0A = (1 << WGM01); + TCCR0B = ((1 << CS01) | (1 << CS00)); } /** Event handler for the library USB Connection event. */ @@ -98,11 +106,7 @@ void EVENT_USB_Device_ConfigurationChanged(void) } } -void EVENT_USB_Device_UnhandledControlRequest(void) -{ - printf("CONTROL REQUEST\r\n"); -} - +/** Processes incomming V2 Protocol commands from the host, returning a response when required. */ void Process_AVRISP_Commands(void) { /* Device must be connected and configured for the task to run */