]> sigrok.org Git - sigrok-firmware-fx2lafw.git/commitdiff
Removed debug routines - they turned out not to be so useful, and occupy valuable...
authorJoel Holdsworth <redacted>
Wed, 14 Mar 2012 21:44:08 +0000 (21:44 +0000)
committerJoel Holdsworth <redacted>
Wed, 14 Mar 2012 21:59:43 +0000 (21:59 +0000)
Makefile.include
debug.c [deleted file]
fx2lafw.c
hw/cwav-usbeeax/Makefile
hw/cwav-usbeeax/dscr.a51
hw/cwav-usbeesx/Makefile
hw/cwav-usbeesx/dscr.a51
hw/saleae-logic/Makefile
hw/saleae-logic/dscr.a51
include/debug.h [deleted file]

index 5c01a958019fb4b8b2a2c20332b2c4e0a6458764..81c4915a83bc6a4d7e839b7cae0b7eb90cdf8786 100644 (file)
@@ -24,13 +24,6 @@ OBJCOPY ?= objcopy
 FX2LIBDIR ?= ../../fx2lib
 BUILDDIR ?= build
 
-DEBUG ?= 0
-ifeq ($(DEBUG), 1)
-       SDCCFLAGS += -DDEBUG
-else
-       SDCCFLAGS += -DNDEBUG
-endif
-
 SDCCFLAGS += -I../../include/
 
 $(BUILDDIR)/$(BASENAME).fw: $(BUILDDIR)/$(BASENAME).ihx
diff --git a/debug.c b/debug.c
deleted file mode 100644 (file)
index ba8d3f1..0000000
--- a/debug.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * This file is part of the fx2lafw project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
- */
-
-#ifdef DEBUG
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <delay.h>
-#include <fx2regs.h>
-#include <fx2macros.h>
-#include "debug.h"
-
-#define MESSAGE_LENGTH_MAX 64
-
-void debugf(const char *format, ...)
-{
-       va_list arg;
-       int count;
-
-       /* Format the string. */
-       va_start(arg, format);
-       count = vsprintf(EP6FIFOBUF, format, arg);
-       va_end(arg);
-
-       /* Zero out the rest of the buffer. */
-       while (count < MESSAGE_LENGTH_MAX)
-               EP6FIFOBUF[count++] = '\0';
-
-       /* Send the buffer. */
-       count = 32;
-       EP6BCH = MSB(count);
-       SYNCDELAY4;
-       EP6BCL = LSB(count);
-       SYNCDELAY4;
-}
-
-void _assert(char *expr, const char *filename, unsigned int linenumber)
-{
-       debugf("Assert(%s) failed at line %u in file %s.\n",
-              expr, linenumber, filename);
-       while (1);
-}
-
-#endif
index d4423633a56735166c62cec46cd63909204c1944..401b5fe6a08bfaba439953fcb33720bcec072519 100644 (file)
--- a/fx2lafw.c
+++ b/fx2lafw.c
@@ -64,26 +64,15 @@ static void setup_endpoints(void)
                 (0 << 1) | (0 << 0);     /* EP buffering: quad buffering */
        SYNCDELAY();
 
-       /* Setup EP6 (IN) in the debug build. */
-#ifdef DEBUG
-       EP6CFG = (1 << 7) |               /* EP is valid/activated */
-                (1 << 6) |               /* EP direction: IN */
-                (1 << 5) | (0 << 4) |    /* EP Type: bulk */
-                (0 << 3) |               /* EP buffer size: 512 */
-                (0 << 2) |               /* Reserved */
-                (1 << 1) | (0 << 0);     /* EP buffering: double buffering */
-#else
-       EP6CFG &= ~bmVALID;
-#endif
-       SYNCDELAY();
-
-       /* Disable all other EPs (EP1, EP4, and EP8). */
+       /* Disable all other EPs (EP1, EP4, EP6, and EP8). */
        EP1INCFG &= ~bmVALID;
        SYNCDELAY();
        EP1OUTCFG &= ~bmVALID;
        SYNCDELAY();
        EP4CFG &= ~bmVALID;
        SYNCDELAY();
+       EP6CFG &= ~bmVALID;
+       SYNCDELAY();
        EP8CFG &= ~bmVALID;
        SYNCDELAY();
 
@@ -91,11 +80,6 @@ static void setup_endpoints(void)
        /* Note: RESETFIFO() gets the EP number WITHOUT bit 7 set/cleared. */
        RESETFIFO(0x02)
 
-#ifdef DEBUG
-       /* Reset the FIFOs of EP6 when in debug mode. */
-       RESETFIFO(0x06)
-#endif
-
        /* EP2: Enable AUTOIN mode. Set FIFO width to 8bits. */
        EP2FIFOCFG = bmAUTOIN;
        SYNCDELAY();
index 1d773a6731b572c3e1de87e0806f6f4c2e97355e..b40892c86e0dd085b5fdfec8beeea8258236393c 100644 (file)
@@ -21,8 +21,7 @@
 SOURCES = \
        main.c \
        ../../fx2lafw.c \
-       ../../gpif-acquisition.c \
-       ../../debug.c
+       ../../gpif-acquisition.c
 A51_SOURCES = dscr.a51
 BASENAME = fx2lafw-cwav-usbeeax
 
index 0822887a21deaf0240a2086d750ade3f7fe1f4f8..eda53ac2e3dfea624c4eb534a0dee78cba48c131 100644 (file)
@@ -97,7 +97,7 @@ highspd_dscr_end:
        .db     DSCR_INTERFACE_TYPE
        .db     0                       ; Interface index
        .db     0                       ; Alternate setting index
-       .db     2                       ; Number of endpoints
+       .db     1                       ; Number of endpoints
        .db     0xff                    ; Class (vendor specific)
        .db     0xff                    ; Subclass (vendor specific)
        .db     0xff                    ; Protocol (vendor specific)
@@ -112,15 +112,6 @@ highspd_dscr_end:
        .db     0x02                    ; Max. packet size, MSB (512 bytes)
        .db     0x00                    ; Polling interval
 
-       ; Endpoint 6 (IN)
-       .db     DSCR_ENDPOINT_LEN
-       .db     DSCR_ENDPOINT_TYPE
-       .db     0x86                    ; EP number (6), direction (IN)
-       .db     ENDPOINT_TYPE_BULK      ; Endpoint type (bulk)
-       .db     0x00                    ; Max. packet size, LSB (512 bytes)
-       .db     0x02                    ; Max. packet size, MSB (512 bytes)
-       .db     0x00                    ; Polling interval
-
 highspd_dscr_realend:
 
        .even
@@ -146,7 +137,7 @@ fullspd_dscr_end:
        .db     DSCR_INTERFACE_TYPE
        .db     0                       ; Interface index
        .db     0                       ; Alternate setting index
-       .db     2                       ; Number of endpoints
+       .db     1                       ; Number of endpoints
        .db     0xff                    ; Class (vendor specific)
        .db     0xff                    ; Subclass (vendor specific)
        .db     0xff                    ; Protocol (vendor specific)
@@ -161,15 +152,6 @@ fullspd_dscr_end:
        .db     0x00                    ; Max. packet size, MSB (64 bytes)
        .db     0x00                    ; Polling interval
 
-       ; Endpoint 6 (IN)
-       .db     DSCR_ENDPOINT_LEN
-       .db     DSCR_ENDPOINT_TYPE
-       .db     0x86                    ; EP number (6), direction (IN)
-       .db     ENDPOINT_TYPE_BULK      ; Endpoint type (bulk)
-       .db     0x40                    ; Max. packet size, LSB (64 bytes)
-       .db     0x00                    ; Max. packet size, MSB (64 bytes)
-       .db     0x00                    ; Polling interval
-
 fullspd_dscr_realend:
 
        .even
index 5d1c59aab1564ef876f0217c805faa9f76750e74..a585a49bac03b0fe7eacdf45747c5ffb95162393 100644 (file)
@@ -22,8 +22,7 @@
 SOURCES = \
        main.c \
        ../../fx2lafw.c \
-       ../../gpif-acquisition.c \
-       ../../debug.c
+       ../../gpif-acquisition.c
 A51_SOURCES = dscr.a51
 BASENAME = fx2lafw-cwav-usbeesx
 
index 9498c3a59788975a1dd6aec4a9e14464cdb92b4b..1d23fc045f825183f590fa852d6c300648d3be24 100644 (file)
@@ -98,7 +98,7 @@ highspd_dscr_end:
        .db     DSCR_INTERFACE_TYPE
        .db     0                       ; Interface index
        .db     0                       ; Alternate setting index
-       .db     2                       ; Number of endpoints
+       .db     1                       ; Number of endpoints
        .db     0xff                    ; Class (vendor specific)
        .db     0xff                    ; Subclass (vendor specific)
        .db     0xff                    ; Protocol (vendor specific)
@@ -113,15 +113,6 @@ highspd_dscr_end:
        .db     0x02                    ; Max. packet size, MSB (512 bytes)
        .db     0x00                    ; Polling interval
 
-       ; Endpoint 6 (IN)
-       .db     DSCR_ENDPOINT_LEN
-       .db     DSCR_ENDPOINT_TYPE
-       .db     0x86                    ; EP number (6), direction (IN)
-       .db     ENDPOINT_TYPE_BULK      ; Endpoint type (bulk)
-       .db     0x00                    ; Max. packet size, LSB (512 bytes)
-       .db     0x02                    ; Max. packet size, MSB (512 bytes)
-       .db     0x00                    ; Polling interval
-
 highspd_dscr_realend:
 
        .even
@@ -147,7 +138,7 @@ fullspd_dscr_end:
        .db     DSCR_INTERFACE_TYPE
        .db     0                       ; Interface index
        .db     0                       ; Alternate setting index
-       .db     2                       ; Number of endpoints
+       .db     1                       ; Number of endpoints
        .db     0xff                    ; Class (vendor specific)
        .db     0xff                    ; Subclass (vendor specific)
        .db     0xff                    ; Protocol (vendor specific)
@@ -162,15 +153,6 @@ fullspd_dscr_end:
        .db     0x00                    ; Max. packet size, MSB (64 bytes)
        .db     0x00                    ; Polling interval
 
-       ; Endpoint 6 (IN)
-       .db     DSCR_ENDPOINT_LEN
-       .db     DSCR_ENDPOINT_TYPE
-       .db     0x86                    ; EP number (6), direction (IN)
-       .db     ENDPOINT_TYPE_BULK      ; Endpoint type (bulk)
-       .db     0x40                    ; Max. packet size, LSB (64 bytes)
-       .db     0x00                    ; Max. packet size, MSB (64 bytes)
-       .db     0x00                    ; Polling interval
-
 fullspd_dscr_realend:
 
        .even
index d0b42cda904bbefcf1b3a9c360efc178ed16d97b..ff65939ca6f3d7e6c08536100e58076b77ed78da 100644 (file)
@@ -21,8 +21,7 @@
 SOURCES = \
        main.c \
        ../../fx2lafw.c \
-       ../../gpif-acquisition.c \
-       ../../debug.c
+       ../../gpif-acquisition.c
 A51_SOURCES = dscr.a51
 BASENAME = fx2lafw-saleae-logic
 
index e67617f77107b0cab61ec1ada702800eac6960b3..2502b51dca2938a85cd6498b4f2a825503004c1f 100644 (file)
@@ -97,7 +97,7 @@ highspd_dscr_end:
        .db     DSCR_INTERFACE_TYPE
        .db     0                       ; Interface index
        .db     0                       ; Alternate setting index
-       .db     2                       ; Number of endpoints
+       .db     1                       ; Number of endpoints
        .db     0xff                    ; Class (vendor specific)
        .db     0xff                    ; Subclass (vendor specific)
        .db     0xff                    ; Protocol (vendor specific)
@@ -112,15 +112,6 @@ highspd_dscr_end:
        .db     0x02                    ; Max. packet size, MSB (512 bytes)
        .db     0x00                    ; Polling interval
 
-       ; Endpoint 6 (IN)
-       .db     DSCR_ENDPOINT_LEN
-       .db     DSCR_ENDPOINT_TYPE
-       .db     0x86                    ; EP number (6), direction (IN)
-       .db     ENDPOINT_TYPE_BULK      ; Endpoint type (bulk)
-       .db     0x00                    ; Max. packet size, LSB (512 bytes)
-       .db     0x02                    ; Max. packet size, MSB (512 bytes)
-       .db     0x00                    ; Polling interval
-
 highspd_dscr_realend:
 
        .even
@@ -146,7 +137,7 @@ fullspd_dscr_end:
        .db     DSCR_INTERFACE_TYPE
        .db     0                       ; Interface index
        .db     0                       ; Alternate setting index
-       .db     2                       ; Number of endpoints
+       .db     1                       ; Number of endpoints
        .db     0xff                    ; Class (vendor specific)
        .db     0xff                    ; Subclass (vendor specific)
        .db     0xff                    ; Protocol (vendor specific)
@@ -161,15 +152,6 @@ fullspd_dscr_end:
        .db     0x00                    ; Max. packet size, MSB (64 bytes)
        .db     0x00                    ; Polling interval
 
-       ; Endpoint 6 (IN)
-       .db     DSCR_ENDPOINT_LEN
-       .db     DSCR_ENDPOINT_TYPE
-       .db     0x86                    ; EP number (6), direction (IN)
-       .db     ENDPOINT_TYPE_BULK      ; Endpoint type (bulk)
-       .db     0x40                    ; Max. packet size, LSB (64 bytes)
-       .db     0x00                    ; Max. packet size, MSB (64 bytes)
-       .db     0x00                    ; Polling interval
-
 fullspd_dscr_realend:
 
        .even
diff --git a/include/debug.h b/include/debug.h
deleted file mode 100644 (file)
index 1d631c3..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * This file is part of the fx2lafw project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
- */
-
-#ifdef DEBUG
-
-#define ERRF(fmt, ...)         do { debugf("E " fmt, __VA_ARGS__); \
-                               while(1); } while(0)
-#define ERR(msg)               ERRF("%s", msg)
-
-#define WARNF(fmt, ...)                debugf("W " fmt, __VA_ARGS__)
-#define WARN(msg)              WARNF("%s", msg)
-
-#define INFOF(fmt, ...)                debugf("I " fmt, __VA_ARGS__)
-#define INFO(msg)              INFOF("%s", msg)
-
-/**
- * A printf that prints messages through EP6.
- */
-void debugf(const char *format, ...);
-
-#else
-
-#define ERRF(fmt, ...)         ((void)0)
-#define ERR(msg)               ((void)0)
-
-#define WARNF(fmt, ...)                ((void)0)
-#define WARN(msg)              ((void)0)
-
-#define INFOF(fmt, ...)                ((void)0)
-#define INFO(msg)              ((void)0)
-
-#endif