Code: Select all
static void eepromWrite(unsigned char addr, unsigned char val)
{
while(EECR & (1 << EEPE));
EEARL = addr;
EEDR = val;
cli();
EECR |= 1 << EEMPE;
EECR |= 1 << EEPE; /* must follow within a couple of cycles -- therefore cli() */
sei();
}
static uchar eepromRead(uchar addr)
{
while(EECR & (1 << EEPE));
EEARL = addr;
EECR |= 1 << EERE;
return EEDR;
}
the settings in usbconfig.h seemed to be ok, nothing needed to be modified. however, two lines also needed to be commented out in order to compile, as it couldn't find their definition (usbdrv.c):
Code: Select all
GET_DESCRIPTOR(USB_CFG_DESCR_PROPS_HID, usbDescriptorConfiguration + 18)
GET_DESCRIPTOR(USB_CFG_DESCR_PROPS_HID_REPORT, usbDescriptorHidReport)
the assembly source file i'm using is usbdrvasm.S.
anyway for some reason, having done all that, it just says 'device malfunctioned, or cannot be recognised' when connected to a windows pc.
am i missing something?
thanks for your help.