deprecate ftdi_enable_bitbang()
authorGerd v. Egidy <gerd.von.egidy@intra2net.com>
Sun, 13 Dec 2009 01:10:07 +0000 (02:10 +0100)
committerGerd v. Egidy <gerd.von.egidy@intra2net.com>
Sun, 13 Dec 2009 01:10:07 +0000 (02:10 +0100)
- it's superseded for a long time by ftdi_set_bitmode()
- it reads the mode to set from ftdi->bitbang_mode which is an unexpected interface and can lead to wrong results

src/ftdi.c
src/ftdi.h

index 9630bfe..6068e7e 100644 (file)
@@ -1599,7 +1599,7 @@ int ftdi_read_data_get_chunksize(struct ftdi_context *ftdi, unsigned int *chunks
 /**
     Enable bitbang mode.
 
-    For advanced bitbang modes of the FT2232C chip use ftdi_set_bitmode().
+    \deprecated use \ref ftdi_set_bitmode with mode BITMODE_BITBANG instead
 
     \param ftdi pointer to ftdi_context
     \param bitmask Bitmask to configure lines.
@@ -1648,7 +1648,7 @@ int ftdi_disable_bitbang(struct ftdi_context *ftdi)
     \param ftdi pointer to ftdi_context
     \param bitmask Bitmask to configure lines.
            HIGH/ON value configures a line as output.
-    \param mode Bitbang mode: use the values defined in \ref ftdi_mpsse_mode, use BITMODE_RESET to switch off bitbang
+    \param mode Bitbang mode: use the values defined in \ref ftdi_mpsse_mode
 
     \retval  0: all fine
     \retval -1: can't enable bitbang mode
index b518f96..810e074 100644 (file)
@@ -148,6 +148,16 @@ enum ftdi_interface
    (taken from libusb) */
 #define FTDI_URB_USERCONTEXT_COOKIE ((void *)0x1)
 
+#ifdef __GNUC__
+    #define DEPRECATED(func) func __attribute__ ((deprecated))
+#elif defined(_MSC_VER)
+    #define DEPRECATED(func) __declspec(deprecated) func
+#else
+    #pragma message("WARNING: You need to implement DEPRECATED for this compiler")
+    #define DEPRECATED(func) func
+#endif
+
+
 /**
     \brief Main context structure for all libftdi functions.
 
@@ -318,7 +328,7 @@ extern "C"
     int ftdi_write_data_async(struct ftdi_context *ftdi, unsigned char *buf, int size);
     void ftdi_async_complete(struct ftdi_context *ftdi, int wait_for_more);
 
-    int ftdi_enable_bitbang(struct ftdi_context *ftdi, unsigned char bitmask);
+    int DEPRECATED(ftdi_enable_bitbang(struct ftdi_context *ftdi, unsigned char bitmask));
     int ftdi_disable_bitbang(struct ftdi_context *ftdi);
     int ftdi_set_bitmode(struct ftdi_context *ftdi, unsigned char bitmask, unsigned char mode);
     int ftdi_read_pins(struct ftdi_context *ftdi, unsigned char *pins);