Move includes to header

This commit is contained in:
Jonathan Bennett 2025-06-01 14:42:55 -05:00
parent c3d8f775e1
commit a22190f92f
2 changed files with 7 additions and 8 deletions

View File

@ -19,13 +19,6 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "ch341a_i2c.h" #include "ch341a_i2c.h"
#include <assert.h>
#include <errno.h>
#include <libusb-1.0/libusb.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// extern struct libusb_device_handle *handle; // extern struct libusb_device_handle *handle;
unsigned char *readbuf; unsigned char *readbuf;
@ -151,7 +144,7 @@ int32_t ch341readEEPROM_param(uint8_t *buffer, uint32_t offset, uint32_t bytesto
if (ret < 0 || getnextpkt == -1) { // indicates an error if (ret < 0 || getnextpkt == -1) { // indicates an error
printf("ret from libusb_handle_timeout = %d\n", ret); printf("ret from libusb_handle_timeout = %d\n", ret);
printf("getnextpkt = %d\n", getnextpkt); printf("getnextpkt = %u\n", getnextpkt);
if (ret < 0) if (ret < 0)
printf("USB read error : %s\n", strerror(-ret)); printf("USB read error : %s\n", strerror(-ret));
libusb_free_transfer(xferBulkIn); libusb_free_transfer(xferBulkIn);

View File

@ -4,7 +4,13 @@
#ifndef __CH341A_I2C_H__ #ifndef __CH341A_I2C_H__
#define __CH341A_I2C_H__ #define __CH341A_I2C_H__
#include <assert.h>
#include <errno.h>
#include <libusb-1.0/libusb.h>
#include <stdint.h> #include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define BULK_WRITE_ENDPOINT 0x02 /* bEndpointAddress 0x02 EP 2 OUT (Bulk)*/ #define BULK_WRITE_ENDPOINT 0x02 /* bEndpointAddress 0x02 EP 2 OUT (Bulk)*/
#define BULK_READ_ENDPOINT 0x82 /* bEndpointAddress 0x82 EP 2 IN (Bulk)*/ #define BULK_READ_ENDPOINT 0x82 /* bEndpointAddress 0x82 EP 2 IN (Bulk)*/