summaryrefslogtreecommitdiff
path: root/examples/fxload.c
Commit message (Collapse)AuthorAgeFilesLines
* Update tests and example to use the new libusb_init_context() functionNathan Hjelm2023-01-201-2/+2
| | | | | | | | | This commit updates all test and example code to use the newer libusb_init_context() function instead of libusb_init(). Signed-off-by: Nathan Hjelm <hjelmn@google.com> [Tormod: Update umockdev.c as well] Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
* build: Prepare config.h for inclusion in examples/testsChris Dickens2020-11-271-3/+2
| | | | | | | | | | | | There are certain games played in the examples and tests source to account for differences in build environments and target platforms. This can be simplified by including config.h and using the definitions there. To that end, move the printf function attribute definition from libusbi.h to config.h and leverage it where it is used in the examples and tests. Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* configure.ac: Simplify detection of Windows compilationChris Dickens2020-04-091-2/+2
| | | | | | | | | | | | There are a few parts within the library where code is conditionally compiled based on whether or not the target OS is Windows. Prior to commit 8b09dd490d ("core: Kill the OS_* definitions and use in the source code"), the OS_WINDOWS definition was used. With that definition gone, the checks were replaced with _WIN32. Unfortunately the different cross-platform toolchains do not universally define this, so add this to AM_CPPFLAGS when building for Windows. Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* core: Introduce libusb_set_option() API functionChris Dickens2017-07-161-1/+1
| | | | | | | | | | | | | | This new function allows more flexibility in extending the library to support more user-configurable options. It is intended to provide a single API that can support a wide variety of needs and eliminates the need for new API functions to set future options. The function is introduced with a single option (LIBUSB_OPTION_LOG_LEVEL) that replaces the libusb_set_debug() function. Documentation relating to libusb_set_debug() and the uses of this function in the examples and tests have been updated accordingly. Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* examples: fix 3 compiler warningsLudovic Rousseau2016-03-021-1/+2
| | | | | | | | | | | | | | | | | fxload.c:202:17: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare] ...for (j=0; j<ARRAYSIZE(known_device); j++) { ~^~~~~~~~~~~~~~~~~~~~~~~~ fxload.c:222:12: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare] if (j < ARRAYSIZE(known_device)) { ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~ fxload.c:263:13: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare] for (i=0; i<ARRAYSIZE(path); i++) { ~^~~~~~~~~~~~~~~~ Signed-off-by: Ludovic Rousseau <ludovic.rousseau@free.fr>
* Examples: fxload improvementsChris Dickens2015-08-041-7/+28
| | | | | | | | * Add two-stage load support * Fix leaks in error-handling paths * Closes #12 Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* examples: fix incorrect error message in fxloadCarl Karsten2014-04-071-1/+1
| | | | * Closes #3
* Misc: Revert all references to libusb/libusb.infohjelmn@cs.unm.edu2014-01-081-3/+3
|
* examples: use libusb_set_auto_detach_kernel_driver()Hans de Goede2013-06-191-7/+1
| | | | | | | What better way to show how useful libusb_set_auto_detach_kernel_driver() is, then to use it in our examples? Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Samples: Fix timeout error on FX3 and logging improvements for fxloadPete Batard2013-04-141-6/+11
| | | | | | | | | | * 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
* Samples: More fxload improvements and cleanupPete Batard2013-03-161-51/+63
| | | | | | | * 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
* Samples: fxload improvements and cleanupFederico Manzan2013-03-151-22/+35
| | | | | | | * 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
* Samples: Add FX3 firmware upload support for fxloadFederico Manzan2013-03-101-2/+4
|
* Misc: Simplify includes and misc. cleanupPete Batard2013-02-271-1/+1
| | | | | | | | | | | * fxload sample provenance * No need for <sys/types.h> in samples as already in libusb.h * Don't bother about sscanf_s in xusb * Use HAVE_### and rely on config.h where possible * Formal inclusion of <winsock.h> in libusb.h for WinCE and WDK * Cleanup of Windows' config.h * Avoid ENAMETOOLONG and ENOTEMPTY conflict between errno.h and winsock.h for WinCE * Additional newlines & braces cleanup
* All: Use "" instead of <> for local includesLudovic Rousseau2012-10-131-1/+1
| | | | | System header files are used with #include <foo.h> Xcode can't find local headers using this syntax.
* Samples: Add fxload sample for Cypress EZ-USB chipsPete Batard2012-09-131-0/+261
* 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.