raphnet / gc_n64_usb-v3

Gamecube/N64 to USB adapter firmware (3rd generation)
http://www.raphnet.net/electronique/gcn64_usb_adapter_gen3/index_en.php
GNU General Public License v3.0
42 stars 10 forks source link

Add support for atmega32u4 chip #5

Closed dsprenkels closed 5 years ago

dsprenkels commented 5 years ago

This PR adds support for the atmega32u4 chips, including this compatible with the Arduino Leonardo. I have personally tested this with a regular GC gamepad on a cheap Chinese knockoff Arduino Pro Micro from AliExpress.

I have not tested the flashing mechanism using dfu-programmer, because I personally prefer avrdude. I used this script to flash the device:

#!/bin/sh

readonly HEX="gcn64usb.hex"

sudo avrdude -v -p atmega32u4 -P /dev/ttyACM0 -c avr109 -b 115200 -U "flash:w:${HEX}:i"

To be enable the build for the atmega32u4, the user will have to update the Makefile:

diff --git a/Makefile b/Makefile
index 0c14469..944e2f2 100644
--- a/Makefile
+++ b/Makefile
@@ -9 +9 @@ OBJDIR=objs-$(PROGNAME)
-CPU=atmega32u2
+CPU=atmega32u4
raphnet commented 5 years ago

Thanks!