Skip to content

Commit ca77502

Browse files
authoredMay 9, 2022
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
1 parent d302091 commit ca77502

File tree

27 files changed

+198
-139
lines changed

27 files changed

+198
-139
lines changed
 

Diff for: ‎CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ set(LIBRARY_SRCS
9595
libraries/RainMaker/src/RMakerParam.cpp
9696
libraries/RainMaker/src/RMakerDevice.cpp
9797
libraries/RainMaker/src/RMakerType.cpp
98+
libraries/RainMaker/src/RMakerQR.cpp
99+
libraries/RainMaker/src/RMakerUtils.cpp
98100
libraries/SD_MMC/src/SD_MMC.cpp
99101
libraries/SD/src/SD.cpp
100102
libraries/SD/src/sd_diskio.cpp

Diff for: ‎cores/esp32/esp32-hal-i2c-slave.c

-1
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,6 @@ static void i2c_slave_isr_handler(void* arg)
695695
uint32_t activeInt = i2c_ll_get_intsts_mask(i2c->dev);
696696
i2c_ll_clr_intsts_mask(i2c->dev, activeInt);
697697
uint8_t rx_fifo_len = i2c_ll_get_rxfifo_cnt(i2c->dev);
698-
uint8_t tx_fifo_len = SOC_I2C_FIFO_LEN - i2c_ll_get_txfifo_len(i2c->dev);
699698
bool slave_rw = i2c_ll_slave_rw(i2c->dev);
700699

701700
if(activeInt & I2C_RXFIFO_WM_INT_ENA){ // RX FiFo Full

Diff for: ‎cores/esp32/esp32-hal-tinyusb.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -646,8 +646,9 @@ static void usb_device_task(void *param) {
646646
/*
647647
* PUBLIC API
648648
* */
649-
static const char *tinyusb_interface_names[USB_INTERFACE_MAX] = {"MSC", "DFU", "HID", "VENDOR", "CDC", "MIDI", "CUSTOM"};
650-
649+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_ERROR
650+
const char *tinyusb_interface_names[USB_INTERFACE_MAX] = {"MSC", "DFU", "HID", "VENDOR", "CDC", "MIDI", "CUSTOM"};
651+
#endif
651652
static bool tinyusb_is_initialized = false;
652653

653654
esp_err_t tinyusb_enable_interface(tinyusb_interface_t interface, uint16_t descriptor_len, tinyusb_descriptor_cb_t cb)

Diff for: ‎cores/esp32/esp32-hal-uart.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -538,8 +538,6 @@ void uartStartDetectBaudrate(uart_t *uart) {
538538
return;
539539
}
540540

541-
uart_dev_t *hw = UART_LL_GET_HW(uart->num);
542-
543541
#ifdef CONFIG_IDF_TARGET_ESP32C3
544542

545543
// ESP32-C3 requires further testing
@@ -555,6 +553,7 @@ void uartStartDetectBaudrate(uart_t *uart) {
555553
//hw->conf0.autobaud_en = 1;
556554
#elif CONFIG_IDF_TARGET_ESP32S3
557555
#else
556+
uart_dev_t *hw = UART_LL_GET_HW(uart->num);
558557
hw->auto_baud.glitch_filt = 0x08;
559558
hw->auto_baud.en = 0;
560559
hw->auto_baud.en = 1;
@@ -571,7 +570,6 @@ uartDetectBaudrate(uart_t *uart)
571570
#ifndef CONFIG_IDF_TARGET_ESP32C3 // ESP32-C3 requires further testing - Baud rate detection returns wrong values
572571

573572
static bool uartStateDetectingBaudrate = false;
574-
uart_dev_t *hw = UART_LL_GET_HW(uart->num);
575573

576574
if(!uartStateDetectingBaudrate) {
577575
uartStartDetectBaudrate(uart);
@@ -592,6 +590,7 @@ uartDetectBaudrate(uart_t *uart)
592590
//hw->conf0.autobaud_en = 0;
593591
#elif CONFIG_IDF_TARGET_ESP32S3
594592
#else
593+
uart_dev_t *hw = UART_LL_GET_HW(uart->num);
595594
hw->auto_baud.en = 0;
596595
#endif
597596
uartStateDetectingBaudrate = false; // Initialize for the next round

Diff for: ‎libraries/BluetoothSerial/src/BluetoothSerial.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -973,10 +973,12 @@ bool BluetoothSerial::connect(uint8_t remoteAddress[], int channel, esp_spp_sec_
973973
log_i("master : remoteAddress");
974974
xEventGroupClearBits(_spp_event_group, SPP_CLOSED);
975975
if (channel > 0) {
976+
#if (ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO)
976977
char bda_str[18];
977978
log_i("spp connect to remote %s channel %d",
978979
bda2str(_peer_bd_addr, bda_str, sizeof(bda_str)),
979980
channel);
981+
#endif
980982
if(esp_spp_connect(sec_mask, role, channel, _peer_bd_addr) != ESP_OK ) {
981983
log_e("spp connect failed");
982984
return false;

Diff for: ‎libraries/ESP32/examples/Camera/CameraWebServer/app_httpd.cpp

+61-15
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
static const char *TAG = "camera_httpd";
2929
#endif
3030

31-
// Face Detection will not work on boards without (or with disabled) PSRAM
31+
// Face Detection will not work on boards without (or with disabled) PSRAM
3232
#ifdef BOARD_HAS_PSRAM
3333
#define CONFIG_ESP_FACE_DETECT_ENABLED 1
3434
// Face Recognition takes upward from 15 seconds per frame on chips other than ESP32S3
@@ -148,6 +148,7 @@ static ra_filter_t *ra_filter_init(ra_filter_t *filter, size_t sample_size)
148148
return filter;
149149
}
150150

151+
/* unused function triggers error
151152
static int ra_filter_run(ra_filter_t *filter, int value)
152153
{
153154
if (!filter->values)
@@ -165,6 +166,7 @@ static int ra_filter_run(ra_filter_t *filter, int value)
165166
}
166167
return filter->sum / filter->count;
167168
}
169+
*/
168170

169171
#if CONFIG_ESP_FACE_DETECT_ENABLED
170172
#if CONFIG_ESP_FACE_RECOGNITION_ENABLED
@@ -294,7 +296,9 @@ static esp_err_t bmp_handler(httpd_req_t *req)
294296
{
295297
camera_fb_t *fb = NULL;
296298
esp_err_t res = ESP_OK;
299+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO
297300
uint64_t fr_start = esp_timer_get_time();
301+
#endif
298302
fb = esp_camera_fb_get();
299303
if (!fb)
300304
{
@@ -323,7 +327,9 @@ static esp_err_t bmp_handler(httpd_req_t *req)
323327
}
324328
res = httpd_resp_send(req, (const char *)buf, buf_len);
325329
free(buf);
330+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO
326331
uint64_t fr_end = esp_timer_get_time();
332+
#endif
327333
ESP_LOGI(TAG, "BMP: %llums, %uB", (uint64_t)((fr_end - fr_start) / 1000), buf_len);
328334
return res;
329335
}
@@ -347,7 +353,9 @@ static esp_err_t capture_handler(httpd_req_t *req)
347353
{
348354
camera_fb_t *fb = NULL;
349355
esp_err_t res = ESP_OK;
356+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO
350357
int64_t fr_start = esp_timer_get_time();
358+
#endif
351359

352360
#ifdef CONFIG_LED_ILLUMINATOR_ENABLED
353361
enable_led(true);
@@ -377,26 +385,36 @@ static esp_err_t capture_handler(httpd_req_t *req)
377385
size_t out_len, out_width, out_height;
378386
uint8_t *out_buf;
379387
bool s;
388+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO
380389
bool detected = false;
390+
#endif
381391
int face_id = 0;
382392
if (!detection_enabled || fb->width > 400)
383393
{
384394
#endif
395+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO
385396
size_t fb_len = 0;
397+
#endif
386398
if (fb->format == PIXFORMAT_JPEG)
387399
{
400+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO
388401
fb_len = fb->len;
402+
#endif
389403
res = httpd_resp_send(req, (const char *)fb->buf, fb->len);
390404
}
391405
else
392406
{
393407
jpg_chunking_t jchunk = {req, 0};
394408
res = frame2jpg_cb(fb, 80, jpg_encode_stream, &jchunk) ? ESP_OK : ESP_FAIL;
395409
httpd_resp_send_chunk(req, NULL, 0);
410+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO
396411
fb_len = jchunk.len;
412+
#endif
397413
}
398414
esp_camera_fb_return(fb);
415+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO
399416
int64_t fr_end = esp_timer_get_time();
417+
#endif
400418
ESP_LOGI(TAG, "JPG: %uB %ums", (uint32_t)(fb_len), (uint32_t)((fr_end - fr_start) / 1000));
401419
return res;
402420
#if CONFIG_ESP_FACE_DETECT_ENABLED
@@ -425,12 +443,14 @@ static esp_err_t capture_handler(httpd_req_t *req)
425443
rfb.data = fb->buf;
426444
rfb.bytes_per_pixel = 2;
427445
rfb.format = FB_RGB565;
446+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO
428447
detected = true;
448+
#endif
429449
draw_face_boxes(&rfb, &results, face_id);
430450
}
431451
s = fmt2jpg_cb(fb->buf, fb->len, fb->width, fb->height, PIXFORMAT_RGB565, 90, jpg_encode_stream, &jchunk);
432452
esp_camera_fb_return(fb);
433-
} else
453+
} else
434454
{
435455
out_len = fb->width * fb->height * 3;
436456
out_width = fb->width;
@@ -468,7 +488,9 @@ static esp_err_t capture_handler(httpd_req_t *req)
468488
#endif
469489

470490
if (results.size() > 0) {
491+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO
471492
detected = true;
493+
#endif
472494
#if CONFIG_ESP_FACE_RECOGNITION_ENABLED
473495
if (recognition_enabled) {
474496
face_id = run_face_recognition(&rfb, &results);
@@ -486,8 +508,9 @@ static esp_err_t capture_handler(httpd_req_t *req)
486508
httpd_resp_send_500(req);
487509
return ESP_FAIL;
488510
}
489-
511+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO
490512
int64_t fr_end = esp_timer_get_time();
513+
#endif
491514
ESP_LOGI(TAG, "FACE: %uB %ums %s%d", (uint32_t)(jchunk.len), (uint32_t)((fr_end - fr_start) / 1000), detected ? "DETECTED " : "", face_id);
492515
return res;
493516
#endif
@@ -502,14 +525,15 @@ static esp_err_t stream_handler(httpd_req_t *req)
502525
uint8_t *_jpg_buf = NULL;
503526
char *part_buf[128];
504527
#if CONFIG_ESP_FACE_DETECT_ENABLED
505-
bool detected = false;
528+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO
529+
bool detected = false;
530+
int64_t fr_ready = 0;
531+
int64_t fr_recognize = 0;
532+
int64_t fr_encode = 0;
533+
int64_t fr_face = 0;
534+
int64_t fr_start = 0;
535+
#endif
506536
int face_id = 0;
507-
int64_t fr_start = 0;
508-
int64_t fr_ready = 0;
509-
int64_t fr_face = 0;
510-
int64_t fr_recognize = 0;
511-
int64_t fr_encode = 0;
512-
513537
size_t out_len = 0, out_width = 0, out_height = 0;
514538
uint8_t *out_buf = NULL;
515539
bool s = false;
@@ -544,7 +568,9 @@ static esp_err_t stream_handler(httpd_req_t *req)
544568
while (true)
545569
{
546570
#if CONFIG_ESP_FACE_DETECT_ENABLED
571+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO
547572
detected = false;
573+
#endif
548574
face_id = 0;
549575
#endif
550576

@@ -559,11 +585,13 @@ static esp_err_t stream_handler(httpd_req_t *req)
559585
_timestamp.tv_sec = fb->timestamp.tv_sec;
560586
_timestamp.tv_usec = fb->timestamp.tv_usec;
561587
#if CONFIG_ESP_FACE_DETECT_ENABLED
588+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO
562589
fr_start = esp_timer_get_time();
563590
fr_ready = fr_start;
564-
fr_face = fr_start;
565591
fr_encode = fr_start;
566592
fr_recognize = fr_start;
593+
fr_face = fr_start;
594+
#endif
567595
if (!detection_enabled || fb->width > 400)
568596
{
569597
#endif
@@ -592,23 +620,29 @@ static esp_err_t stream_handler(httpd_req_t *req)
592620
&& !recognition_enabled
593621
#endif
594622
){
623+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO
595624
fr_ready = esp_timer_get_time();
625+
#endif
596626
#if TWO_STAGE
597627
std::list<dl::detect::result_t> &candidates = s1.infer((uint16_t *)fb->buf, {(int)fb->height, (int)fb->width, 3});
598628
std::list<dl::detect::result_t> &results = s2.infer((uint16_t *)fb->buf, {(int)fb->height, (int)fb->width, 3}, candidates);
599629
#else
600630
std::list<dl::detect::result_t> &results = s1.infer((uint16_t *)fb->buf, {(int)fb->height, (int)fb->width, 3});
601631
#endif
632+
#if CONFIG_ESP_FACE_DETECT_ENABLED && ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO
602633
fr_face = esp_timer_get_time();
603634
fr_recognize = fr_face;
635+
#endif
604636
if (results.size() > 0) {
605637
fb_data_t rfb;
606638
rfb.width = fb->width;
607639
rfb.height = fb->height;
608640
rfb.data = fb->buf;
609641
rfb.bytes_per_pixel = 2;
610642
rfb.format = FB_RGB565;
643+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO
611644
detected = true;
645+
#endif
612646
draw_face_boxes(&rfb, &results, face_id);
613647
}
614648
s = fmt2jpg(fb->buf, fb->len, fb->width, fb->height, PIXFORMAT_RGB565, 80, &_jpg_buf, &_jpg_buf_len);
@@ -618,8 +652,10 @@ static esp_err_t stream_handler(httpd_req_t *req)
618652
ESP_LOGE(TAG, "fmt2jpg failed");
619653
res = ESP_FAIL;
620654
}
655+
#if CONFIG_ESP_FACE_DETECT_ENABLED && ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO
621656
fr_encode = esp_timer_get_time();
622-
} else
657+
#endif
658+
} else
623659
{
624660
out_len = fb->width * fb->height * 3;
625661
out_width = fb->width;
@@ -637,7 +673,9 @@ static esp_err_t stream_handler(httpd_req_t *req)
637673
ESP_LOGE(TAG, "to rgb888 failed");
638674
res = ESP_FAIL;
639675
} else {
676+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO
640677
fr_ready = esp_timer_get_time();
678+
#endif
641679

642680
fb_data_t rfb;
643681
rfb.width = out_width;
@@ -653,15 +691,21 @@ static esp_err_t stream_handler(httpd_req_t *req)
653691
std::list<dl::detect::result_t> &results = s1.infer((uint8_t *)out_buf, {(int)out_height, (int)out_width, 3});
654692
#endif
655693

694+
#if CONFIG_ESP_FACE_DETECT_ENABLED && ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO
656695
fr_face = esp_timer_get_time();
657696
fr_recognize = fr_face;
697+
#endif
658698

659699
if (results.size() > 0) {
700+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO
660701
detected = true;
702+
#endif
661703
#if CONFIG_ESP_FACE_RECOGNITION_ENABLED
662704
if (recognition_enabled) {
663705
face_id = run_face_recognition(&rfb, &results);
706+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO
664707
fr_recognize = esp_timer_get_time();
708+
#endif
665709
}
666710
#endif
667711
draw_face_boxes(&rfb, &results, face_id);
@@ -672,7 +716,9 @@ static esp_err_t stream_handler(httpd_req_t *req)
672716
ESP_LOGE(TAG, "fmt2jpg failed");
673717
res = ESP_FAIL;
674718
}
719+
#if CONFIG_ESP_FACE_DETECT_ENABLED && ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO
675720
fr_encode = esp_timer_get_time();
721+
#endif
676722
}
677723
}
678724
}
@@ -710,7 +756,7 @@ static esp_err_t stream_handler(httpd_req_t *req)
710756
}
711757
int64_t fr_end = esp_timer_get_time();
712758

713-
#if CONFIG_ESP_FACE_DETECT_ENABLED
759+
#if CONFIG_ESP_FACE_DETECT_ENABLED && ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO
714760
int64_t ready_time = (fr_ready - fr_start) / 1000;
715761
int64_t face_time = (fr_face - fr_ready) / 1000;
716762
int64_t recognize_time = (fr_recognize - fr_face) / 1000;
@@ -719,9 +765,10 @@ static esp_err_t stream_handler(httpd_req_t *req)
719765
#endif
720766

721767
int64_t frame_time = fr_end - last_frame;
722-
last_frame = fr_end;
723768
frame_time /= 1000;
769+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO
724770
uint32_t avg_frame_time = ra_filter_run(&ra_filter, frame_time);
771+
#endif
725772
ESP_LOGI(TAG, "MJPG: %uB %ums (%.1ffps), AVG: %ums (%.1ffps)"
726773
#if CONFIG_ESP_FACE_DETECT_ENABLED
727774
", %u+%u+%u+%u=%u %s%d"
@@ -743,7 +790,6 @@ static esp_err_t stream_handler(httpd_req_t *req)
743790
enable_led(false);
744791
#endif
745792

746-
last_frame = 0;
747793
return res;
748794
}
749795

Diff for: ‎libraries/ESP32/examples/ResetReason/ResetReason.ino

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
#define uS_TO_S_FACTOR 1000000 /* Conversion factor for micro seconds to seconds */
3232

33-
void print_reset_reason(RESET_REASON reason)
33+
void print_reset_reason(int reason)
3434
{
3535
switch ( reason)
3636
{
@@ -53,7 +53,7 @@ void print_reset_reason(RESET_REASON reason)
5353
}
5454
}
5555

56-
void verbose_print_reset_reason(RESET_REASON reason)
56+
void verbose_print_reset_reason(int reason)
5757
{
5858
switch ( reason)
5959
{

Diff for: ‎libraries/ESP32/examples/Touch/TouchButtonV2/TouchButtonV2.ino

-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ void setup() {
3030
}
3131

3232
void loop() {
33-
static uint32_t count = 0;
34-
3533
if (touch1detected) {
3634
touch1detected = false;
3735
if (touchInterruptGetLastStatus(T1)) {

0 commit comments

Comments
 (0)
Please sign in to comment.