[realtek-amb] Fix or suppress compilation warnings

This commit is contained in:
Kuba Szczodrzyński
2023-03-03 18:31:36 +01:00
parent e8c18f4e66
commit 47daefe675
7 changed files with 13 additions and 10 deletions

View File

@@ -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",
],
),
)

View File

@@ -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

View File

@@ -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

View File

@@ -1,9 +1,7 @@
/* Copyright (c) Kuba Szczodrzyński 2022-04-28. */
#include "lt_logger.h"
#include <stdarg.h>
#include <stdint.h>
#include <sdk_private.h>
#if LT_HAS_PRINTF
#include <printf/printf.h>

View File

@@ -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) {

View File

@@ -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;

View File

@@ -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 <strproc.h> // define string macros first
#undef isdigit // then remove them, as they conflict