2828#include " fonts/GillSans_25_vlw.h"
2929
3030
31- static const char *TAG = " display " ;
31+ static const char *TAG = " main " ;
3232
3333extern const unsigned char test_card_jpeg_start[] asm (" _binary_test_card_jpeg_start" );
3434extern const unsigned char test_card_jpeg_end[] asm (" _binary_test_card_jpeg_end" );
@@ -47,16 +47,16 @@ extern "C" void app_main(void)
4747{
4848 for (int i = 0 ; i < 5 ; i++) {
4949 vTaskDelay (1000 / portTICK_PERIOD_MS);
50- printf ( " Startup delay %d seconds...\n " , 5 - i);
50+ ESP_LOGI (TAG, " Startup delay %d seconds..." , 5 - i);
5151 }
5252
53- printf ( " Hello world!\n " );
53+ ESP_LOGI (TAG, " Hello world!" );
5454
5555 /* Print chip information */
5656 esp_chip_info_t chip_info;
5757 uint32_t flash_size;
5858 esp_chip_info (&chip_info);
59- printf ( " This is %s chip with %d CPU core(s), %s%s%s%s, " ,
59+ ESP_LOGI (TAG, " This is %s chip with %d CPU core(s), %s%s%s%s" ,
6060 CONFIG_IDF_TARGET,
6161 chip_info.cores ,
6262 (chip_info.features & CHIP_FEATURE_WIFI_BGN) ? " WiFi/" : " " ,
@@ -66,26 +66,27 @@ extern "C" void app_main(void)
6666
6767 unsigned major_rev = chip_info.revision / 100 ;
6868 unsigned minor_rev = chip_info.revision % 100 ;
69- printf (" silicon revision v%d.%d, " , major_rev, minor_rev);
7069 if (esp_flash_get_size (NULL , &flash_size) != ESP_OK) {
71- printf ( " Get flash size failed" );
70+ ESP_LOGE (TAG, " Get flash size failed" );
7271 return ;
7372 }
7473
75- printf (" %" PRIu32 " MB %s flash\n " , flash_size / (uint32_t )(1024 * 1024 ),
74+ ESP_LOGI (TAG, " Silicon revision v%d.%d, %" PRIu32 " MB %s flash" ,
75+ major_rev, minor_rev,
76+ flash_size / (uint32_t )(1024 * 1024 ),
7677 (chip_info.features & CHIP_FEATURE_EMB_FLASH) ? " embedded" : " external" );
7778
7879 {
7980 uint32_t freq_hz = 0 ;
8081 esp_err_t ret = esp_clk_tree_src_get_freq_hz (SOC_MOD_CLK_CPU, ESP_CLK_TREE_SRC_FREQ_PRECISION_APPROX, &freq_hz);
8182 if (ret == ESP_OK) {
82- printf ( " CPU clock: %" PRIu32 " MHz\n " , freq_hz / 1000000u );
83+ ESP_LOGI (TAG, " CPU clock: %" PRIu32 " MHz" , freq_hz / 1000000u );
8384 } else {
84- printf ( " CPU clock: unknown (err=%d)\n " , (int )ret);
85+ ESP_LOGW (TAG, " CPU clock: unknown (err=%d)" , (int )ret);
8586 }
8687 }
8788
88- printf ( " Minimum free heap size: %" PRIu32 " bytes\n " , esp_get_minimum_free_heap_size ());
89+ ESP_LOGI (TAG, " Minimum free heap size: %" PRIu32 " bytes" , esp_get_minimum_free_heap_size ());
8990
9091 static Display display (320 , 240 );
9192 static const JpegEncoder encoder (JpegEncoder::Config{
0 commit comments