Commit 96290994 authored by Alessandro Rubini's avatar Alessandro Rubini

userspace/libwr: remove unused function

We don't need to print binary and get mad with static storage.
If any, we print hex.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent ba60ebdd
......@@ -165,7 +165,7 @@ static int i2c_bitbang_transfer(i2c_bus_t * bus, uint32_t address,
if (bus->type != I2C_TYPE_BITBANG)
return I2C_BUS_MISMATCH;
//TRACE(TRACE_INFO,"%s (0x%x) @ 0x%x: w=%d/r=%d; cmd=%d d=%d (0b%s)",bus->name,bus,address,to_write,to_read,data[0],data[1],shw_2binary(data[1]));
//TRACE(TRACE_INFO,"%s (0x%x) @ 0x%x: w=%d/r=%d; cmd=%d d=%d (0x%02x)",bus->name,bus,address,to_write,to_read,data[0],data[1],(data[1]));
struct i2c_bitbang *ts = (struct i2c_bitbang *)bus->type_specific;
......
......@@ -7,7 +7,6 @@
#define atoidef(str,def) (str)?atoi(str):def
void shw_udelay(uint32_t microseconds);
const char *shw_2binary(uint8_t x);
uint64_t shw_get_tics();
#endif /* __LIBWR_HW_UTIL_H */
......@@ -28,20 +28,3 @@ uint64_t shw_get_tics()
return (uint64_t) tv.tv_usec + (uint64_t) tv.tv_sec * 1000000ULL;
}
/**
* \brief Helper function to quickly display byte into binary code.
* WARNING: this returns static storage
*/
const char *shw_2binary(uint8_t x)
{
static char b[9];
int z;
char *p = b;
for (z = 0x80; z > 0; z >>= 1) {
*p++ = (((x & z) == z) ? '1' : '0');
}
*p = '\0';
return b;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment