fix: 2in13-Temperature-display-update (#12)

This commit is contained in:
1zyao
2024-05-20 23:55:41 +08:00
committed by GitHub
parent 9ad5d834ad
commit 3ce0066837
2 changed files with 58 additions and 5 deletions

View File

@@ -331,8 +331,9 @@ void EPD_SSD_Update_Clock(void)
// temperature
epd_temperature = EPD_2IN13_ReadTemp();
System_snprintf(buf, 32, "%3uc", epd_temperature);
obdWriteStringCustom(&obd, (GFXfont *)&Dialog_plain_16, 158, 118, buf, 1);
char fmte[] = {'%', '3', 'u', 0xb0, 'c', '\0'}; // degrees celsius
System_snprintf(buf, 32, fmte, epd_temperature);
obdWriteStringCustom(&obd, (GFXfont *)&Dialog_plain_16, 154, 118, buf, 1);
// battery
uint8_t v = EPD_BATT_Percent();

View File

@@ -98,7 +98,8 @@ const uint8_t Dialog_plain_16Bitmaps[] PROGMEM = {
0xFE,0x02,0x04,0x08,0x10,0x20,0x40,0x80,0xFE, // 'z'
0x18,0x82,0x08,0x20,0x82,0x30,0x20,0x82,0x08,0x20,0x81,0x80, // '{'
0xAA,0xAA,0xAA,0xAA, // '|'
0xC0,0x82,0x08,0x20,0x82,0x06,0x20,0x82,0x08,0x20,0x8C,0x00 // '}'
0xC0,0x82,0x08,0x20,0x82,0x06,0x20,0x82,0x08,0x20,0x8C,0x00, // '}'
0x69,0x96, // degree
};
const GFXglyph Dialog_plain_16Glyphs[] PROGMEM = {
// bitmapOffset, width, height, xAdvance, xOffset, yOffset
@@ -195,7 +196,58 @@ const GFXglyph Dialog_plain_16Glyphs[] PROGMEM = {
{ 1057, 8, 9, 10, 1, -9 }, // 'z'
{ 1066, 6, 15, 11, 2, -12 }, // '{'
{ 1078, 2, 16, 6, 2, -12 }, // '|'
{ 1082, 6, 15, 11, 2, -12 } // '}'
{ 1082, 6, 15, 11, 2, -12 }, // '}'
{ 0, 0, 0, 0, 0, 0 }, // 0x7E 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0x7F 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0x80 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0x81 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0x82 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0x83 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0x84 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0x85 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0x86 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0x87 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0x88 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0x89 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0x8A 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0x8B 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0x8C 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0x8D 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0x8E 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0x8F 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0x90 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0x91 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0x92 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0x93 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0x94 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0x95 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0x96 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0x97 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0x98 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0x99 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0x9A 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0x9B 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0x9C 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0x9D 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0x9E 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0x9F 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0xA0 ' '
{ 0, 0, 0, 0, 0, 0 }, // 0xA1 '¡'
{ 0, 0, 0, 0, 0, 0 }, // 0xA2 '¢'
{ 0, 0, 0, 0, 0, 0 }, // 0xA3 '£'
{ 0, 0, 0, 0, 0, 0 }, // 0xA4 '¤'
{ 0, 0, 0, 0, 0, 0 }, // 0xA5 '¥'
{ 0, 0, 0, 0, 0, 0 }, // 0xA6 '¦'
{ 0, 0, 0, 0, 0, 0 }, // 0xA7 '§'
{ 0, 0, 0, 0, 0, 0 }, // 0xA8 '¨'
{ 0, 0, 0, 0, 0, 0 }, // 0xA9 '©'
{ 0, 0, 0, 0, 0, 0 }, // 0xAA 'ª'
{ 0, 0, 0, 0, 0, 0 }, // 0xAB '«'
{ 0, 0, 0, 0, 0, 0 }, // 0xAC '¬'
{ 0, 0, 0, 0, 0, 0 }, // 0xAD 'non-printable'
{ 0, 0, 0, 0, 0, 0 }, // 0xAE '®'
{ 0, 0, 0, 0, 0, 0 }, // 0xAF '¯'
{ 1094, 4, 4, 4, 0, -12 } // 0xB0 '°'
};
const GFXfont Dialog_plain_16 PROGMEM = {
(uint8_t *)Dialog_plain_16Bitmaps,(GFXglyph *)Dialog_plain_16Glyphs,0x20, 0x7E, 19};
(uint8_t *)Dialog_plain_16Bitmaps,(GFXglyph *)Dialog_plain_16Glyphs,0x20, 0xB1, 19};