From 7c141c231d6c5353054d65e5cf93169c5a9d85b4 Mon Sep 17 00:00:00 2001 From: Michael Copland Date: Tue, 21 Jun 2016 06:35:34 +0100 Subject: Rewritten to use libusb 1.0.20 from libusb.info --- commandline/library/micronucleus_lib.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'commandline/library/micronucleus_lib.h') diff --git a/commandline/library/micronucleus_lib.h b/commandline/library/micronucleus_lib.h index b691fa4..9e1e0f6 100644 --- a/commandline/library/micronucleus_lib.h +++ b/commandline/library/micronucleus_lib.h @@ -6,7 +6,7 @@ (c) 2012 by ihsan Kehribar Changes for Micronucleus protocol version V2.x (c) 2014 T. Bo"scke - + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to @@ -23,14 +23,14 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. + SOFTWARE. */ /******************************************************************************** * Header files ********************************************************************************/ #if defined WIN - #include // this is libusb, see http://libusb.sourceforge.net/ + #include // this is libusb, see http://libusb.sourceforge.net/ #else #include // this is libusb, see http://libusb.sourceforge.net/ #endif @@ -64,7 +64,7 @@ typedef struct _micronucleus_version { // handle representing one micronucleus device typedef struct _micronucleus { - usb_dev_handle *device; + libusb_device_handle *device; // general information about device micronucleus_version version; unsigned int flash_size; // programmable size (in bytes) of progmem -- cgit v1.2.3 From 71b74d37409b17a2d431933cd4c5e96cb986d0f7 Mon Sep 17 00:00:00 2001 From: Michael Copland Date: Wed, 22 Jun 2016 13:36:18 +0100 Subject: Properly close and deinitialize the USB connection --- commandline/library/micronucleus_lib.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'commandline/library/micronucleus_lib.h') diff --git a/commandline/library/micronucleus_lib.h b/commandline/library/micronucleus_lib.h index 9e1e0f6..ce31f97 100644 --- a/commandline/library/micronucleus_lib.h +++ b/commandline/library/micronucleus_lib.h @@ -107,4 +107,10 @@ int micronucleus_writeFlash(micronucleus* deviceHandle, unsigned int program_len int micronucleus_startApp(micronucleus* deviceHandle); /*******************************************************************************/ +/******************************************************************************** +* Disconnects from the device and deinitializes libusb +********************************************************************************/ +void micronucleus_disconnect(micronucleus* deviceHandle); +/*******************************************************************************/ + #endif -- cgit v1.2.3