This commit is contained in:
RoboSchmied 2024-04-26 23:45:58 +02:00 committed by GitHub
parent b6c8a85f33
commit ca8d008a2e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 12 additions and 12 deletions

View File

@ -210,7 +210,7 @@ void spi_mast_blkget(uint8 spi_no, size_t bitlen, uint8 *data)
os_memcpy((void *)data, (void *)SPI_W0(spi_no), aligned_len); os_memcpy((void *)data, (void *)SPI_W0(spi_no), aligned_len);
} }
static uint32 swap_endianess(uint32 n) static uint32 swap_endianness(uint32 n)
{ {
return ((n & 0xff) << 24) | return ((n & 0xff) << 24) |
((n & 0xff00) << 8) | ((n & 0xff00) << 8) |
@ -248,10 +248,10 @@ void spi_mast_set_mosi(uint8 spi_no, uint16 offset, uint8 bitlen, uint32 data)
// transfer Wn to buf // transfer Wn to buf
spi_buf.word[1] = READ_PERI_REG(SPI_W0(spi_no) + wn*4); spi_buf.word[1] = READ_PERI_REG(SPI_W0(spi_no) + wn*4);
spi_buf.word[1] = swap_endianess(spi_buf.word[1]); spi_buf.word[1] = swap_endianness(spi_buf.word[1]);
if (wn < 15) { if (wn < 15) {
spi_buf.word[0] = READ_PERI_REG(SPI_W0(spi_no) + (wn+1)*4); spi_buf.word[0] = READ_PERI_REG(SPI_W0(spi_no) + (wn+1)*4);
spi_buf.word[0] = swap_endianess(spi_buf.word[0]); spi_buf.word[0] = swap_endianness(spi_buf.word[0]);
} }
shift = 64 - (offset & 0x1f) - bitlen; shift = 64 - (offset & 0x1f) - bitlen;
@ -259,9 +259,9 @@ void spi_mast_set_mosi(uint8 spi_no, uint16 offset, uint8 bitlen, uint32 data)
spi_buf.dword |= (uint64)data << shift; spi_buf.dword |= (uint64)data << shift;
if (wn < 15) { if (wn < 15) {
WRITE_PERI_REG(SPI_W0(spi_no) + (wn+1)*4, swap_endianess(spi_buf.word[0])); WRITE_PERI_REG(SPI_W0(spi_no) + (wn+1)*4, swap_endianness(spi_buf.word[0]));
} }
WRITE_PERI_REG(SPI_W0(spi_no) + wn*4, swap_endianess(spi_buf.word[1])); WRITE_PERI_REG(SPI_W0(spi_no) + wn*4, swap_endianness(spi_buf.word[1]));
return; return;
} }
@ -293,10 +293,10 @@ uint32 spi_mast_get_miso(uint8 spi_no, uint16 offset, uint8 bitlen)
// transfer Wn to buf // transfer Wn to buf
spi_buf.word[1] = READ_PERI_REG(SPI_W0(spi_no) + wn*4); spi_buf.word[1] = READ_PERI_REG(SPI_W0(spi_no) + wn*4);
spi_buf.word[1] = swap_endianess(spi_buf.word[1]); spi_buf.word[1] = swap_endianness(spi_buf.word[1]);
if (wn < 15) { if (wn < 15) {
spi_buf.word[0] = READ_PERI_REG(SPI_W0(spi_no) + (wn+1)*4); spi_buf.word[0] = READ_PERI_REG(SPI_W0(spi_no) + (wn+1)*4);
spi_buf.word[0] = swap_endianess(spi_buf.word[0]); spi_buf.word[0] = swap_endianness(spi_buf.word[0]);
} }
result = (uint32)(spi_buf.dword >> (64 - ((offset & 0x1f) + bitlen))); result = (uint32)(spi_buf.dword >> (64 - ((offset & 0x1f) + bitlen)));

View File

@ -51,7 +51,7 @@ extern "C" {
* 'a' is expected to be 'higher' (without overflow) than 'b'. */ * 'a' is expected to be 'higher' (without overflow) than 'b'. */
#define LWIP_U32_DIFF(a, b) (((a) >= (b)) ? ((a) - (b)) : (((a) + ((b) ^ 0xFFFFFFFF) + 1))) #define LWIP_U32_DIFF(a, b) (((a) >= (b)) ? ((a) - (b)) : (((a) + ((b) ^ 0xFFFFFFFF) + 1)))
/* Endianess-optimized shifting of two u8_t to create one u16_t */ /* Endianness-optimized shifting of two u8_t to create one u16_t */
#if BYTE_ORDER == LITTLE_ENDIAN #if BYTE_ORDER == LITTLE_ENDIAN
#define LWIP_MAKE_U16(a, b) ((a << 8) | b) #define LWIP_MAKE_U16(a, b) ((a << 8) | b)
#else #else

View File

@ -75,7 +75,7 @@
* @return host order (!) lwip checksum (non-inverted Internet sum) * @return host order (!) lwip checksum (non-inverted Internet sum)
* *
* @note accumulator size limits summable length to 64k * @note accumulator size limits summable length to 64k
* @note host endianess is irrelevant (p3 RFC1071) * @note host endianness is irrelevant (p3 RFC1071)
*/ */
static u16_t ICACHE_FLASH_ATTR static u16_t ICACHE_FLASH_ATTR
lwip_standard_chksum(void *dataptr, u16_t len) lwip_standard_chksum(void *dataptr, u16_t len)

View File

@ -1111,7 +1111,7 @@ int mbedtls_aes_crypt_cbc( mbedtls_aes_context *ctx,
#if defined(MBEDTLS_CIPHER_MODE_XTS) #if defined(MBEDTLS_CIPHER_MODE_XTS)
/* Endianess with 64 bits values */ /* Endianness with 64 bits values */
#ifndef GET_UINT64_LE #ifndef GET_UINT64_LE
#define GET_UINT64_LE(n,b,i) \ #define GET_UINT64_LE(n,b,i) \
{ \ { \
@ -1147,7 +1147,7 @@ typedef unsigned char mbedtls_be128[16];
* *
* This function multiplies a field element by x in the polynomial field * This function multiplies a field element by x in the polynomial field
* representation. It uses 64-bit word operations to gain speed but compensates * representation. It uses 64-bit word operations to gain speed but compensates
* for machine endianess and hence works correctly on both big and little * for machine endianness and hence works correctly on both big and little
* endian machines. * endian machines.
*/ */
static void mbedtls_gf128mul_x_ble( unsigned char r[16], static void mbedtls_gf128mul_x_ble( unsigned char r[16],

View File

@ -155,7 +155,7 @@ static int gettoalign (size_t len, Header *h, int opt, size_t size) {
/* /*
** options to control endianess and alignment ** options to control endianness and alignment
*/ */
static void controloptions (lua_State *L, int opt, const char **fmt, static void controloptions (lua_State *L, int opt, const char **fmt,
Header *h) { Header *h) {