This is an automated email from Gerrit.

Mathias K?ster ([email protected]) just uploaded a new patch set to Gerrit, 
which you can find at http://openocd.zylin.com/396

-- gerrit

commit 5536e270db8e39a6b45a737a416dddf5863d01f8
Author: Mathias K <[email protected]>
Date:   Fri Jan 20 23:02:27 2012 +0100

    STLINK: Test device version (v1/v2) on usb transfers
    
    This patch test the device version and differentiate between
    v1 and v2 devices. The older v1 devices are not supported
    yet.
    
    Change-Id: Ie79bf2c5534211493b004329fb6d5b9d4ea5453b
    Signed-off-by: Mathias K <[email protected]>

diff --git a/src/jtag/drivers/stlink_usb.c b/src/jtag/drivers/stlink_usb.c
index 1d20094..4b83cd6 100644
--- a/src/jtag/drivers/stlink_usb.c
+++ b/src/jtag/drivers/stlink_usb.c
@@ -131,7 +131,7 @@ enum eSTLinkMode {
 };
 
 /** */
-static int stlink_usb_recv(void *handle, const uint8_t *txbuf, int txsize, 
uint8_t *rxbuf,
+static int stlink_usb_recv_v2(void *handle, const uint8_t *txbuf, int txsize, 
uint8_t *rxbuf,
                    int rxsize)
 {
        struct stlink_usb_handle_s *h;
@@ -154,6 +154,23 @@ static int stlink_usb_recv(void *handle, const uint8_t 
*txbuf, int txsize, uint8
 }
 
 /** */
+static int stlink_usb_recv(void *handle, const uint8_t *txbuf, int txsize, 
uint8_t *rxbuf,
+                   int rxsize)
+{
+       struct stlink_usb_handle_s *h;
+
+       assert(handle != NULL);
+
+       h = (struct stlink_usb_handle_s *)handle;
+
+       if ( h->version.stlink == 1 ) {
+               return ERROR_FAIL;
+       } else {
+               return stlink_usb_recv_v2(handle, txbuf, txsize, rxbuf, rxsize 
);
+       }
+}
+
+/** */
 static void stlink_usb_init_buffer(void *handle)
 {
        struct stlink_usb_handle_s *h;

-- 

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to