libftdi: (tomj) fixed eeprom writing
authorThomas Jarosch <opensource@intra2net.com>
Thu, 17 Jul 2003 15:44:12 +0000 (15:44 +0000)
committerThomas Jarosch <opensource@intra2net.com>
Thu, 17 Jul 2003 15:44:12 +0000 (15:44 +0000)
ftdi/ftdi.c
ftdi/ftdi.h

index afd91f9..bd45248 100644 (file)
@@ -189,7 +189,7 @@ int ftdi_set_baudrate(struct ftdi_context *ftdi, int baudrate) {
 }
 
 
-int ftdi_write_data(struct ftdi_context *ftdi, char *buf, int size) {
+int ftdi_write_data(struct ftdi_context *ftdi, unsigned char *buf, int size) {
     int ret;
     int offset = 0;
     while (offset < size) {
@@ -209,7 +209,7 @@ int ftdi_write_data(struct ftdi_context *ftdi, char *buf, int size) {
 }
 
 
-int ftdi_read_data(struct ftdi_context *ftdi, char *buf, int size) {
+int ftdi_read_data(struct ftdi_context *ftdi, unsigned char *buf, int size) {
     /*
       unsigned char buf[64];
       int read_bytes;
@@ -468,7 +468,7 @@ int ftdi_eeprom_build(struct ftdi_eeprom *eeprom, unsigned char *output) {
 }
 
 
-int ftdi_read_eeprom(struct ftdi_context *ftdi, char *eeprom) {
+int ftdi_read_eeprom(struct ftdi_context *ftdi, unsigned char *eeprom) {
     int i;
 
     for (i = 0; i < 64; i++) {
@@ -482,7 +482,7 @@ int ftdi_read_eeprom(struct ftdi_context *ftdi, char *eeprom) {
 }
 
 
-int ftdi_write_eeprom(struct ftdi_context *ftdi, char *eeprom) {
+int ftdi_write_eeprom(struct ftdi_context *ftdi, unsigned char *eeprom) {
     unsigned short usb_val;
     int i;
 
index df959ad..9e8615a 100644 (file)
@@ -65,8 +65,8 @@ extern "C" {
     int ftdi_usb_reset(struct ftdi_context *ftdi);
 
     int ftdi_set_baudrate(struct ftdi_context *ftdi, int baudrate);
-    int ftdi_write_data(struct ftdi_context *ftdi, char *buf, int size);
-    int ftdi_read_data(struct ftdi_context *ftdi, char *buf, int size);
+    int ftdi_write_data(struct ftdi_context *ftdi, unsigned char *buf, int size);
+    int ftdi_read_data(struct ftdi_context *ftdi, unsigned char *buf, int size);
 
     int ftdi_enable_bitbang(struct ftdi_context *ftdi, unsigned char bitmask);
     int ftdi_disable_bitbang(struct ftdi_context *ftdi);
@@ -81,8 +81,8 @@ extern "C" {
 
     // "eeprom" needs to be valid 128 byte eeprom (generated by the eeprom generator)
     // the checksum of the eeprom is valided
-    int ftdi_read_eeprom(struct ftdi_context *ftdi, char *eeprom);
-    int ftdi_write_eeprom(struct ftdi_context *ftdi, char *eeprom);
+    int ftdi_read_eeprom(struct ftdi_context *ftdi, unsigned char *eeprom);
+    int ftdi_write_eeprom(struct ftdi_context *ftdi, unsigned char *eeprom);
     int ftdi_erase_eeprom(struct ftdi_context *ftdi);
 
 #ifdef __cplusplus