aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/MIDI/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Demos/MIDI/makefile')
-rw-r--r--Demos/MIDI/makefile21
1 files changed, 18 insertions, 3 deletions
diff --git a/Demos/MIDI/makefile b/Demos/MIDI/makefile
index 63f051306..c5cc048d8 100644
--- a/Demos/MIDI/makefile
+++ b/Demos/MIDI/makefile
@@ -90,6 +90,20 @@ BOARD = USBKEY
F_CPU = 8000000
+# Input clock frequency.
+# This will define a symbol, F_CLOCK, in all source code files equal to the
+# input clock frequency (before any prescaling is performed). This value may
+# differ from F_CPU if prescaling is used on the latter, and is required as the
+# raw input clock is fed directly to the PLL sections of the AVR for high speed
+# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
+# at the end, this will be done automatically to create a 32-bit value in your
+# source code.
+#
+# If no clock division is performed on the input clock inside the AVR (via the
+# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
+F_CLOCK = 8000000
+
+
# Output format. (can be srec, ihex, binary)
FORMAT = ihex
@@ -159,8 +173,9 @@ CSTANDARD = -std=gnu99
# Place -D or -U options here for C sources
-CDEFS = -DF_CPU=$(F_CPU)UL -DBOARD=BOARD_$(BOARD) -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS
-CDEFS += -DUSB_DEVICE_ONLY -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
+CDEFS = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)
+CDEFS += -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS -DUSB_DEVICE_ONLY
+CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
# Place -D or -U options here for ASM sources
@@ -464,7 +479,7 @@ end:
# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
-EELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
+ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )