Changeset 563d9d0a in mainline for uspace/lib/usb/include/usb/usb.h


Ignore:
Timestamp:
2011-09-07T10:17:00Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7099861
Parents:
52eead3e
Message:

libusbhost: minor cleanup and fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/include/usb/usb.h

    r52eead3e r563d9d0a  
    3636#define LIBUSB_USB_H_
    3737
     38#include <bool.h>
    3839#include <sys/types.h>
    3940#include <byteorder.h>
     
    130131} usb_target_t;
    131132
     133/** Check USB target for allowed values (address and endpoint).
     134 *
     135 * @param target.
     136 * @return True, if values are wihtin limits, false otherwise.
     137 */
     138static inline bool usb_target_is_valid(usb_target_t target)
     139{
     140        return !(target.endpoint > 15 || target.endpoint < 0
     141            || target.address >= USB11_ADDRESS_MAX || target.address < 0);
     142}
     143
    132144/** Compare USB targets (addresses and endpoints).
    133145 *
Note: See TracChangeset for help on using the changeset viewer.