Unverified Commit ca77502c authored by Tomáš Pilný's avatar Tomáš Pilný Committed by GitHub

Added compiler.warning_flags to platform.txt; fixing #6118 (#6596)

Summary

Added compiler.warning_flags to all chips in platform.txt to reflect users setting of warning level output during compilation (set up in Arduino IDE preferences)

Impact

When a warning is set to none the compilation will no longer display warnings

Related links

Solves issue #6118
parent d3020912
......@@ -95,6 +95,8 @@ set(LIBRARY_SRCS
libraries/RainMaker/src/RMakerParam.cpp
libraries/RainMaker/src/RMakerDevice.cpp
libraries/RainMaker/src/RMakerType.cpp
libraries/RainMaker/src/RMakerQR.cpp
libraries/RainMaker/src/RMakerUtils.cpp
libraries/SD_MMC/src/SD_MMC.cpp
libraries/SD/src/SD.cpp
libraries/SD/src/sd_diskio.cpp
......
......@@ -695,7 +695,6 @@ static void i2c_slave_isr_handler(void* arg)
uint32_t activeInt = i2c_ll_get_intsts_mask(i2c->dev);
i2c_ll_clr_intsts_mask(i2c->dev, activeInt);
uint8_t rx_fifo_len = i2c_ll_get_rxfifo_cnt(i2c->dev);
uint8_t tx_fifo_len = SOC_I2C_FIFO_LEN - i2c_ll_get_txfifo_len(i2c->dev);
bool slave_rw = i2c_ll_slave_rw(i2c->dev);
if(activeInt & I2C_RXFIFO_WM_INT_ENA){ // RX FiFo Full
......
......@@ -646,8 +646,9 @@ static void usb_device_task(void *param) {
/*
* PUBLIC API
* */
static const char *tinyusb_interface_names[USB_INTERFACE_MAX] = {"MSC", "DFU", "HID", "VENDOR", "CDC", "MIDI", "CUSTOM"};
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_ERROR
const char *tinyusb_interface_names[USB_INTERFACE_MAX] = {"MSC", "DFU", "HID", "VENDOR", "CDC", "MIDI", "CUSTOM"};
#endif
static bool tinyusb_is_initialized = false;
esp_err_t tinyusb_enable_interface(tinyusb_interface_t interface, uint16_t descriptor_len, tinyusb_descriptor_cb_t cb)
......
......@@ -538,8 +538,6 @@ void uartStartDetectBaudrate(uart_t *uart) {
return;
}
uart_dev_t *hw = UART_LL_GET_HW(uart->num);
#ifdef CONFIG_IDF_TARGET_ESP32C3
// ESP32-C3 requires further testing
......@@ -555,6 +553,7 @@ void uartStartDetectBaudrate(uart_t *uart) {
//hw->conf0.autobaud_en = 1;
#elif CONFIG_IDF_TARGET_ESP32S3
#else
uart_dev_t *hw = UART_LL_GET_HW(uart->num);
hw->auto_baud.glitch_filt = 0x08;
hw->auto_baud.en = 0;
hw->auto_baud.en = 1;
......@@ -571,7 +570,6 @@ uartDetectBaudrate(uart_t *uart)
#ifndef CONFIG_IDF_TARGET_ESP32C3 // ESP32-C3 requires further testing - Baud rate detection returns wrong values
static bool uartStateDetectingBaudrate = false;
uart_dev_t *hw = UART_LL_GET_HW(uart->num);
if(!uartStateDetectingBaudrate) {
uartStartDetectBaudrate(uart);
......@@ -592,6 +590,7 @@ uartDetectBaudrate(uart_t *uart)
//hw->conf0.autobaud_en = 0;
#elif CONFIG_IDF_TARGET_ESP32S3
#else
uart_dev_t *hw = UART_LL_GET_HW(uart->num);
hw->auto_baud.en = 0;
#endif
uartStateDetectingBaudrate = false; // Initialize for the next round
......
......@@ -973,10 +973,12 @@ bool BluetoothSerial::connect(uint8_t remoteAddress[], int channel, esp_spp_sec_
log_i("master : remoteAddress");
xEventGroupClearBits(_spp_event_group, SPP_CLOSED);
if (channel > 0) {
#if (ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO)
char bda_str[18];
log_i("spp connect to remote %s channel %d",
bda2str(_peer_bd_addr, bda_str, sizeof(bda_str)),
channel);
#endif
if(esp_spp_connect(sec_mask, role, channel, _peer_bd_addr) != ESP_OK ) {
log_e("spp connect failed");
return false;
......
......@@ -30,7 +30,7 @@
#define uS_TO_S_FACTOR 1000000 /* Conversion factor for micro seconds to seconds */
void print_reset_reason(RESET_REASON reason)
void print_reset_reason(int reason)
{
switch ( reason)
{
......@@ -53,7 +53,7 @@ void print_reset_reason(RESET_REASON reason)
}
}
void verbose_print_reset_reason(RESET_REASON reason)
void verbose_print_reset_reason(int reason)
{
switch ( reason)
{
......
......@@ -30,8 +30,6 @@ void setup() {
}
void loop() {
static uint32_t count = 0;
if (touch1detected) {
touch1detected = false;
if (touchInterruptGetLastStatus(T1)) {
......
......@@ -57,24 +57,25 @@ extern void tcpipInit();
static eth_clock_mode_t eth_clock_mode = ETH_CLK_MODE;
#if CONFIG_ETH_RMII_CLK_INPUT
/*
static void emac_config_apll_clock(void)
{
/* apll_freq = xtal_freq * (4 + sdm2 + sdm1/256 + sdm0/65536)/((o_div + 2) * 2) */
// apll_freq = xtal_freq * (4 + sdm2 + sdm1/256 + sdm0/65536)/((o_div + 2) * 2)
rtc_xtal_freq_t rtc_xtal_freq = rtc_clk_xtal_freq_get();
switch (rtc_xtal_freq) {
case RTC_XTAL_FREQ_40M: // Recommended
/* 50 MHz = 40MHz * (4 + 6) / (2 * (2 + 2) = 50.000 */
/* sdm0 = 0, sdm1 = 0, sdm2 = 6, o_div = 2 */
// 50 MHz = 40MHz * (4 + 6) / (2 * (2 + 2) = 50.000
// sdm0 = 0, sdm1 = 0, sdm2 = 6, o_div = 2
rtc_clk_apll_enable(true, 0, 0, 6, 2);
break;
case RTC_XTAL_FREQ_26M:
/* 50 MHz = 26MHz * (4 + 15 + 118 / 256 + 39/65536) / ((3 + 2) * 2) = 49.999992 */
/* sdm0 = 39, sdm1 = 118, sdm2 = 15, o_div = 3 */
// 50 MHz = 26MHz * (4 + 15 + 118 / 256 + 39/65536) / ((3 + 2) * 2) = 49.999992
// sdm0 = 39, sdm1 = 118, sdm2 = 15, o_div = 3
rtc_clk_apll_enable(true, 39, 118, 15, 3);
break;
case RTC_XTAL_FREQ_24M:
/* 50 MHz = 24MHz * (4 + 12 + 255 / 256 + 255/65536) / ((2 + 2) * 2) = 49.499977 */
/* sdm0 = 255, sdm1 = 255, sdm2 = 12, o_div = 2 */
// 50 MHz = 24MHz * (4 + 12 + 255 / 256 + 255/65536) / ((2 + 2) * 2) = 49.499977
// sdm0 = 255, sdm1 = 255, sdm2 = 12, o_div = 2
rtc_clk_apll_enable(true, 255, 255, 12, 2);
break;
default: // Assume we have a 40M xtal
......@@ -82,8 +83,10 @@ static void emac_config_apll_clock(void)
break;
}
}
*/
#endif
/*
static esp_err_t on_lowlevel_init_done(esp_eth_handle_t eth_handle){
#if CONFIG_IDF_TARGET_ESP32
if(eth_clock_mode > ETH_CLOCK_GPIO17_OUT){
......@@ -168,7 +171,7 @@ static esp_err_t on_lowlevel_init_done(esp_eth_handle_t eth_handle){
#endif
return ESP_OK;
}
*/
/**
......
......@@ -988,7 +988,6 @@ void I2SClass::_post_read_data_fix(void *input, size_t *size){
// bytes_written - number of bytes used from original buffer
// actual_bytes_written - number of bytes written by i2s_write after fix
void I2SClass::_fix_and_write(void *output, size_t size, size_t *bytes_written, size_t *actual_bytes_written){
long start = millis();
ulong src_ptr = 0;
uint8_t* buff = NULL;
size_t buff_size = size;
......
......@@ -36,6 +36,7 @@ void sysProvEvent(arduino_event_t *sys_event)
printQR(service_name, pop, "ble");
#endif
break;
default:;
}
}
......
......@@ -50,6 +50,7 @@ void sysProvEvent(arduino_event_t *sys_event)
Serial.printf("\nConnected to Wi-Fi!\n");
digitalWrite(gpio_led, true);
break;
default:;
}
}
......
......@@ -35,6 +35,7 @@ void sysProvEvent(arduino_event_t *sys_event)
printQR(service_name, pop, "ble");
#endif
break;
default:;
}
}
......
#include "RMakerQR.h"
#ifdef CONFIG_ESP_RMAKER_WORK_QUEUE_TASK_STACK
void printQR(const char *name, const char *pop, const char *transport)
{
if (!name || !pop || !transport) {
log_w("Cannot generate QR code payload. Data missing.");
return;
}
char payload[150];
snprintf(payload, sizeof(payload), "{\"ver\":\"%s\",\"name\":\"%s\"" \
",\"pop\":\"%s\",\"transport\":\"%s\"}",
PROV_QR_VERSION, name, pop, transport);
if(Serial){
Serial.printf("Scan this QR code from the ESP RainMaker phone app.\n");
}
qrcode_display(payload);
if(Serial){
Serial.printf("If QR code is not visible, copy paste the below URL in a browser.\n%s?data=%s\n", QRCODE_BASE_URL, payload);
}
}
#endif
\ No newline at end of file
......@@ -14,24 +14,12 @@
#pragma once
#include "sdkconfig.h"
#ifdef CONFIG_ESP_RMAKER_WORK_QUEUE_TASK_STACK
#include "RMaker.h"
#include "esp_system.h"
#include <qrcode.h>
#define PROV_QR_VERSION "v1"
#define QRCODE_BASE_URL "https://rainmaker.espressif.com/qrcode.html"
static void printQR(const char *name, const char *pop, const char *transport)
{
if (!name || !pop || !transport) {
log_w("Cannot generate QR code payload. Data missing.");
return;
}
char payload[150];
snprintf(payload, sizeof(payload), "{\"ver\":\"%s\",\"name\":\"%s\"" \
",\"pop\":\"%s\",\"transport\":\"%s\"}",
PROV_QR_VERSION, name, pop, transport);
Serial.printf("Scan this QR code from the ESP RainMaker phone app.\n");
qrcode_display(payload);
Serial.printf("If QR code is not visible, copy paste the below URL in a browser.\n%s?data=%s\n", QRCODE_BASE_URL, payload);
}
void printQR(const char *name, const char *pop, const char *transport);
#endif
\ No newline at end of file
#include "RMakerUtils.h"
#ifdef CONFIG_ESP_RMAKER_WORK_QUEUE_TASK_STACK
void RMakerFactoryReset(int seconds)
{
esp_rmaker_factory_reset(0, seconds);
}
void RMakerWiFiReset(int seconds)
{
esp_rmaker_wifi_reset(0, seconds);
}
#endif
\ No newline at end of file
......@@ -14,16 +14,10 @@
#pragma once
#include "sdkconfig.h"
#ifdef CONFIG_ESP_RMAKER_WORK_QUEUE_TASK_STACK
#include "RMaker.h"
#include "esp_system.h"
#include <esp_rmaker_utils.h>
static void RMakerFactoryReset(int seconds)
{
esp_rmaker_factory_reset(0, seconds);
}
static void RMakerWiFiReset(int seconds)
{
esp_rmaker_wifi_reset(0, seconds);
}
void RMakerFactoryReset(int seconds);
void RMakerWiFiReset(int seconds);
#endif
\ No newline at end of file
......@@ -20,7 +20,7 @@ static void vendorEventCallback(void* arg, esp_event_base_t event_base, int32_t
case ARDUINO_USB_HID_VENDOR_SET_FEATURE_EVENT:
Serial.printf("HID VENDOR SET FEATURE: len:%u\n", data->len);
for(uint16_t i=0; i<data->len; i++){
Serial.printf("0x%02X ",data->buffer);
Serial.printf("0x%02X ",*(data->buffer));
}
Serial.println();
break;
......
......@@ -42,7 +42,9 @@ static bool tinyusb_hid_is_initialized = false;
static uint8_t tinyusb_loaded_hid_devices_num = 0;
static uint16_t tinyusb_hid_device_descriptor_len = 0;
static uint8_t * tinyusb_hid_device_descriptor = NULL;
static const char * tinyusb_hid_device_report_types[4] = {"INVALID", "INPUT", "OUTPUT", "FEATURE"};
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG
static const char * tinyusb_hid_device_report_types[4] = {"INVALID", "INPUT", "OUTPUT", "FEATURE"};
#endif
static bool tinyusb_enable_hid_device(uint16_t descriptor_len, USBHIDDevice * device){
if(tinyusb_hid_is_initialized){
......
......@@ -274,7 +274,6 @@ size_t USBHIDKeyboard::releaseRaw(uint8_t k)
// call release(), releaseAll(), or otherwise clear the report and resend.
size_t USBHIDKeyboard::press(uint8_t k)
{
uint8_t i;
if (k >= 0x88) { // it's a non-printing key (not a modifier)
k = k - 0x88;
} else if (k >= 0x80) { // it's a modifier key
......@@ -298,7 +297,6 @@ size_t USBHIDKeyboard::press(uint8_t k)
// it shouldn't be repeated any more.
size_t USBHIDKeyboard::release(uint8_t k)
{
uint8_t i;
if (k >= 0x88) { // it's a non-printing key (not a modifier)
k = k - 0x88;
} else if (k >= 0x80) { // it's a modifier key
......
......@@ -18,7 +18,7 @@
void setup()
{
bool err = ESP_FAIL;
bool err = false;
Serial.begin(115200);
// Set WiFi to station mode and disconnect from an AP if it was previously connected
......@@ -36,7 +36,7 @@ void setup()
* https://docs.espressif.com/projects/arduino-esp32/en/latest/api/wifi.html
*/
if(err == ESP_FAIL) {
if(err == false) {
Serial.println("Dual Antenna configuration failed!");
} else {
Serial.println("Dual Antenna configuration successfuly done!");
......
This diff is collapsed.
......@@ -42,33 +42,6 @@ extern "C" {
#include "lwip/err.h"
}
static const char * cipher_str(int cipher)
{
switch (cipher) {
case WIFI_CIPHER_TYPE_NONE:
return ("NONE");
break;
case WIFI_CIPHER_TYPE_WEP40:
return ("WEP40");
break;
case WIFI_CIPHER_TYPE_WEP104:
return ("WEP104");
break;
case WIFI_CIPHER_TYPE_TKIP:
return ("TKIP");
break;
case WIFI_CIPHER_TYPE_CCMP:
return ("CCMP");
break;
case WIFI_CIPHER_TYPE_TKIP_CCMP:
return ("TKIP_CCMP");
break;
default:
break;
}
return ("UNKNOWN");
}
bool WiFiScanClass::_scanAsync = false;
uint32_t WiFiScanClass::_scanStarted = 0;
uint32_t WiFiScanClass::_scanTimeout = 10000;
......
......@@ -22,8 +22,6 @@
#define BUNDLE_HEADER_OFFSET 2
#define CRT_HEADER_OFFSET 4
static const char *TAG = "esp-x509-crt-bundle";
/* a dummy certificate so that
* cacert_ptr passes non-NULL check during handshake */
static mbedtls_x509_crt s_dummy_crt;
......
......@@ -66,15 +66,6 @@ static void get_device_service_name(prov_scheme_t prov_scheme, char *service_nam
#endif
}
static esp_err_t custom_prov_data_handler(uint32_t session_id, const uint8_t *inbuf, ssize_t inlen, uint8_t **outbuf, ssize_t *outlen, void *priv_data){
if (inbuf) {
log_d("Received data: %.*s", inlen, (char *)inbuf);
}
*outbuf = NULL;
*outlen = 0;
return ESP_OK;
}
void WiFiProvClass :: beginProvision(prov_scheme_t prov_scheme, scheme_handler_t scheme_handler, wifi_prov_security_t security, const char * pop, const char *service_name, const char *service_key, uint8_t * uuid)
{
bool provisioned = false;
......
......@@ -374,6 +374,9 @@ size_t TwoWire::requestFrom(uint16_t address, size_t size, bool sendStop)
rxIndex = 0;
rxLength = 0;
err = i2cWriteReadNonStop(num, address, txBuffer, txLength, rxBuffer, size, _timeOutMillis, &rxLength);
if(err){
log_e("i2cWriteReadNonStop returned Error %d", err);
}
} else {
#if !CONFIG_DISABLE_HAL_LOCKS
//acquire lock
......@@ -385,6 +388,9 @@ size_t TwoWire::requestFrom(uint16_t address, size_t size, bool sendStop)
rxIndex = 0;
rxLength = 0;
err = i2cRead(num, address, rxBuffer, size, _timeOutMillis, &rxLength);
if(err){
log_e("i2cRead returned Error %d", err);
}
}
#if !CONFIG_DISABLE_HAL_LOCKS
//release lock
......
......@@ -86,9 +86,9 @@ build.extra_flags.esp32c3=-DARDUINO_USB_MODE=1 -DARDUINO_USB_CDC_ON_BOOT={build.
# Compile Flags
compiler.cpreprocessor.flags={compiler.cpreprocessor.flags.{build.mcu}} "-I{compiler.sdk.path}/{build.memory_type}/include"
compiler.c.flags={compiler.c.flags.{build.mcu}}
compiler.cpp.flags={compiler.cpp.flags.{build.mcu}}
compiler.S.flags={compiler.S.flags.{build.mcu}}
compiler.c.flags={compiler.c.flags.{build.mcu}} {compiler.warning_flags}
compiler.cpp.flags={compiler.cpp.flags.{build.mcu}} {compiler.warning_flags}
compiler.S.flags={compiler.S.flags.{build.mcu}} {compiler.warning_flags}
compiler.c.elf.flags={compiler.c.elf.flags.{build.mcu}}
compiler.c.elf.libs={compiler.c.elf.libs.{build.mcu}}
compiler.ar.flags={compiler.ar.flags.{build.mcu}}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment