Browse Source

Add support for atmega32u4 chip

pull/5/head
Daan Sprenkels 2 years ago
parent
commit
7e90c06cf9
2 changed files with 5 additions and 3 deletions
  1. +2
    -2
      Makefile
  2. +3
    -1
      usb.c

+ 2
- 2
Makefile View File

@ -54,10 +54,10 @@ justflash: $(HEXFILE)
./scripts/wait_then_flash.sh $(CPU) $(HEXFILE)
chip_erase:
dfu-programmer atmega32u2 erase
dfu-programmer $(CPU) erase
reset:
dfu-programmer atmega32u2 reset
dfu-programmer $(CPU) reset
restart:
- ./scripts/enter_bootloader.sh


+ 3
- 1
usb.c View File

@ -785,7 +785,7 @@ void usb_doTasks(void)
}
}
#if defined(__AVR_ATmega32U2__)
#if defined(__AVR_ATmega32U2__) || defined(__AVR_ATmega32U4__)
/* Atmega32u2 datasheet 8.11.6, PLLCSR.
* But register summary says PLLP0... */
@ -851,8 +851,10 @@ void usb_init(const struct usb_parameters *params)
USBCON |= (1<<FRZCLK); // initial value
#ifdef UHWCON
UHWCON |= (1<<UVREGE); // Enable USB pad regulator
#if defined(UIDE) && defined(UIMOD)
UHWCON &= ~(1<<UIDE);
UHWCON |= (1<UIMOD);
#endif
#endif
#ifdef UPOE


Loading…
Cancel
Save