diff --git a/klippy/pins.py b/klippy/pins.py index d70e3834..b424c4b9 100644 --- a/klippy/pins.py +++ b/klippy/pins.py @@ -42,6 +42,7 @@ MCU_PINS = { "atmega328": port_pins(5), "atmega328p": port_pins(5), "atmega644p": port_pins(4), "atmega1284p": port_pins(4), "at90usb1286": port_pins(6), "at90usb646": port_pins(6), + "atmega32u4": port_pins(6), "atmega1280": port_pins(12), "atmega2560": port_pins(12), "sam3x8e": port_pins(4, 32), "samd21g": port_pins(2, 32), diff --git a/src/avr/Kconfig b/src/avr/Kconfig index 18769d49..e0f407c0 100644 --- a/src/avr/Kconfig +++ b/src/avr/Kconfig @@ -26,6 +26,8 @@ choice bool "at90usb1286" config MACH_at90usb646 bool "at90usb646" + config MACH_atmega32u4 + bool "atmega32u4" config MACH_atmega1284p bool "atmega1284p" config MACH_atmega644p @@ -47,14 +49,14 @@ config MCU default "atmega644p" if MACH_atmega644p default "at90usb1286" if MACH_at90usb1286 default "at90usb646" if MACH_at90usb646 + default "atmega32u4" if MACH_atmega32u4 default "atmega1280" if MACH_atmega1280 default "atmega2560" if MACH_atmega2560 config AVRDUDE_PROTOCOL string default "wiring" if MACH_atmega2560 - default "avr109" if MACH_at90usb1286 - default "avr109" if MACH_at90usb646 + default "avr109" if MACH_at90usb1286 || MACH_at90usb646 || MACH_atmega32u4 default "arduino" choice @@ -76,7 +78,7 @@ config CLOCK_FREQ config CLEAR_PRESCALER bool "Manually clear the CPU prescaler field at startup" - depends on MACH_at90usb1286 || MACH_at90usb646 + depends on MACH_at90usb1286 || MACH_at90usb646 || MACH_atmega32u4 default y help Some AVR chips ship with a "clock prescaler" that causes the @@ -98,7 +100,7 @@ config AVR_WATCHDOG default y config AVR_USBSERIAL bool "Use USB for communication (instead of serial)" - depends on MACH_at90usb1286 || MACH_at90usb646 + depends on MACH_at90usb1286 || MACH_at90usb646 || MACH_atmega32u4 default y config AVR_SERIAL depends on !AVR_USBSERIAL @@ -132,7 +134,7 @@ config SERIAL_PORT int default 3 if AVR_SERIAL_UART3 default 2 if AVR_SERIAL_UART2 - default 1 if MACH_at90usb1286 || MACH_at90usb646 || AVR_SERIAL_UART1 + default 1 if MACH_at90usb1286 || MACH_at90usb646 || MACH_atmega32u4 || AVR_SERIAL_UART1 default 0 config SIMULAVR diff --git a/src/avr/gpio.c b/src/avr/gpio.c index b611fdbc..15da3d79 100644 --- a/src/avr/gpio.c +++ b/src/avr/gpio.c @@ -139,8 +139,10 @@ static const struct gpio_pwm_info pwm_regs[] PROGMEM = { #ifdef OCR1C { &OCR1C, &TCCR1A, &TCCR1B, 1<