X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fjtag%2Fpresto.c;h=1d03bdd12db80022bcfbe6af8a51755a39f73a2c;hp=385c93c019390b21eee0304cb5bd65b5cdb5367c;hb=3813fda44adcea486b7308423a699f63d79273ee;hpb=86e4324f1bd4cd8135cb857e4b940b1f2e872dc3 diff --git a/src/jtag/presto.c b/src/jtag/presto.c index 385c93c019..1d03bdd12d 100644 --- a/src/jtag/presto.c +++ b/src/jtag/presto.c @@ -150,7 +150,8 @@ static int presto_write(uint8_t *buf, uint32_t size) if (ftbytes != size) { - LOG_ERROR("couldn't write the requested number of bytes to PRESTO (%u < %u)", (uint32_t)ftbytes, size); + LOG_ERROR("couldn't write the requested number of bytes to PRESTO (%u < %u)", + (unsigned)ftbytes, (unsigned)size); return ERROR_JTAG_DEVICE_ERROR; } @@ -192,7 +193,8 @@ static int presto_read(uint8_t* buf, uint32_t size) if (ftbytes != size) { /* this is just a warning, there might have been timeout when detecting PRESTO, which is not fatal */ - LOG_WARNING("couldn't read the requested number of bytes from PRESTO (%u < %u)", (uint32_t)ftbytes, size); + LOG_WARNING("couldn't read the requested number of bytes from PRESTO (%u < %u)", + (unsigned)ftbytes, (unsigned)size); return ERROR_JTAG_DEVICE_ERROR; } @@ -277,7 +279,7 @@ static int presto_open_ftd2xx(char *req_serial) if ((presto->status = FT_Read(presto->handle, &presto_data, 1, &ftbytes)) != FT_OK) return ERROR_JTAG_DEVICE_ERROR; - if (ftbytes!=1) + if (ftbytes != 1) { LOG_DEBUG("PRESTO reset"); @@ -311,7 +313,7 @@ static int presto_open_ftd2xx(char *req_serial) if ((presto->status = FT_Read(presto->handle, &presto_data, 1, &ftbytes)) != FT_OK) return ERROR_JTAG_DEVICE_ERROR; - if (ftbytes!=1) + if (ftbytes != 1) { LOG_DEBUG("PRESTO not responding"); return ERROR_JTAG_DEVICE_ERROR; @@ -532,7 +534,7 @@ static int presto_sendbyte(int data) if (presto->buff_out_pos >= BUFFER_SIZE) #elif BUILD_PRESTO_LIBFTDI == 1 /* libftdi does not do background read, be sure that USB IN buffer does not overflow (128 bytes only!) */ - if (presto->buff_out_pos >= BUFFER_SIZE || presto->buff_in_exp==128) + if (presto->buff_out_pos >= BUFFER_SIZE || presto->buff_in_exp == 128) #endif return presto_flush(); @@ -650,14 +652,14 @@ static int presto_bitq_flush(void) static int presto_bitq_in_rdy(void) { - if (presto->buff_in_pos>=presto->buff_in_len) + if (presto->buff_in_pos >= presto->buff_in_len) return 0; return presto->buff_in_len-presto->buff_in_pos; } static int presto_bitq_in(void) { - if (presto->buff_in_pos>=presto->buff_in_len) + if (presto->buff_in_pos >= presto->buff_in_len) return -1; if (presto->buff_in[presto->buff_in_pos++]&0x08) return 1; return 0;