feat: 2in9 update

This commit is contained in:
susabolca
2024-03-22 10:41:05 +08:00
parent 741c405424
commit fcbd195763
3 changed files with 64 additions and 9 deletions

View File

@@ -284,8 +284,11 @@ void EPD_SSD_Update(void)
// temp
epd_temperature = EPD_2IN9_ReadTemp();
System_snprintf(buf, 32, "%3uc", epd_temperature);
obdWriteStringCustom(&obd, (GFXfont *)&Dialog_plain_24, 240, 22, buf, 1);
const uint8_t fmt[] = {'%', '3', 'u', 0xb0, 'c', '\0'}; // degrees celsius
System_snprintf(buf, 32, fmt, epd_temperature);
obdWriteStringCustom(&obd, (GFXfont *)&Dialog_plain_24, 236, 22, buf, 1);
//const uint8_t degree[] = {0xb0, '\0'}; // degrees celsius
//obdWriteStringCustom(&obd, (GFXfont *)&Dialog_plain_24, 282, 22, degree, 1);
// time
System_snprintf(buf, 32, "%02d:%02d", l->tm_hour, l->tm_min);

View File

@@ -43,18 +43,18 @@ static gattCharCfg_t *EpdDataConfig;
static CONST gattAttrType_t EpdServiceDecl = { ATT_BT_UUID_SIZE, EpdServiceUUID };
static uint8 EpochProps = GATT_PROP_READ | GATT_PROP_WRITE;
static uint8 EpochVal[4] = {0};
static uint8 EpochDesc[] = "Unix Epoch";
//static uint8 EpochDesc[] = "Unix Epoch";
static uint8 UtcOffProps = GATT_PROP_READ | GATT_PROP_WRITE;
static uint8 UtcOffDesc[] = "UTC Offset Mins";
//static uint8 UtcOffDesc[] = "UTC Offset Mins";
static int8 UtcOffVal[4] = {0};
static uint8 BattProps = GATT_PROP_READ;
static uint8 BattDesc[] = "Battery mv";
//static uint8 BattDesc[] = "Battery mv";
static uint8 BattVal[2] = {0};
static uint8 TempProps = GATT_PROP_READ;
static uint8 TempDesc[] = "Temperature";
//static uint8 TempDesc[] = "Temperature";
static int8 TempVal[1] = {0};
static gattAttribute_t EpdServiceAttrTbl[] =

View File

@@ -96,7 +96,8 @@ const uint8_t Dialog_plain_24Bitmaps[] = {
0xFF,0xFF,0xFC,0x03,0x00,0xE0,0x38,0x0E,0x03,0x80,0xE0,0x38,0x0E,0x01,0x80,0x7F,0xFF,0xFE, // 'z'
0x07,0x87,0xC3,0x01,0x80,0xC0,0x60,0x30,0x18,0x0C,0x0E,0x3E,0x1F,0x01,0xC0,0x60,0x30,0x18,0x0C,0x06,0x03,0x01,0x80,0xF8,0x3C, // '{'
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // '|'
0xF0,0x7C,0x06,0x03,0x01,0x80,0xC0,0x60,0x30,0x18,0x0E,0x03,0xE1,0xF1,0xC0,0xC0,0x60,0x30,0x18,0x0C,0x06,0x03,0x0F,0x87,0x80 // '}'
0xF0,0x7C,0x06,0x03,0x01,0x80,0xC0,0x60,0x30,0x18,0x0E,0x03,0xE1,0xF1,0xC0,0xC0,0x60,0x30,0x18,0x0C,0x06,0x03,0x0F,0x87,0x80, // '}'
0x69,0x96, // degree
};
const GFXglyph Dialog_plain_24Glyphs[] = {
// bitmapOffset, width, height, xAdvance, xOffset, yOffset
@@ -193,7 +194,58 @@ const GFXglyph Dialog_plain_24Glyphs[] = {
{ 2061, 11, 13, 14, 1, -13 }, // 'z'
{ 2079, 9, 22, 16, 3, -18 }, // '{'
{ 2104, 2, 24, 9, 3, -18 }, // '|'
{ 2110, 9, 22, 16, 3, -18 } // '}'
{ 2110, 9, 22, 16, 3, -18 }, // '}'
{ 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 '¯'
{ 2135, 4, 4, 4, 0, -18 } // 0xB0 '°'
};
const GFXfont Dialog_plain_24 = {
(uint8_t *)Dialog_plain_24Bitmaps,(GFXglyph *)Dialog_plain_24Glyphs,0x20, 0x7E, 29};
(uint8_t *)Dialog_plain_24Bitmaps,(GFXglyph *)Dialog_plain_24Glyphs,0x20, 0xB0, 29};