diff --git a/ili9341.c b/ili9341.c index 5227be7..00b98e5 100644 --- a/ili9341.c +++ b/ili9341.c @@ -516,6 +516,12 @@ void ili9341_init(void) p += 2 + p[1]; chThdSleepMilliseconds(2); } +#ifdef TINYSA4 + if (hwid >= 2) { + uint8_t data[] = {0}; + send_command(0x21, 1, data); + } +#endif ili9341_clear_screen(); LCD_CS_HIGH; } diff --git a/main.c b/main.c index cb05fa3..57fe7d5 100644 --- a/main.c +++ b/main.c @@ -1980,21 +1980,28 @@ typedef struct version_t { const uint16_t min_adc; const uint16_t max_adc; const char *text; + const uint16_t hwid; } version_t; -#define MAX_VERSION_TEXT 1 +#define MAX_VERSION_TEXT 2 const version_t hw_version_text[MAX_VERSION_TEXT] = { - { 165, 170, "V0.4.5.1"} + { 165, 175, "V0.4.5.1", 1}, + { 180, 190, "V0.4.5.1.1", 2} }; +uint16_t hwid = 0; + const char *get_hw_version_text(void) { int v = adc1_single_read(0); for (int i=0; i