X-Git-Url: https://codewiz.org/gitweb?p=rmslog.git;a=blobdiff_plain;f=FAT16%2Fbyteordering.c;fp=FAT16%2Fbyteordering.c;h=69330c98117187aa2b185d15c6628f7dc1da5d62;hp=0000000000000000000000000000000000000000;hb=a93a61d1163833d9bdee2026ba5a89a8863bf802;hpb=3bf87cc3ac05c14e3fd921fa35333d946386b660 diff --git a/FAT16/byteordering.c b/FAT16/byteordering.c new file mode 100644 index 0000000..69330c9 --- /dev/null +++ b/FAT16/byteordering.c @@ -0,0 +1,62 @@ + +/* + * Copyright (c) 2006-2009 by Roland Riegel + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of either the GNU General Public License version 2 + * or the GNU Lesser General Public License version 2.1, both as + * published by the Free Software Foundation. + */ + +#include "byteordering.h" + +/** + * \addtogroup byteordering + * + * Architecture-dependent handling of byte-ordering. + * + * @{ + */ +/** + * \file + * Byte-order handling implementation (license: GPLv2 or LGPLv2.1) + * + * \author Roland Riegel + */ + +#if !(__AVR__) +/** + * Converts a 16-bit integer to little-endian byte order. + * + * Use this function on variable values instead of the + * macro HTOL16(). This saves code size. + * + * \param[in] h A 16-bit integer in host byte order. + * \returns The given 16-bit integer converted to little-endian byte order. + */ +uint16_t htol16(uint16_t h) +{ + return HTOL16(h); +} +#endif + +#if !(__AVR__) +/** + * Converts a 32-bit integer to little-endian byte order. + * + * Use this function on variable values instead of the + * macro HTOL32(). This saves code size. + * + * \param[in] h A 32-bit integer in host byte order. + * \returns The given 32-bit integer converted to little-endian byte order. + */ +uint32_t htol32(uint32_t h) +{ + return HTOL32(h); +} +#endif + +/** + * @} + */ +