1
0
Fork 0

zero-sugar: Don't boot at high temperatures

Don't boot if EPD PMIC reports EPD temperature >= 50
degrees Celcius
zero-sugar
Lars Ivar Miljeteig 2020-05-13 13:45:29 +02:00 committed by steinarbakkemo
parent d6df2c2875
commit 2dfe0b1ad8
1 changed files with 7 additions and 0 deletions

View File

@ -12,6 +12,8 @@
#include <fat.h>
#include <memalign.h>
#define TEMP_CRITICAL_HIGH 50
static int epd_splash(void);
static int splash_init(void);
static uint8_t *epd_load_image(const char *filename, u32 *x0, u32 *y0, u32 *width, u32 *height);
@ -212,6 +214,11 @@ int epd_display_init()
printf("%s: failed to read temperature, defaulting to %d\n", __func__, temp);
} else {
printf("%s: temperature = %d\n", __func__, temp);
if (temp >= TEMP_CRITICAL_HIGH) {
printf("EPD temperature critically high, turning off\n");
do_poweroff(NULL, 0, 0, NULL);
}
}
splash.set_temp(temp);