diff options
| author | fauxpark <fauxpark@gmail.com> | 2019-08-09 07:09:54 +1000 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2019-08-08 14:09:54 -0700 |
| commit | 405dea01bef215a0b79524e4ff74364f1bcfeadf (patch) | |
| tree | f265fc8731143dfe70b994ea63ae9685298f62b1 /quantum | |
| parent | 2f6c068e0dd7abc3cec1bb72df0b1e96032246f8 (diff) | |
| download | qmk_firmware-405dea01bef215a0b79524e4ff74364f1bcfeadf.tar.gz qmk_firmware-405dea01bef215a0b79524e4ff74364f1bcfeadf.zip | |
Add some defaults for ATmega32A to mcu_selection.mk (#6253)
* Add some defaults for ATmega32A to mcu_selection.mk
* Remove boilerplate from templates
* Relax INTERRUPT_CONTROL_ENDPOINT and PROGRAM_CMD
* Apply suggestions from code review
Co-Authored-By: Drashna Jaelre <drashna@live.com>
Diffstat (limited to 'quantum')
| -rw-r--r-- | quantum/mcu_selection.mk | 26 | ||||
| -rw-r--r-- | quantum/template/avr/rules.mk | 36 | ||||
| -rw-r--r-- | quantum/template/ps2avrgb/rules.mk | 11 |
3 files changed, 24 insertions, 49 deletions
diff --git a/quantum/mcu_selection.mk b/quantum/mcu_selection.mk index fa6dc8b53..cca7720e9 100644 --- a/quantum/mcu_selection.mk +++ b/quantum/mcu_selection.mk | |||
| @@ -1,4 +1,3 @@ | |||
| 1 | |||
| 2 | ifneq ($(findstring STM32F303, $(MCU)),) | 1 | ifneq ($(findstring STM32F303, $(MCU)),) |
| 3 | ## chip/board settings | 2 | ## chip/board settings |
| 4 | # - the next two should match the directories in | 3 | # - the next two should match the directories in |
| @@ -54,7 +53,7 @@ ifneq (,$(filter $(MCU),atmega32u4 at90usb1286)) | |||
| 54 | # LUFA specific | 53 | # LUFA specific |
| 55 | # | 54 | # |
| 56 | # Target architecture (see library "Board Types" documentation). | 55 | # Target architecture (see library "Board Types" documentation). |
| 57 | ARCH ?= AVR8 | 56 | ARCH = AVR8 |
| 58 | 57 | ||
| 59 | # Input clock frequency. | 58 | # Input clock frequency. |
| 60 | # This will define a symbol, F_USB, in all source code files equal to the | 59 | # This will define a symbol, F_USB, in all source code files equal to the |
| @@ -68,4 +67,27 @@ ifneq (,$(filter $(MCU),atmega32u4 at90usb1286)) | |||
| 68 | # If no clock division is performed on the input clock inside the AVR (via the | 67 | # If no clock division is performed on the input clock inside the AVR (via the |
| 69 | # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. | 68 | # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. |
| 70 | F_USB ?= $(F_CPU) | 69 | F_USB ?= $(F_CPU) |
| 70 | |||
| 71 | # Interrupt driven control endpoint task | ||
| 72 | ifeq (,$(filter $(NO_INTERRUPT_CONTROL_ENDPOINT),yes)) | ||
| 73 | OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT | ||
| 74 | endif | ||
| 75 | endif | ||
| 76 | |||
| 77 | ifneq (,$(filter $(MCU),atmega32a)) | ||
| 78 | PROTOCOL = VUSB | ||
| 79 | |||
| 80 | # Processor frequency. | ||
| 81 | # This will define a symbol, F_CPU, in all source code files equal to the | ||
| 82 | # processor frequency in Hz. You can then use this symbol in your source code to | ||
| 83 | # calculate timings. Do NOT tack on a 'UL' at the end, this will be done | ||
| 84 | # automatically to create a 32-bit value in your source code. | ||
| 85 | F_CPU ?= 12000000 | ||
| 86 | |||
| 87 | # unsupported features for now | ||
| 88 | NO_UART ?= yes | ||
| 89 | NO_SUSPEND_POWER_DOWN ?= yes | ||
| 90 | |||
| 91 | # Programming options | ||
| 92 | PROGRAM_CMD ?= ./util/atmega32a_program.py $(TARGET).hex | ||
| 71 | endif | 93 | endif |
diff --git a/quantum/template/avr/rules.mk b/quantum/template/avr/rules.mk index 133c9e363..50deba92c 100644 --- a/quantum/template/avr/rules.mk +++ b/quantum/template/avr/rules.mk | |||
| @@ -1,42 +1,6 @@ | |||
| 1 | # MCU name | 1 | # MCU name |
| 2 | MCU = atmega32u4 | 2 | MCU = atmega32u4 |
| 3 | 3 | ||
| 4 | # Processor frequency. | ||
| 5 | # This will define a symbol, F_CPU, in all source code files equal to the | ||
| 6 | # processor frequency in Hz. You can then use this symbol in your source code to | ||
| 7 | # calculate timings. Do NOT tack on a 'UL' at the end, this will be done | ||
| 8 | # automatically to create a 32-bit value in your source code. | ||
| 9 | # | ||
| 10 | # This will be an integer division of F_USB below, as it is sourced by | ||
| 11 | # F_USB after it has run through any CPU prescalers. Note that this value | ||
| 12 | # does not *change* the processor frequency - it should merely be updated to | ||
| 13 | # reflect the processor speed set externally so that the code can use accurate | ||
| 14 | # software delays. | ||
| 15 | F_CPU = 16000000 | ||
| 16 | |||
| 17 | |||
| 18 | # | ||
| 19 | # LUFA specific | ||
| 20 | # | ||
| 21 | # Target architecture (see library "Board Types" documentation). | ||
| 22 | ARCH = AVR8 | ||
| 23 | |||
| 24 | # Input clock frequency. | ||
| 25 | # This will define a symbol, F_USB, in all source code files equal to the | ||
| 26 | # input clock frequency (before any prescaling is performed) in Hz. This value may | ||
| 27 | # differ from F_CPU if prescaling is used on the latter, and is required as the | ||
| 28 | # raw input clock is fed directly to the PLL sections of the AVR for high speed | ||
| 29 | # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' | ||
| 30 | # at the end, this will be done automatically to create a 32-bit value in your | ||
| 31 | # source code. | ||
| 32 | # | ||
| 33 | # If no clock division is performed on the input clock inside the AVR (via the | ||
| 34 | # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. | ||
| 35 | F_USB = $(F_CPU) | ||
| 36 | |||
| 37 | # Interrupt driven control endpoint task(+60) | ||
| 38 | OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT | ||
| 39 | |||
| 40 | 4 | ||
| 41 | # Bootloader selection | 5 | # Bootloader selection |
| 42 | # Teensy halfkay | 6 | # Teensy halfkay |
diff --git a/quantum/template/ps2avrgb/rules.mk b/quantum/template/ps2avrgb/rules.mk index 98a920e18..a3ac9bd75 100644 --- a/quantum/template/ps2avrgb/rules.mk +++ b/quantum/template/ps2avrgb/rules.mk | |||
| @@ -1,13 +1,5 @@ | |||
| 1 | # MCU name | 1 | # MCU name |
| 2 | MCU = atmega32a | 2 | MCU = atmega32a |
| 3 | PROTOCOL = VUSB | ||
| 4 | |||
| 5 | # unsupported features for now | ||
| 6 | NO_UART = yes | ||
| 7 | NO_SUSPEND_POWER_DOWN = yes | ||
| 8 | |||
| 9 | # processor frequency | ||
| 10 | F_CPU = 12000000 | ||
| 11 | 3 | ||
| 12 | # Bootloader | 4 | # Bootloader |
| 13 | # This definition is optional, and if your keyboard supports multiple bootloaders of | 5 | # This definition is optional, and if your keyboard supports multiple bootloaders of |
| @@ -28,6 +20,3 @@ RGBLIGHT_CUSTOM_DRIVER = yes | |||
| 28 | OPT_DEFS = -DDEBUG_LEVEL=0 | 20 | OPT_DEFS = -DDEBUG_LEVEL=0 |
| 29 | 21 | ||
| 30 | SRC += i2c_master.c | 22 | SRC += i2c_master.c |
| 31 | |||
| 32 | # programming options | ||
| 33 | PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex | ||
