mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-30 19:19:21 +00:00
feat(build): add COMPILER_STATIC_ANALYZER option
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "driver/gpio.h"
|
||||
#include "esp_log.h"
|
||||
#include "esp_check.h"
|
||||
#include "esp_compiler.h"
|
||||
|
||||
static const char *TAG = "lcd_panel.nt35510";
|
||||
|
||||
@@ -61,6 +62,8 @@ esp_lcd_new_panel_nt35510(const esp_lcd_panel_io_handle_t io, const esp_lcd_pane
|
||||
esp_err_t ret = ESP_OK;
|
||||
nt35510_panel_t *nt35510 = NULL;
|
||||
ESP_GOTO_ON_FALSE(io && panel_dev_config && ret_panel, ESP_ERR_INVALID_ARG, err, TAG, "invalid argument");
|
||||
// leak detection of nt35510 because saving nt35510->base address
|
||||
ESP_COMPILER_DIAGNOSTIC_PUSH_IGNORE("-Wanalyzer-malloc-leak")
|
||||
nt35510 = calloc(1, sizeof(nt35510_panel_t));
|
||||
ESP_GOTO_ON_FALSE(nt35510, ESP_ERR_NO_MEM, err, TAG, "no mem for nt35510 panel");
|
||||
|
||||
@@ -131,6 +134,7 @@ err:
|
||||
free(nt35510);
|
||||
}
|
||||
return ret;
|
||||
ESP_COMPILER_DIAGNOSTIC_POP("-Wanalyzer-malloc-leak")
|
||||
}
|
||||
|
||||
static esp_err_t panel_nt35510_del(esp_lcd_panel_t *panel)
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "driver/gpio.h"
|
||||
#include "esp_log.h"
|
||||
#include "esp_check.h"
|
||||
#include "esp_compiler.h"
|
||||
|
||||
static const char *TAG = "lcd_panel.ssd1306";
|
||||
|
||||
@@ -73,6 +74,8 @@ esp_err_t esp_lcd_new_panel_ssd1306(const esp_lcd_panel_io_handle_t io, const es
|
||||
ESP_GOTO_ON_FALSE(io && panel_dev_config && ret_panel, ESP_ERR_INVALID_ARG, err, TAG, "invalid argument");
|
||||
ESP_GOTO_ON_FALSE(panel_dev_config->bits_per_pixel == 1, ESP_ERR_INVALID_ARG, err, TAG, "bpp must be 1");
|
||||
esp_lcd_panel_ssd1306_config_t *ssd1306_spec_config = (esp_lcd_panel_ssd1306_config_t *)panel_dev_config->vendor_config;
|
||||
// leak detection of ssd1306 because saving ssd1306->base address
|
||||
ESP_COMPILER_DIAGNOSTIC_PUSH_IGNORE("-Wanalyzer-malloc-leak")
|
||||
ssd1306 = calloc(1, sizeof(ssd1306_panel_t));
|
||||
ESP_GOTO_ON_FALSE(ssd1306, ESP_ERR_NO_MEM, err, TAG, "no mem for ssd1306 panel");
|
||||
|
||||
@@ -111,6 +114,7 @@ err:
|
||||
free(ssd1306);
|
||||
}
|
||||
return ret;
|
||||
ESP_COMPILER_DIAGNOSTIC_POP("-Wanalyzer-malloc-leak")
|
||||
}
|
||||
|
||||
static esp_err_t panel_ssd1306_del(esp_lcd_panel_t *panel)
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "driver/gpio.h"
|
||||
#include "esp_log.h"
|
||||
#include "esp_check.h"
|
||||
#include "esp_compiler.h"
|
||||
|
||||
#define ST7789_CMD_RAMCTRL 0xb0
|
||||
#define ST7789_DATA_LITTLE_ENDIAN_BIT (1 << 3)
|
||||
@@ -66,6 +67,8 @@ esp_lcd_new_panel_st7789(const esp_lcd_panel_io_handle_t io, const esp_lcd_panel
|
||||
esp_err_t ret = ESP_OK;
|
||||
st7789_panel_t *st7789 = NULL;
|
||||
ESP_GOTO_ON_FALSE(io && panel_dev_config && ret_panel, ESP_ERR_INVALID_ARG, err, TAG, "invalid argument");
|
||||
// leak detection of st7789 because saving st7789->base address
|
||||
ESP_COMPILER_DIAGNOSTIC_PUSH_IGNORE("-Wanalyzer-malloc-leak")
|
||||
st7789 = calloc(1, sizeof(st7789_panel_t));
|
||||
ESP_GOTO_ON_FALSE(st7789, ESP_ERR_NO_MEM, err, TAG, "no mem for st7789 panel");
|
||||
|
||||
@@ -139,6 +142,7 @@ err:
|
||||
free(st7789);
|
||||
}
|
||||
return ret;
|
||||
ESP_COMPILER_DIAGNOSTIC_POP("-Wanalyzer-malloc-leak")
|
||||
}
|
||||
|
||||
static esp_err_t panel_st7789_del(esp_lcd_panel_t *panel)
|
||||
|
Reference in New Issue
Block a user