This is an automated email from Gerrit.

"Antonio Borneo <[email protected]>" just uploaded a new patch set to 
Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9797

-- gerrit

commit 3a325d038bdc8f19c029011b1ae912823fd51148
Author: Antonio Borneo <[email protected]>
Date:   Thu Jul 23 16:08:35 2026 +0200

    jtag: ep93xx: replace nanosleep() with usleep()
    
    Both nanosleep() and usleep() are not compliant with C99 but are in
    use in OpenOCD code through the compile macro _GNU_SOURCE.
    While usleep() is widely used in the code, nanosleep() is used only
    in one file.
    
    Uniform the code base replacing nanosleep() with usleep().
    
    Change-Id: I7e94411ce8c556fe54ea5708611703fe3a08887c
    Signed-off-by: Antonio Borneo <[email protected]>

diff --git a/src/jtag/drivers/ep93xx.c b/src/jtag/drivers/ep93xx.c
index f3e1676f9f..61262e64ef 100644
--- a/src/jtag/drivers/ep93xx.c
+++ b/src/jtag/drivers/ep93xx.c
@@ -20,6 +20,8 @@
 #define SRST_BIT       32
 #define VCC_BIT                64
 
+#define EP93XX_DELAY_US 10000
+
 #include <sys/mman.h>
 
 static uint8_t output_value;
@@ -37,8 +39,6 @@ static int ep93xx_reset(int trst, int srst);
 static int ep93xx_init(void);
 static int ep93xx_quit(void);
 
-static struct timespec ep93xx_zzzz;
-
 static struct jtag_interface ep93xx_interface = {
        .supported = DEBUG_CAP_TMS_SEQ,
        .execute_queue = bitbang_execute_queue,
@@ -85,7 +85,7 @@ static int ep93xx_write(int tck, int tms, int tdi)
                output_value &= ~TDI_BIT;
 
        *gpio_data_register = output_value;
-       nanosleep(&ep93xx_zzzz, NULL);
+       usleep(EP93XX_DELAY_US);
 
        return ERROR_OK;
 }
@@ -104,7 +104,7 @@ static int ep93xx_reset(int trst, int srst)
                output_value &= ~SRST_BIT;
 
        *gpio_data_register = output_value;
-       nanosleep(&ep93xx_zzzz, NULL);
+       usleep(EP93XX_DELAY_US);
 
        return ERROR_OK;
 }
@@ -133,9 +133,6 @@ static int ep93xx_init(void)
 
        bitbang_interface = &ep93xx_bitbang;
 
-       ep93xx_zzzz.tv_sec = 0;
-       ep93xx_zzzz.tv_nsec = 10000000;
-
        dev_mem_fd = open("/dev/mem", O_RDWR | O_SYNC);
        if (dev_mem_fd < 0) {
                LOG_ERROR("open: %s", strerror(errno));
@@ -189,7 +186,7 @@ static int ep93xx_init(void)
         */
        output_value = TMS_BIT | TRST_BIT | SRST_BIT | VCC_BIT;
        *gpio_data_register = output_value;
-       nanosleep(&ep93xx_zzzz, NULL);
+       usleep(EP93XX_DELAY_US);
 
        /*
         * Configure the direction register.  1 = output, 0 = input.
@@ -197,7 +194,7 @@ static int ep93xx_init(void)
        *gpio_data_direction_register =
                TDI_BIT | TCK_BIT | TMS_BIT | TRST_BIT | SRST_BIT | VCC_BIT;
 
-       nanosleep(&ep93xx_zzzz, NULL);
+       usleep(EP93XX_DELAY_US);
        return ERROR_OK;
 }
 

-- 

Reply via email to