i want to use atmel studio 6 to compile v-usb project.
i created a new project > gcc c executable project
device > atmega8a
and here is my code
Code: Select all
#define F_CPU 12000000
#include <avr/io.h>
#include "usbdrv.h"
#include <avr/interrupt.h>
#include <avr/wdt.h>
#include <util/delay.h>
#define USB_LED_OFF 0
#define USB_LED_ON 1
USB_PUBLIC uchar usbFunctionSetup(uchar data[8])
{
return 0; // should not get here
}
int main() {
DDRB = 0xff;
PORTB = 0xff;
uchar i;
wdt_enable(WDTO_1S); // enable 1s watchdog timer
usbInit();
usbDeviceDisconnect(); // enforce re-enumeration
for(i = 0; i<250; i++)
{ // wait 500 ms
wdt_reset(); // keep the watchdog happy
_delay_ms(2);
}
usbDeviceConnect();
sei(); // Enable interrupts after re-enumeration
while(1)
{
wdt_reset(); // keep the watchdog happy
usbPoll();
}
return 0;
}
when i compile > error :
undefined reference `usbinit();'
undefined reference `usbpoll();'
undefined reference `usbInputBufOffset'
and ....
what is the problem?