aboutsummaryrefslogtreecommitdiffstats
path: root/Demos
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-02-26 05:48:47 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-02-26 05:48:47 +0000
commit99145a8d7c88d9af065cfb7f5e8507d5b65ff811 (patch)
tree80b407b9114c1fe6727b40e7b7e0caf6fefc0ea1 /Demos
parentfa456ce531b75e2dd3c7c0ecb971e3ede36f5d35 (diff)
downloadlufa-99145a8d7c88d9af065cfb7f5e8507d5b65ff811.tar.gz
lufa-99145a8d7c88d9af065cfb7f5e8507d5b65ff811.tar.bz2
lufa-99145a8d7c88d9af065cfb7f5e8507d5b65ff811.zip
Makefiles and library modified to add a new F_CLOCK constant to give the unprescaled master input clock frequency, so that the correct PLL mask can be determined even when the CPU (F_CPU) clock rate is prescaled outside the normal input range of the PLL.
Started to clean up the AVRISP Programmer project code, donated by Opendous Inc.
Diffstat (limited to 'Demos')
-rw-r--r--Demos/AudioInput/makefile19
-rw-r--r--Demos/AudioOutput/makefile19
-rw-r--r--Demos/BluetoothHost/makefile20
-rw-r--r--Demos/CDC/makefile19
-rw-r--r--Demos/CDCHost/makefile19
-rw-r--r--Demos/DualCDC/makefile19
-rw-r--r--Demos/Joystick/makefile19
-rw-r--r--Demos/Keyboard/makefile19
-rw-r--r--Demos/KeyboardFullInt/makefile19
-rw-r--r--Demos/KeyboardHost/makefile19
-rw-r--r--Demos/KeyboardHostViaInt/makefile19
-rw-r--r--Demos/KeyboardHostWithParser/makefile19
-rw-r--r--Demos/KeyboardMouse/makefile19
-rw-r--r--Demos/KeyboardViaInt/makefile19
-rw-r--r--Demos/MIDI/makefile21
-rw-r--r--Demos/MassStorage/makefile19
-rw-r--r--Demos/MassStorageHost/makefile19
-rw-r--r--Demos/Mouse/makefile19
-rw-r--r--Demos/MouseFullInt/makefile19
-rw-r--r--Demos/MouseHost/makefile19
-rw-r--r--Demos/MouseHostViaInt/makefile19
-rw-r--r--Demos/MouseHostWithParser/makefile19
-rw-r--r--Demos/MouseViaInt/makefile19
-rw-r--r--Demos/RNDISEthernet/makefile20
-rw-r--r--Demos/StillImageHost/makefile19
-rw-r--r--Demos/TestApp/makefile17
-rw-r--r--Demos/USBtoSerial/makefile19
27 files changed, 460 insertions, 55 deletions
diff --git a/Demos/AudioInput/makefile b/Demos/AudioInput/makefile
index 5906650f5..51f6cc5b8 100644
--- a/Demos/AudioInput/makefile
+++ b/Demos/AudioInput/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
diff --git a/Demos/AudioOutput/makefile b/Demos/AudioOutput/makefile
index 46d7100ef..6c2ee3230 100644
--- a/Demos/AudioOutput/makefile
+++ b/Demos/AudioOutput/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
diff --git a/Demos/BluetoothHost/makefile b/Demos/BluetoothHost/makefile
index b82a8ace4..189c84e1c 100644
--- a/Demos/BluetoothHost/makefile
+++ b/Demos/BluetoothHost/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
@@ -166,9 +180,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
-CDEFS += -DUSB_HOST_ONLY -DUSE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
-CDEFS += -DNO_STREAM_CALLBACKS
+CDEFS = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)
+CDEFS += -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DUSB_HOST_ONLY -DNO_STREAM_CALLBACKS
+CDEFS += -DUSE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
# Place -D or -U options here for ASM sources
ADEFS = -DF_CPU=$(F_CPU)
diff --git a/Demos/CDC/makefile b/Demos/CDC/makefile
index b2bc1e269..9b0e5bdd6 100644
--- a/Demos/CDC/makefile
+++ b/Demos/CDC/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
diff --git a/Demos/CDCHost/makefile b/Demos/CDCHost/makefile
index 1152a891a..d1e4cb990 100644
--- a/Demos/CDCHost/makefile
+++ b/Demos/CDCHost/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
@@ -162,8 +176,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_HOST_ONLY -DUSE_STATIC_OPTIONS="(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 -DUSB_HOST_ONLY -DNO_STREAM_CALLBACKS
+CDEFS += -DUSE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
# Place -D or -U options here for ASM sources
diff --git a/Demos/DualCDC/makefile b/Demos/DualCDC/makefile
index 50d8efea1..01ab60997 100644
--- a/Demos/DualCDC/makefile
+++ b/Demos/DualCDC/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
diff --git a/Demos/Joystick/makefile b/Demos/Joystick/makefile
index 0802e2d53..a29a2d380 100644
--- a/Demos/Joystick/makefile
+++ b/Demos/Joystick/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
diff --git a/Demos/Keyboard/makefile b/Demos/Keyboard/makefile
index b2a3bee0f..681f729e2 100644
--- a/Demos/Keyboard/makefile
+++ b/Demos/Keyboard/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
diff --git a/Demos/KeyboardFullInt/makefile b/Demos/KeyboardFullInt/makefile
index 20fcc1315..b1f7f890f 100644
--- a/Demos/KeyboardFullInt/makefile
+++ b/Demos/KeyboardFullInt/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
@@ -158,8 +172,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)"
+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
diff --git a/Demos/KeyboardHost/makefile b/Demos/KeyboardHost/makefile
index 5140e7d98..7ff737e51 100644
--- a/Demos/KeyboardHost/makefile
+++ b/Demos/KeyboardHost/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
@@ -162,8 +176,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_HOST_ONLY -DUSE_STATIC_OPTIONS="(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 -DUSB_HOST_ONLY -DNO_STREAM_CALLBACKS
+CDEFS += -DUSE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
# Place -D or -U options here for ASM sources
diff --git a/Demos/KeyboardHostViaInt/makefile b/Demos/KeyboardHostViaInt/makefile
index 9cd332e5a..a8b3f23e6 100644
--- a/Demos/KeyboardHostViaInt/makefile
+++ b/Demos/KeyboardHostViaInt/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
@@ -162,8 +176,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_HOST_ONLY -DUSE_STATIC_OPTIONS="(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 -DUSB_HOST_ONLY -DNO_STREAM_CALLBACKS
+CDEFS += -DUSE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
# Place -D or -U options here for ASM sources
diff --git a/Demos/KeyboardHostWithParser/makefile b/Demos/KeyboardHostWithParser/makefile
index 3082b8e9b..ea768b4e4 100644
--- a/Demos/KeyboardHostWithParser/makefile
+++ b/Demos/KeyboardHostWithParser/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
@@ -164,8 +178,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_HOST_ONLY -DUSE_STATIC_OPTIONS="(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 -DUSB_HOST_ONLY -DNO_STREAM_CALLBACKS
+CDEFS += -DUSE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
# Place -D or -U options here for ASM sources
diff --git a/Demos/KeyboardMouse/makefile b/Demos/KeyboardMouse/makefile
index ceae7dc58..7c26d2cf2 100644
--- a/Demos/KeyboardMouse/makefile
+++ b/Demos/KeyboardMouse/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
diff --git a/Demos/KeyboardViaInt/makefile b/Demos/KeyboardViaInt/makefile
index f1cb7a569..ff225b35c 100644
--- a/Demos/KeyboardViaInt/makefile
+++ b/Demos/KeyboardViaInt/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
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 )
diff --git a/Demos/MassStorage/makefile b/Demos/MassStorage/makefile
index 82e10908c..2f17228af 100644
--- a/Demos/MassStorage/makefile
+++ b/Demos/MassStorage/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
@@ -161,8 +175,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
-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 -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
diff --git a/Demos/MassStorageHost/makefile b/Demos/MassStorageHost/makefile
index 2379c3856..fb04798e8 100644
--- a/Demos/MassStorageHost/makefile
+++ b/Demos/MassStorageHost/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
@@ -163,8 +177,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_HOST_ONLY -DUSE_STATIC_OPTIONS="(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_HOST_ONLY
+CDEFS += -DUSE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
# Place -D or -U options here for ASM sources
diff --git a/Demos/Mouse/makefile b/Demos/Mouse/makefile
index 329423f5d..0f20dca63 100644
--- a/Demos/Mouse/makefile
+++ b/Demos/Mouse/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
diff --git a/Demos/MouseFullInt/makefile b/Demos/MouseFullInt/makefile
index 317fc315d..fe8551698 100644
--- a/Demos/MouseFullInt/makefile
+++ b/Demos/MouseFullInt/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)"
+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)"
# Place -D or -U options here for ASM sources
diff --git a/Demos/MouseHost/makefile b/Demos/MouseHost/makefile
index b387efe34..6e8688f10 100644
--- a/Demos/MouseHost/makefile
+++ b/Demos/MouseHost/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
@@ -162,8 +176,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_HOST_ONLY -DUSE_STATIC_OPTIONS="(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_HOST_ONLY
+CDEFS += -DUSE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
# Place -D or -U options here for ASM sources
diff --git a/Demos/MouseHostViaInt/makefile b/Demos/MouseHostViaInt/makefile
index 0f8cae300..f2b86e12f 100644
--- a/Demos/MouseHostViaInt/makefile
+++ b/Demos/MouseHostViaInt/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
@@ -162,8 +176,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_HOST_ONLY -DUSE_STATIC_OPTIONS="(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_HOST_ONLY
+CDEFS += -DUSE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
# Place -D or -U options here for ASM sources
diff --git a/Demos/MouseHostWithParser/makefile b/Demos/MouseHostWithParser/makefile
index d9fcb1bc7..3eec44b36 100644
--- a/Demos/MouseHostWithParser/makefile
+++ b/Demos/MouseHostWithParser/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
@@ -164,8 +178,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_HOST_ONLY -DUSE_STATIC_OPTIONS="(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_HOST_ONLY
+CDEFS += -DUSE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
# Place -D or -U options here for ASM sources
diff --git a/Demos/MouseViaInt/makefile b/Demos/MouseViaInt/makefile
index 0316b912d..571d1f606 100644
--- a/Demos/MouseViaInt/makefile
+++ b/Demos/MouseViaInt/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
diff --git a/Demos/RNDISEthernet/makefile b/Demos/RNDISEthernet/makefile
index 840b9d8d5..ba1588af6 100644
--- a/Demos/RNDISEthernet/makefile
+++ b/Demos/RNDISEthernet/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
@@ -171,8 +185,10 @@ 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)"
+
CDEFS += -DNO_DECODE_ETHERNET -DNO_DECODE_ARP -DNO_DECODE_ICMP -DNO_DECODE_IP -DNO_DECODE_TCP -DNO_DECODE_UDP -DNO_DECODE_DHCP
diff --git a/Demos/StillImageHost/makefile b/Demos/StillImageHost/makefile
index f2aee82e2..63e328ac4 100644
--- a/Demos/StillImageHost/makefile
+++ b/Demos/StillImageHost/makefile
@@ -89,6 +89,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
@@ -162,8 +176,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_HOST_ONLY -DUSE_STATIC_OPTIONS="(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_HOST_ONLY
+CDEFS += -DUSE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
# Place -D or -U options here for ASM sources
diff --git a/Demos/TestApp/makefile b/Demos/TestApp/makefile
index 9d9b5fd6a..befc0e6fc 100644
--- a/Demos/TestApp/makefile
+++ b/Demos/TestApp/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
@@ -167,7 +181,8 @@ 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
+CDEFS = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)
+CDEFS += -DUSE_NONSTANDARD_DESCRIPTOR_NAMES
CDEFS += -DNUM_BLOCKS=100 -DBLOCK_SIZE=8 -DNUM_HANDLES=20
diff --git a/Demos/USBtoSerial/makefile b/Demos/USBtoSerial/makefile
index 58c12b9ef..6703102bb 100644
--- a/Demos/USBtoSerial/makefile
+++ b/Demos/USBtoSerial/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
@@ -161,8 +175,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