aboutsummaryrefslogtreecommitdiffstats
path: root/Bootloaders/CDC
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 /Bootloaders/CDC
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 'Bootloaders/CDC')
-rw-r--r--Bootloaders/CDC/BootloaderCDC.c4
-rw-r--r--Bootloaders/CDC/BootloaderCDC.h4
-rw-r--r--Bootloaders/CDC/makefile22
3 files changed, 23 insertions, 7 deletions
diff --git a/Bootloaders/CDC/BootloaderCDC.c b/Bootloaders/CDC/BootloaderCDC.c
index 654eabd22..54c7b7e49 100644
--- a/Bootloaders/CDC/BootloaderCDC.c
+++ b/Bootloaders/CDC/BootloaderCDC.c
@@ -207,7 +207,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
*
* \param Command Single character AVR910 protocol command indicating what memory operation to perform
*/
-static void ProgramReadWriteMemoryBlock(const uint8_t Command)
+static void ReadWriteMemoryBlock(const uint8_t Command)
{
uint16_t BlockSize;
char MemoryType;
@@ -503,7 +503,7 @@ TASK(CDC_Task)
else if ((Command == 'B') || (Command == 'g'))
{
/* Delegate the block write/read to a seperate function for clarity */
- ProgramReadWriteMemoryBlock(Command);
+ ReadWriteMemoryBlock(Command);
}
else if (Command == 'R')
{
diff --git a/Bootloaders/CDC/BootloaderCDC.h b/Bootloaders/CDC/BootloaderCDC.h
index 0d8f1e3d8..a6e77550c 100644
--- a/Bootloaders/CDC/BootloaderCDC.h
+++ b/Bootloaders/CDC/BootloaderCDC.h
@@ -127,9 +127,9 @@
/* Function Prototypes: */
#if defined(INCLUDE_FROM_BOOTLOADERCDC_C) || defined(__DOXYGEN__)
- static void ProgramReadWriteMemoryBlock(const uint8_t Command);
+ static void ReadWriteMemoryBlock(const uint8_t Command);
static uint8_t FetchNextCommandByte(void);
- static void WriteNextResponseByte(const uint8_t Response);
+ static void WriteNextResponseByte(const uint8_t Response);
#endif
#endif
diff --git a/Bootloaders/CDC/makefile b/Bootloaders/CDC/makefile
index 3fa8ad4ff..5045cc686 100644
--- a/Bootloaders/CDC/makefile
+++ b/Bootloaders/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
@@ -162,9 +176,11 @@ BOOT_START = 0x1E000
# Place -D or -U options here for C sources
-CDEFS = -DF_CPU=$(F_CPU)UL -DBOARD=BOARD_$(BOARD) -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DSTATIC_ENDPOINT_CONFIGURATION
-CDEFS += -DUSB_DEVICE_ONLY -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
-CDEFS += -DUSE_RAM_DESCRIPTORS -DBOOT_START_ADDR=$(BOOT_START)UL -DFIXED_CONTROL_ENDPOINT_SIZE=8 -DUSE_SINGLE_DEVICE_CONFIGURATION
+CDEFS = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)
+CDEFS += -DUSB_DEVICE_ONLY -DUSE_NONSTANDARD_DESCRIPTOR_NAMES
+CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=8
+CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
+CDEFS += -DUSE_RAM_DESCRIPTORS -DBOOT_START_ADDR=$(BOOT_START)UL -DUSE_SINGLE_DEVICE_CONFIGURATION
# Place -D or -U options here for ASM sources