1
0
mirror of https://github.com/raphnet/gc_n64_usb-v3 synced 2024-12-21 14:58:51 -05:00

Merge pull request #5 from dsprenkels/atmega32u4

Add support for atmega32u4 chip
This commit is contained in:
Raphaël Assénat 2019-07-16 16:06:14 -04:00 committed by GitHub
commit 59c2627f40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

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

4
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