diff --git a/arch/arm/src/kinetis/chip/kinetis_i2c.h b/arch/arm/src/kinetis/chip/kinetis_i2c.h index c964cf5e731..95cd965ca84 100644 --- a/arch/arm/src/kinetis/chip/kinetis_i2c.h +++ b/arch/arm/src/kinetis/chip/kinetis_i2c.h @@ -251,10 +251,10 @@ # define I2C_FLT_SHIFT (0) /* Bits 0-3: I2C programmable filter factor */ # define I2C_FLT_MASK (15 << I2C_FLT_SHIFT) # define I2C_FLT(n) ((uint8_t)(n) << I2C_FLT_SHIFT) -# define I2C_FLT_STARTF (1 << 4) /* I2C bus start detect flag */ -# define I2C_FLT_SSIE (1 << 5) /* I2C bus stop or start interrupt enable */ -# define I2C_FLT_STOPF (1 << 6) /* I2C bus stop detect flag */ -# define I2C_FLT_SHEN (1 << 7) /* Stop hold enable */ +# define I2C_FLT_STARTF (1 << 4) /* I2C bus start detect flag */ +# define I2C_FLT_SSIE (1 << 5) /* I2C bus stop or start interrupt enable */ +# define I2C_FLT_STOPF (1 << 6) /* I2C bus stop detect flag */ +# define I2C_FLT_SHEN (1 << 7) /* Stop hold enable */ #endif /* I2C Range Address register (8-bit) */ diff --git a/include/cxx/cunistd b/include/cxx/cunistd index b2552d778f8..fc437cc9875 100644 --- a/include/cxx/cunistd +++ b/include/cxx/cunistd @@ -106,7 +106,11 @@ namespace std using ::execv; #endif - // Other + // Byte operations + + using ::swab; + + // getopt and friends using ::getopt; diff --git a/include/unistd.h b/include/unistd.h index 4453c2d4f46..a812533aada 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -203,7 +203,11 @@ int execl(FAR const char *path, ...); int execv(FAR const char *path, FAR char *const argv[]); #endif -/* Other */ +/* Byte operations */ + +void swab(FAR const void *src, FAR void *dest, ssize_t nbytes); + +/* getopt and friends */ int getopt(int argc, FAR char *const argv[], FAR const char *optstring); diff --git a/libc/unistd/Make.defs b/libc/unistd/Make.defs index 2aa942dd3ff..3234a9f7fc5 100644 --- a/libc/unistd/Make.defs +++ b/libc/unistd/Make.defs @@ -1,7 +1,7 @@ ############################################################################ # libc/unistd/Make.defs # -# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2011-2012, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -35,8 +35,8 @@ # Add the unistd C files to the build -CSRCS += lib_access.c lib_getopt.c lib_getoptargp.c lib_getoptindp.c -CSRCS += lib_getoptoptp.c +CSRCS += lib_access.c lib_swab.c +CSRCS += lib_getopt.c lib_getoptargp.c lib_getoptindp.c lib_getoptoptp.c ifneq ($(CONFIG_NFILE_DESCRIPTORS),0) ifneq ($(CONFIG_DISABLE_ENVIRON),y)