Update code and StaticAnlysisTest so that missingInclude warnings do not have to...
authorDean Camera <dean@fourwalledcubicle.com>
Sun, 4 Mar 2012 16:15:59 +0000 (16:15 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Sun, 4 Mar 2012 16:15:59 +0000 (16:15 +0000)
Update SingleUSBModeTest makefile to separate out the messages from the test commands.

Bootloaders/HID/HostLoaderApp/hid_bootloader_cli.c
BuildTests/ModuleTest/makefile
BuildTests/SingleUSBModeTest/makefile
BuildTests/StaticAnalysisTest/makefile
Projects/XPLAINBridge/XPLAINBridge.h

index 4fd6ccf..200f406 100644 (file)
@@ -195,7 +195,9 @@ usb_dev_handle * open_usb_device(int vid, int pid)
        struct usb_bus *bus;
        struct usb_device *dev;
        usb_dev_handle *h;
        struct usb_bus *bus;
        struct usb_device *dev;
        usb_dev_handle *h;
+       #ifdef LIBUSB_HAS_GET_DRIVER_NP
        char buf[128];
        char buf[128];
+       #endif
        int r;
 
        usb_init();
        int r;
 
        usb_init();
@@ -390,7 +392,6 @@ int write_usb_device(HANDLE h, void *buf, int len, int timeout)
                if (r != WAIT_OBJECT_0) return 0;
        }
        if (!GetOverlappedResult(h, &ov, &n, FALSE)) return 0;
                if (r != WAIT_OBJECT_0) return 0;
        }
        if (!GetOverlappedResult(h, &ov, &n, FALSE)) return 0;
-       if (n <= 0) return 0;
        return 1;
 }
 
        return 1;
 }
 
index 1930edd..d80e2a2 100644 (file)
@@ -22,7 +22,7 @@ UC3_FAMILIES   = uc3a0256 uc3a1256 uc3a3256 uc3a4256 uc3b0256 uc3b1256
 DEVICE_FAMILIES = $(AVR8_FAMILIES:%=%.avr8) $(XMEGA_FAMILIES:%=%.xmega) $(UC3_FAMILIES:%=%.uc3)\r
 \r
 \r
 DEVICE_FAMILIES = $(AVR8_FAMILIES:%=%.avr8) $(XMEGA_FAMILIES:%=%.xmega) $(UC3_FAMILIES:%=%.uc3)\r
 \r
 \r
-all: begin $(DEVICE_FAMILIES) end\r
+all: begin $(DEVICE_FAMILIES) clean end\r
 \r
 begin:\r
        @echo Executing build test "ModuleTest".\r
 \r
 begin:\r
        @echo Executing build test "ModuleTest".\r
@@ -33,21 +33,21 @@ end:
        @echo\r
 \r
 %.avr8:\r
        @echo\r
 \r
 %.avr8:\r
-       $(MAKE) -f makefile.avr8 clean\r
-       $(MAKE) -f makefile.avr8 all MCU=$(@:%.avr8=%)\r
+       $(MAKE) -f makefile.avr8 clean -s\r
+       $(MAKE) -f makefile.avr8 all MCU=$(@:%.avr8=%) -s\r
 \r
 %.xmega:\r
 \r
 %.xmega:\r
-       $(MAKE) -f makefile.xmega clean\r
-       $(MAKE) -f makefile.xmega all MCU=$(@:%.xmega=%)\r
+       $(MAKE) -f makefile.xmega clean -s\r
+       $(MAKE) -f makefile.xmega all MCU=$(@:%.xmega=%) -s\r
 \r
 %.uc3:\r
 \r
 %.uc3:\r
-       $(MAKE) -f makefile.uc3 clean\r
-       $(MAKE) -f makefile.uc3 all MCU=$(@:%.uc3=%)\r
+       $(MAKE) -f makefile.uc3 clean -s\r
+       $(MAKE) -f makefile.uc3 all MCU=$(@:%.uc3=%) -s\r
 \r
 clean:\r
 \r
 clean:\r
-       $(MAKE) -f makefile.avr8 clean\r
-       $(MAKE) -f makefile.xmega clean\r
-       $(MAKE) -f makefile.uc3 clean\r
+       $(MAKE) -f makefile.avr8 clean -s\r
+       $(MAKE) -f makefile.xmega clean -s\r
+       $(MAKE) -f makefile.uc3 clean -s\r
 \r
 %:\r
        
\ No newline at end of file
 \r
 %:\r
        
\ No newline at end of file
index c147d62..701a4b9 100644 (file)
 # all module headers in a simple C and C++\r
 # application.\r
 \r
 # all module headers in a simple C and C++\r
 # application.\r
 \r
-all:\r
+all: begin compile clean end\r
+\r
+begin:\r
        @echo Executing build test "SingleUSBModeTest".\r
        @echo\r
 \r
        @echo Executing build test "SingleUSBModeTest".\r
        @echo\r
 \r
-       $(MAKE) -f makefile.avr8 clean\r
-       $(MAKE) -f makefile.avr8 LUFA_OPTS='-D USB_DEVICE_ONLY'\r
-       $(MAKE) -f makefile.avr8 clean\r
-       $(MAKE) -f makefile.avr8 LUFA_OPTS='-D USB_HOST_ONLY'\r
+end:\r
+       @echo Build test "SingleUSBModeTest" complete.\r
+       @echo\r
 \r
 \r
-       $(MAKE) -f makefile.xmega clean\r
-       $(MAKE) -f makefile.xmega LUFA_OPTS='-D USB_DEVICE_ONLY'\r
+compile:\r
+       $(MAKE) -f makefile.avr8 clean -s\r
+       $(MAKE) -f makefile.avr8 LUFA_OPTS='-D USB_DEVICE_ONLY' -s\r
+       $(MAKE) -f makefile.avr8 clean -s\r
+       $(MAKE) -f makefile.avr8 LUFA_OPTS='-D USB_HOST_ONLY' -s\r
 \r
 \r
-       $(MAKE) -f makefile.uc3 clean\r
-       $(MAKE) -f makefile.uc3 LUFA_OPTS='-D USB_DEVICE_ONLY'\r
-       $(MAKE) -f makefile.uc3 clean\r
-       $(MAKE) -f makefile.uc3 LUFA_OPTS='-D USB_HOST_ONLY'\r
+       $(MAKE) -f makefile.xmega clean -s\r
+       $(MAKE) -f makefile.xmega LUFA_OPTS='-D USB_DEVICE_ONLY' -s\r
 \r
 \r
-       @echo Build test "SingleUSBModeTest" complete.\r
-       @echo\r
+       $(MAKE) -f makefile.uc3 clean -s\r
+       $(MAKE) -f makefile.uc3 LUFA_OPTS='-D USB_DEVICE_ONLY' -s\r
+       $(MAKE) -f makefile.uc3 clean -s\r
+       $(MAKE) -f makefile.uc3 LUFA_OPTS='-D USB_HOST_ONLY' -s\r
 \r
 clean:\r
 \r
 clean:\r
-       $(MAKE) -f makefile.avr8 clean\r
-       $(MAKE) -f makefile.xmega clean\r
-       $(MAKE) -f makefile.uc3 clean\r
+       $(MAKE) -f makefile.avr8 clean -s\r
+       $(MAKE) -f makefile.xmega clean -s\r
+       $(MAKE) -f makefile.uc3 clean -s\r
 \r
 %:\r
        
\ No newline at end of file
 \r
 %:\r
        
\ No newline at end of file
index 44c7d5f..8b15a71 100644 (file)
@@ -9,19 +9,36 @@
 # Static anlysis of the entire LUFA source tree, using the free cross-platform "cppcheck" tool.\r
 \r
 # Path to the root of the LUFA tree to scan\r
 # Static anlysis of the entire LUFA source tree, using the free cross-platform "cppcheck" tool.\r
 \r
 # Path to the root of the LUFA tree to scan\r
-LUFA_ROOT_PATH    = ../../\r
+LUFA_ROOT_PATH    = ../..\r
 \r
 # Filenames or directories (including fragments) to exclude from the analysis\r
 \r
 # Filenames or directories (including fragments) to exclude from the analysis\r
-EXCLUDE_LIST      = HostLoaderApp/ FATFs/ PetiteFATFs/ uip/\r
+EXCLUDE_LIST      = FATFs/            \\r
+                    PetiteFATFs/      \\r
+                                       uip/\r
 \r
 # Output message template for found warnings and errors\r
 \r
 # Output message template for found warnings and errors\r
-MESSAGE_TEMPLATE  = "{file}({line}): {severity} ({id}): {message}"\r
+MESSAGE_TEMPLATE  = "{file}:{line}: {severity} ({id}): {message}"\r
 \r
 # Checks to suppress so that generated warnings are discarded\r
 \r
 # Checks to suppress so that generated warnings are discarded\r
-SUPPRESS_WARNINGS = variableScope unusedFunction missingInclude\r
+SUPPRESS_WARNINGS = variableScope     \\r
+                    unusedFunction\r
 \r
 \r
-all:\r
-       cppcheck -q --std=c99 --check-config $(EXCLUDE_LIST:%=-i%) $(LUFA_ROOT_PATH)\r
-       cppcheck -q -f --std=c99 --error-exitcode=1 --inline-suppr --enable=all $(SUPPRESS_WARNINGS:%=--suppress=%) --template $(MESSAGE_TEMPLATE) $(EXCLUDE_LIST:%=-i%) $(LUFA_ROOT_PATH)\r
+# Extra paths to search for include files\r
+INCLUDE_PATHS     = $(LUFA_ROOT_PATH)/LUFA/CodeTemplates/\r
+\r
+\r
+all: begin staticcheck end\r
+\r
+begin:\r
+       @echo Executing build test "StaticAnalysisTest".\r
+       @echo\r
+\r
+end:\r
+       @echo Build test "StaticAnalysisTest" complete.\r
+       @echo\r
+\r
+staticcheck:\r
+       cppcheck --quiet --inline-suppr --check-config $(SUPPRESS_WARNINGS:%=--suppress=%) --template=$(MESSAGE_TEMPLATE) $(INCLUDE_PATHS:%=-I%) $(EXCLUDE_LIST:%=-i%) $(LUFA_ROOT_PATH)\r
+       cppcheck --quiet --inline-suppr --error-exitcode=1 --std=c99 --force --enable=all --inconclusive $(SUPPRESS_WARNINGS:%=--suppress=%) --template=$(MESSAGE_TEMPLATE) $(INCLUDE_PATHS:%=-I%) $(EXCLUDE_LIST:%=-i%) $(LUFA_ROOT_PATH)\r
        \r
 %:
\ No newline at end of file
        \r
 %:
\ No newline at end of file
index ea1b77b..f5c86c2 100644 (file)
 
                #include "AVRISPDescriptors.h"
                #include "USARTDescriptors.h"
 
                #include "AVRISPDescriptors.h"
                #include "USARTDescriptors.h"
-
-               #include "Lib/SoftUART.h"
+               
+               // cppcheck-suppress missingInclude
                #include "Lib/V2Protocol.h"
                #include "Lib/V2Protocol.h"
+               #include "Lib/SoftUART.h"
 
                #include <LUFA/Version.h>
                #include <LUFA/Drivers/Board/LEDs.h>
 
                #include <LUFA/Version.h>
                #include <LUFA/Drivers/Board/LEDs.h>