diff --git a/builder/family/realtek-ambz2.py b/builder/family/realtek-ambz2.py index 5e9b3ed..53a933b 100644 --- a/builder/family/realtek-ambz2.py +++ b/builder/family/realtek-ambz2.py @@ -222,9 +222,11 @@ queue.AddLibrary( "-Wno-parentheses", "-Wno-implicit-function-declaration", "-Wno-misleading-indentation", - # TODO remove this; only for example_wlan_fast_connect.c + "-Wno-unused-value", + # TODO remove this; only for example_wlan_fast_connect.c and at_cmd/* "-Wno-format-truncation", "-Wno-return-type", + "-Wno-unused-variable", ], ), ) diff --git a/cores/common/base/compat/udp.h b/cores/common/base/compat/udp.h index 70524e9..280996b 100644 --- a/cores/common/base/compat/udp.h +++ b/cores/common/base/compat/udp.h @@ -7,4 +7,5 @@ // this is included only by wifi_simple_config.c // which uses lwip_ntohl without parentheses // so the #define from lwip/def.h doesn't work +#undef lwip_ntohl #define lwip_ntohl lwip_htonl diff --git a/cores/common/base/lt_common_api.c b/cores/common/base/lt_common_api.c index 54a83e6..d73ca0c 100644 --- a/cores/common/base/lt_common_api.c +++ b/cores/common/base/lt_common_api.c @@ -33,7 +33,7 @@ void hexdump(const uint8_t *buf, size_t len, uint32_t offset, uint8_t width) { uint16_t pos = 0; while (pos < len) { // print hex offset - printf("%06x ", offset + pos); + printf("%06lx ", offset + pos); // calculate current line width uint8_t lineWidth = MIN(width, len - pos); // print hexadecimal representation diff --git a/cores/common/base/lt_logger.c b/cores/common/base/lt_logger.c index 795a125..8678ead 100644 --- a/cores/common/base/lt_logger.c +++ b/cores/common/base/lt_logger.c @@ -1,9 +1,7 @@ /* Copyright (c) Kuba SzczodrzyƄski 2022-04-28. */ #include "lt_logger.h" - -#include -#include +#include #if LT_HAS_PRINTF #include diff --git a/cores/realtek-amb/base/port/fal_flash_ambz_port.c b/cores/realtek-amb/base/port/fal_flash_ambz_port.c index 951d2ba..3e5b7f3 100644 --- a/cores/realtek-amb/base/port/fal_flash_ambz_port.c +++ b/cores/realtek-amb/base/port/fal_flash_ambz_port.c @@ -17,7 +17,7 @@ static int read(long offset, uint8_t *buf, size_t size) { } static int write(long offset, const uint8_t *buf, size_t size) { - return size * flash_stream_write(NULL, offset, size, buf); + return size * flash_stream_write(NULL, offset, size, (uint8_t *)buf); } static int erase(long offset, size_t size) { diff --git a/cores/realtek-amb/base/port/printf.c b/cores/realtek-amb/base/port/printf.c index 7217451..f6112e1 100644 --- a/cores/realtek-amb/base/port/printf.c +++ b/cores/realtek-amb/base/port/printf.c @@ -12,10 +12,10 @@ extern uint32_t UART_Writable(void *UARTx); extern void UART_CharPut(void *UARTx, uint8_t TxData); -static const void *uart_dev[3] = { - UART0_REG_BASE, - UART1_REG_BASE, - LOG_UART_REG_BASE, +static void *uart_dev[3] = { + (void *)UART0_REG_BASE, + (void *)UART1_REG_BASE, + (void *)LOG_UART_REG_BASE, }; uint8_t lt_uart_port = 2; diff --git a/cores/realtek-amb/base/sdk_private.h b/cores/realtek-amb/base/sdk_private.h index f582d4a..2164233 100644 --- a/cores/realtek-amb/base/sdk_private.h +++ b/cores/realtek-amb/base/sdk_private.h @@ -13,6 +13,8 @@ extern "C" { #define boolean boolean_rtl // fix conflicts with Arduino's PinMode enum #define PinMode PinModeRTL +// remove log_printf() if included before sdk_private.h +#undef log_printf #include // define string macros first #undef isdigit // then remove them, as they conflict