aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile4
-rw-r--r--tests/usbconfig.h6
2 files changed, 8 insertions, 2 deletions
diff --git a/tests/Makefile b/tests/Makefile
index a800c2a..43f8da1 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -13,7 +13,7 @@ DEFINES =
CFLAGS = $(DEFINES) -Iusbdrv -I. -DDEBUG_LEVEL=0
OBJECTS = usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o main.o
-COMPILE = avr-gcc -Wall -Os -DF_CPU=$(F_CPU) $(CFLAGS) -mmcu=$(DEVICE)
+COMPILE = avr-gcc -Wall -Os -DF_CPU=$(F_CPU) $(CRCFLAG) $(CFLAGS) -mmcu=$(DEVICE)
SIZES_TMP = /tmp/sizetmp.txt
@@ -39,6 +39,8 @@ sizes sizes.txt:
$(MAKE) clean; $(MAKE) main.elf F_CPU=16500000
avr-size main.elf | tail -1 | awk '{print "Minimum_with_16_5_MHz", $$1+$$2, $$3+$$2}' >>$(SIZES_TMP)
$(MAKE) clean; $(MAKE) main.elf F_CPU=18000000
+ avr-size main.elf | tail -1 | awk '{print "Minimum_with_18_MHz", $$1+$$2, $$3+$$2}' >>$(SIZES_TMP)
+ $(MAKE) clean; $(MAKE) main.elf F_CPU=18000000 CRCFLAG="-DUSE_CRC=1"
avr-size main.elf | tail -1 | awk '{print "Minimum_with_18_MHz+CRC", $$1+$$2, $$3+$$2}' >>$(SIZES_TMP)
$(MAKE) clean; $(MAKE) main.elf F_CPU=20000000
avr-size main.elf | tail -1 | awk '{print "Minimum_with_20_MHz", $$1+$$2, $$3+$$2}' >>$(SIZES_TMP)
diff --git a/tests/usbconfig.h b/tests/usbconfig.h
index 0061ee4..e079e06 100644
--- a/tests/usbconfig.h
+++ b/tests/usbconfig.h
@@ -22,7 +22,11 @@ features. Don't use it as a prototype, use usbconfig-prototype.h instead!
#define USB_CFG_DMINUS_BIT 4
#define USB_CFG_DPLUS_BIT 2
#define USB_CFG_CLOCK_KHZ (F_CPU/1000)
-#define USB_CFG_CHECK_CRC (USB_CFG_CLOCK_KHZ == 18000)
+#ifdef USE_CRC
+# define USB_CFG_CHECK_CRC 1
+#else
+# define USB_CFG_CHECK_CRC 0
+#endif
/* ----------------------- Optional Hardware Config ------------------------ */