Commit graph

16 commits

Author SHA1 Message Date
Pete Batard
bcc4e517d5 core: fix/silence issues reported by Coverity
* libusb has been added to Coverity at https://scan.coverity.com/projects/2180
* Use "// coverity[keyword]" to silence the issues we don't care about
* All other issues from the Windows build have been fixed, apart from the closing of the DLLs.
2014-05-16 23:01:57 +01:00
hjelmn@cs.unm.edu
1eff220474 Misc: Revert all references to libusb/libusb.info 2014-01-08 23:51:01 +00:00
Ludovic Rousseau
3d84bba0a7 examples: check value returned by ftell()
Problem detected by the Coverity tool
CID 1042546 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)3.
negative_returns: "initial_pos" is passed to a parameter that cannot be
negative.

fseek(3) can't be called with a negative offset with SEEK_SET
2013-10-06 14:26:25 +02:00
Ludovic Rousseau
28d5514e61 examples: fix warning
ezusb.c: In function 'ezusb_load_ram':
ezusb.c:719:6: warning: 'ret' may be used uninitialized in this function
[-Wmaybe-uninitialized]
  int ret;
2013-09-28 13:14:17 +02:00
Ludovic Rousseau
e2babf7ec2 examples: Fix a memory leak
Close the image file before exiting the function

Problem detected by the Coverity tool
CID 1042549 (#2 of 3): Resource leak (RESOURCE_LEAK)9. leaked_storage:
Variable "image" going out of scope leaks the storage it points to.
2013-09-20 14:08:30 +02:00
Ludovic Rousseau
3c2e79cacf examples: Fix a memory leak
Close the image file before exiting the function

Problem detected by the Coverity tool
CID 1042550 (#1 of 15): Resource leak (RESOURCE_LEAK)7. leaked_storage:
Variable "image" going out of scope leaks the storage it points to.
2013-09-20 14:07:57 +02:00
Sean McBride
ce8da723b4 made some globals static to fix warnings 2013-07-30 10:44:13 -06:00
Pete Batard
77a37cba54 Samples: Fix timeout error on FX3 and logging improvements for fxload
* Add a specific ezusb_fx3_jump() that handles timeout as a non-error
  This is required as a successful jump call makes the device disconnect from the bus
* Set default verbosity to 1 and adjust some messages' verbosity level
* Add a new -q option to decrease verbosity
* Add readout of the bootloader version for FX3 devices
* Filter the image types actually supported for FX3
* Fix the "errcode shadows a global variable" warning on some systems
2013-04-14 22:38:52 +01:00
Pete Batard
8aa50632ad Samples: More fxload improvements and cleanup
* Type detection when bus,addr is specified
* Improved check for FX3 image header
* Switch back to using -p for bus,addr and use a comma to
  match the output of listdevs
2013-03-16 23:44:25 +00:00
Ludovic Rousseau
e78d37b2ac Samples: fix compiler warning
Make fx3_load_ram a static function.

ezusb.c:534: warning: no previous prototype for ‘fx3_load_ram’
2013-03-15 09:35:16 +01:00
Federico Manzan
d345a1ed6b Samples: fxload improvements and cleanup
* fix C++ compilation
* use stdint types
* allow to specify bus:address as a parameter
* allocate a buffer when transferring FX3 image and check for R/W errors
2013-03-15 00:46:24 +00:00
Federico Manzan
b74b7f7390 Samples: Add FX3 firmware upload support for fxload 2013-03-10 23:15:46 +00:00
Ludovic Rousseau
ad26880470 Examples: Fix compiler warning
examples/ezusb.c:251:9: warning: implicit conversion loses integer precision: 'unsigned long' to 'unsigned int' [-Wshorten-64-to-32]
                off = strtoul(buf+3, NULL, 16);
                    ~ ^~~~~~~~~~~~~~~~~~~~~~~~
2013-02-15 11:19:05 +01:00
Ludovic Rousseau
38e6eb86b2 All: Use "" instead of <> for local includes
System header files are used with #include <foo.h>
Xcode can't find local headers using this syntax.
2012-10-13 18:34:45 +01:00
Ludovic Rousseau
9d50e95028 Samples: Fix compiler warnings in fxload
ezusb.c: In function  "ezusb_cpucs"
ezusb.c:163: warning: initialization discards qualifiers from pointer target type
ezusb.c: At top level:
ezusb.c:193: warning: no previous prototype for "parse_ihex"
ezusb.c:340: warning: no previous prototype for "parse_bin"
ezusb.c:377: warning: no previous prototype for "parse_iic"
ezusb.c: In function "ram_poke":
ezusb.c:451: warning: enumeration value "_undef" not handled in switch
ezusb.c:491: warning: passing argument 2 of "ezusb_write" discards qualifiers from pointer target type
2012-09-15 15:08:38 +01:00
Pete Batard
05975333c5 Samples: Add fxload sample for Cypress EZ-USB chips
* This program was modified from the original fxload at:
  http://linux-hotplug.sourceforge.net to add libusbx
  as well as non HEX images support.
* Only supports RAM upload for now, with EEPROM and FX3
  support to be added at a later stage.
2012-09-13 23:58:09 +01:00