[riot-notifications] [RIOT] drivers/srf02: some optimizations (#3783)

Peter Kietzmann notifications at github.com
Mon Sep 7 10:33:05 CEST 2015


> -    i2c_acquire(dev->i2c);
> -    status = i2c_read_reg(dev->i2c, dev->addr,
> -                      SRF02_RANGE_LOW_BYTE, &range_low_byte);
> -    /* Release the bus for other threads. */
> -    i2c_release(dev->i2c);
> -
> -    if (status < 0) {
> -        DEBUG("Read the low echo byte from the i2c-interface is failed");
> -        distance = UINT16_MAX;
> -        return distance;
> -    }
> -
> -    distance = (range_high_byte << 8) | (range_low_byte);
> -
> -    return distance;
> +    /* compile result - TODO: fix for different host byte order other than LE */

Is that really the plan? If so we need to update several drivers I guess...

---
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/3783/files#r38842624
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20150907/5f58bcef/attachment.html>


More information about the notifications mailing list