firmware updated with encoder support, and support for the f031.

This commit is contained in:
Stephen Hawes
2022-07-28 14:40:30 -04:00
parent 51b8ca6efb
commit e51ccdd232
19 changed files with 1874 additions and 0 deletions

26
code/firmware/src/util.h Normal file
View File

@@ -0,0 +1,26 @@
#ifndef _UTIL_H
#define _UTIL_H
#include <stdint.h>
#ifndef NATIVE
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
uint32_t htonl(uint32_t hostlong);
#define htons(x) ( ((x << 8) & 0xff00) | ((x >> 8) & 0xff) )
#define ntohl(x) htonl(x)
#define ntohs(x) htons(x)
#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
#define htonl(x) (x)
#define htons(x) (x)
#define ntohl(x) (x)
#define ntohs(x) (x)
#else
#error Unknown Endianness
#endif
#endif
#endif //_UTIL_H