hello_world: fix incorrect printf format

spi_flash_get_chip_size return a size_t to printf this type it's better to use %u than %d.

We didn't use %zu because it will be ignored by "nano" printf (i.e. when
CONFIG_NEWLIB_NANO_FORMAT is on).

Closes https://github.com/espressif/esp-idf/pull/8900
This commit is contained in:
huardti
2022-05-04 17:06:10 +01:00
committed by morris
parent 3f66660444
commit a01820c583
2 changed files with 11 additions and 14 deletions

View File

@@ -1,11 +1,9 @@
/* Hello World Example /*
* SPDX-FileCopyrightText: 2010-2022 Espressif Systems (Shanghai) CO LTD
This example code is in the Public Domain (or CC0 licensed, at your option.) *
* SPDX-License-Identifier: CC0-1.0
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/ */
#include <stdio.h> #include <stdio.h>
#include "sdkconfig.h" #include "sdkconfig.h"
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"
@@ -28,7 +26,7 @@ void app_main(void)
printf("silicon revision %d, ", chip_info.revision); printf("silicon revision %d, ", chip_info.revision);
printf("%dMB %s flash\n", spi_flash_get_chip_size() / (1024 * 1024), printf("%uMB %s flash\n", spi_flash_get_chip_size() / (1024 * 1024),
(chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "embedded" : "external"); (chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "embedded" : "external");
printf("Minimum free heap size: %d bytes\n", esp_get_minimum_free_heap_size()); printf("Minimum free heap size: %d bytes\n", esp_get_minimum_free_heap_size());

View File

@@ -2032,7 +2032,6 @@ examples/ethernet/iperf/main/ethernet_example_main.c
examples/get-started/blink/example_test.py examples/get-started/blink/example_test.py
examples/get-started/blink/main/blink_example_main.c examples/get-started/blink/main/blink_example_main.c
examples/get-started/hello_world/example_test.py examples/get-started/hello_world/example_test.py
examples/get-started/hello_world/main/hello_world_main.c
examples/get-started/sample_project/main/main.c examples/get-started/sample_project/main/main.c
examples/mesh/internal_communication/main/include/mesh_light.h examples/mesh/internal_communication/main/include/mesh_light.h
examples/mesh/internal_communication/main/mesh_light.c examples/mesh/internal_communication/main/mesh_light.c