不仅屏幕又坏了 还关不了机

This commit is contained in:
2026-03-19 09:47:59 +08:00
parent 5b10c85646
commit 29a74c2118
2 changed files with 12 additions and 33 deletions
+8 -7
View File
@@ -10,11 +10,11 @@ uint8_t epd_buffer_old[EPD_BUFFER_SIZE] = {0}; // 显存缓冲区
const unsigned char gImage_basemap[9600] = { /* 0X00,0X01,0XF0,0X00,0X40,0X01, */
0X00,0XF0,0X0F,0XFF,0Xee,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X0F,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X0F,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X00,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X0F,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
@@ -806,7 +806,7 @@ static void epd_set_ram_from_bitmap(const unsigned char * datas)
epd_update();
epd_power_off();
}
@@ -819,7 +819,7 @@ static void epd_init_vram()
epd_send_data_bulk(epd_buffer_old, EPD_BUFFER_SIZE);
epd_send_cmd(0x13);
memset(epd_buffer, 0xff, EPD_BUFFER_SIZE);
memset(epd_buffer, 0x00, EPD_BUFFER_SIZE);
epd_send_data_bulk(epd_buffer, EPD_BUFFER_SIZE);
epd_send_cmd(0x12);
@@ -841,8 +841,9 @@ esp_err_t epd_init()
epd_power_on();
epd_init_vram();
epd_set_ram_from_bitmap(gImage_basemap);
//epd_set_ram_from_bitmap(gImage_basemap);
epd_power_off();
epd_deep_sleep();
return ESP_OK;
+4 -26
View File
@@ -320,33 +320,11 @@ void power_sys_off()
ESP_LOGI(TAG, "Starting system shutdown...");
esp_err_t ret = ESP_OK;
// 1. 先关闭充电
ret = bq25896_disable_charging();
if (ret != ESP_OK) {
ESP_LOGE(TAG, "Failed to disable charging");
uint8_t write_buf[] = {0x09, 5};
esp_err_t ret = i2c_master_transmit(bq25896_handle, write_buf, 2, 1000);
if (ret == ESP_OK) {
ESP_LOGI(TAG, "shutdown");
}
vTaskDelay(pdMS_TO_TICKS(100));
// 2. 关闭 OTG
ret = bq25896_disable_otg();
if (ret != ESP_OK) {
ESP_LOGE(TAG, "Failed to disable OTG");
}
vTaskDelay(pdMS_TO_TICKS(100));
//完全关闭电池供电
ret = bq25896_enter_shipping_mode();
if (ret != ESP_OK) {
ESP_LOGE(TAG, "Failed to enter shipping mode");
} else {
ESP_LOGI(TAG, "SYSTEM COMPLETELY SHUTDOWN");
}
}