fix: enhance error logging for SPI data transfer and display chip info
This commit is contained in:
@@ -222,6 +222,11 @@ esp_err_t EPDHandler::transfer_spi_data(const uint8_t* data, const size_t& lengt
|
|||||||
esp_err_t ret = spi_device_polling_transmit(spi_, &t);
|
esp_err_t ret = spi_device_polling_transmit(spi_, &t);
|
||||||
if (ret != ESP_OK) {
|
if (ret != ESP_OK) {
|
||||||
ESP_LOGE(TAG, "Failed to send SPI chunk at offset %zu: %s", offset, esp_err_to_name(ret));
|
ESP_LOGE(TAG, "Failed to send SPI chunk at offset %zu: %s", offset, esp_err_to_name(ret));
|
||||||
|
if (ret == ESP_ERR_NO_MEM) {
|
||||||
|
ESP_LOGE(TAG, "Current free heap size: %u bytes", esp_get_free_heap_size());
|
||||||
|
ESP_LOGE(TAG, "Current free DMA-capable memory size: %u bytes",
|
||||||
|
heap_caps_get_free_size(MALLOC_CAP_DMA));
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ void LVGLHandler::touch_read_cb_(lv_indev_t* indev, lv_indev_data_t* data) {
|
|||||||
esp_lcd_touch_get_data(tp_handle, point_data, &touch_cnt, 1);
|
esp_lcd_touch_get_data(tp_handle, point_data, &touch_cnt, 1);
|
||||||
|
|
||||||
if (touch_cnt > 0) {
|
if (touch_cnt > 0) {
|
||||||
ESP_LOGI(TAG, "Touch data read successfully: x=%d, y=%d", point_data[0].x, point_data[0].y);
|
// ESP_LOGI(TAG, "Touch data read successfully: x=%d, y=%d", point_data[0].x, point_data[0].y);
|
||||||
data->point.x = point_data[0].x;
|
data->point.x = point_data[0].x;
|
||||||
data->point.y = point_data[0].y;
|
data->point.y = point_data[0].y;
|
||||||
data->state = LV_INDEV_STATE_PRESSED;
|
data->state = LV_INDEV_STATE_PRESSED;
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ void display_chip_info() {
|
|||||||
(chip_info.features & CHIP_FEATURE_BLE) ? "BLE" : "",
|
(chip_info.features & CHIP_FEATURE_BLE) ? "BLE" : "",
|
||||||
(chip_info.features & CHIP_FEATURE_IEEE802154) ? ", 802.15.4 (Zigbee/Thread), " : "",
|
(chip_info.features & CHIP_FEATURE_IEEE802154) ? ", 802.15.4 (Zigbee/Thread), " : "",
|
||||||
// psram
|
// psram
|
||||||
(chip_info.features & CHIP_FEATURE_EMB_PSRAM) ? "with embedded PSRAM, " : "");
|
(chip_info.features & CHIP_FEATURE_EMB_PSRAM) ? "with embedded PSRAM, " : ""
|
||||||
|
);
|
||||||
|
|
||||||
unsigned major_rev = chip_info.revision / 100;
|
unsigned major_rev = chip_info.revision / 100;
|
||||||
unsigned minor_rev = chip_info.revision % 100;
|
unsigned minor_rev = chip_info.revision % 100;
|
||||||
@@ -39,5 +40,8 @@ void display_chip_info() {
|
|||||||
printf("Minimum free heap size: %" PRIu32 " bytes\n", esp_get_minimum_free_heap_size());
|
printf("Minimum free heap size: %" PRIu32 " bytes\n", esp_get_minimum_free_heap_size());
|
||||||
// psram
|
// psram
|
||||||
printf("PSRAM size: %u bytes\n", esp_psram_get_size());
|
printf("PSRAM size: %u bytes\n", esp_psram_get_size());
|
||||||
|
// dma size
|
||||||
|
printf("DMA-capable memory size: %u bytes\n", heap_caps_get_free_size(MALLOC_CAP_DMA));
|
||||||
|
printf("DMA-capable internal memory size: %u bytes\n", heap_caps_get_free_size(MALLOC_CAP_DMA | MALLOC_CAP_INTERNAL));
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user