diff --git a/lib/obp60task/Atari16px8b.h b/lib/obp60task/Atari16px8b.h new file mode 100644 index 0000000..c12a5ba --- /dev/null +++ b/lib/obp60task/Atari16px8b.h @@ -0,0 +1,338 @@ +const uint8_t Atari16pxBitmaps[] PROGMEM = { + 0x00, 0xFF, 0xFF, 0x0F, 0xCF, 0x3C, 0xF3, 0xCF, 0x30, 0x66, 0x66, 0xFF, + 0xFF, 0x66, 0x66, 0xFF, 0xFF, 0x66, 0x66, 0x30, 0xC7, 0xFF, 0xC3, 0x0F, + 0x9F, 0x0C, 0x3F, 0xFE, 0x30, 0xC0, 0xCF, 0x3D, 0x86, 0x30, 0xC6, 0x1B, + 0xCF, 0x30, 0x38, 0xF9, 0xB3, 0x63, 0x87, 0x1C, 0x38, 0xDF, 0xBF, 0x36, + 0x6F, 0xEE, 0xC0, 0xFF, 0xF0, 0x36, 0xEC, 0xCC, 0xCC, 0xCE, 0x63, 0xC6, + 0x73, 0x33, 0x33, 0x37, 0x6C, 0x66, 0x66, 0x3C, 0x3C, 0xFF, 0xFF, 0x3C, + 0x3C, 0x66, 0x66, 0x30, 0xC3, 0x3F, 0xFC, 0xC3, 0x0C, 0x6D, 0xBD, 0x00, + 0xFF, 0xF0, 0xFF, 0x0C, 0x30, 0xC6, 0x18, 0xC3, 0x18, 0x63, 0x0C, 0x30, + 0x7B, 0xFC, 0xF3, 0xCF, 0x7E, 0xF3, 0xCF, 0x3F, 0xDE, 0x30, 0xC7, 0x1C, + 0x30, 0xC3, 0x0C, 0x30, 0xCF, 0xFF, 0x7B, 0xFC, 0xF3, 0x18, 0x63, 0x0C, + 0x61, 0x8F, 0xFF, 0xFF, 0xF1, 0x86, 0x30, 0xC1, 0x86, 0xCF, 0x3F, 0xDE, + 0x18, 0x63, 0x8E, 0x79, 0xED, 0xB6, 0xFF, 0xF1, 0x86, 0xFF, 0xFC, 0x30, + 0xFB, 0xF0, 0xC3, 0x0F, 0x3F, 0xDE, 0x39, 0xEE, 0x30, 0xC3, 0xE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 0xCF, 0x3C, 0xFF, 0x7C, + 0x0C, 0x63, 0x00, 0xCF, 0x3C, 0xF3, 0xCF, 0x3C, 0xFF, 0x7C, 0x31, 0xEC, + 0xC0, 0xCF, 0x3C, 0xF3, 0xCF, 0x3C, 0xFF, 0x7C, 0xCF, 0x30, 0x33, 0xCF, + 0x3C, 0xF3, 0xCF, 0x3F, 0xDF, 0x0C, 0x63, 0x00, 0xCF, 0x3C, 0xF3, 0xCF, + 0x3F, 0xDF, 0x0F, 0xFF, 0x80, 0xC3, 0x0C, 0x3E, 0xFF, 0x3C, 0xF3, 0xCF, + 0x3F, 0xFE, 0xC3, 0x00, 0xCF, 0x30, 0x33, 0xCF, 0x3C, 0xF3, 0xCF, 0xF7, + 0xC3, 0xFF, 0xE0 }; + +const GFXglyph Atari16pxGlyphs[] PROGMEM = { + { 0, 1, 1, 8, 0, 0 }, // 0x20 ' ' U+0020 + { 1, 2, 12, 8, 3, -11 }, // 0x21 '!' U+0021 + { 4, 6, 6, 8, 1, -11 }, // 0x22 '"' U+0022 + { 9, 8, 10, 8, 0, -11 }, // 0x23 '#' U+0023 + { 19, 6, 14, 8, 1, -13 }, // 0x24 '$' U+0024 + { 30, 6, 10, 8, 1, -11 }, // 0x25 '%' U+0025 + { 38, 7, 14, 8, 0, -13 }, // 0x26 '&' U+0026 + { 51, 2, 6, 8, 3, -11 }, // 0x27 ''' U+0027 + { 53, 4, 12, 8, 3, -11 }, // 0x28 '(' U+0028 + { 59, 4, 12, 8, 1, -11 }, // 0x29 ')' U+0029 + { 65, 8, 10, 8, 0, -11 }, // 0x2a '*' U+002A + { 75, 6, 8, 8, 1, -10 }, // 0x2b '+' U+002B + { 81, 3, 6, 8, 2, -3 }, // 0x2c ',' U+002C + { 84, 6, 2, 8, 1, -7 }, // 0x2d '-' U+002D + { 86, 2, 4, 8, 3, -3 }, // 0x2e '.' U+002E + { 87, 6, 12, 8, 1, -11 }, // 0x2f '/' U+002F + { 96, 6, 12, 8, 1, -11 }, // 0x30 '0' U+0030 + { 105, 6, 12, 8, 1, -11 }, // 0x31 '1' U+0031 + { 114, 6, 12, 8, 1, -11 }, // 0x32 '2' U+0032 + { 123, 6, 12, 8, 1, -11 }, // 0x33 '3' U+0033 + { 132, 6, 12, 8, 1, -11 }, // 0x34 '4' U+0034 + { 141, 6, 12, 8, 1, -11 }, // 0x35 '5' U+0035 + { 150, 6, 12, 8, 1, -11 }, // 0x36 '6' U+0036 + { 159, 6, 12, 8, 1, -11 }, // 0x37 '7' U+0037 + { 168, 6, 12, 8, 1, -11 }, // 0x38 '8' U+0038 + { 177, 6, 12, 8, 1, -11 }, // 0x39 '9' U+0039 + { 186, 2, 10, 8, 3, -9 }, // 0x3a ':' U+003A + { 189, 3, 12, 8, 2, -9 }, // 0x3b ';' U+003B + { 194, 7, 9, 8, 0, -10 }, // 0x3c '<' U+003C + { 202, 6, 6, 8, 1, -9 }, // 0x3d '=' U+003D + { 207, 7, 9, 8, 0, -10 }, // 0x3e '>' U+003E + { 215, 6, 12, 8, 1, -11 }, // 0x3f '?' U+003F + { 224, 7, 12, 8, 0, -11 }, // 0x40 '@' U+0040 + { 235, 6, 12, 8, 1, -11 }, // 0x41 'A' U+0041 + { 244, 6, 12, 8, 1, -11 }, // 0x42 'B' U+0042 + { 253, 6, 12, 8, 1, -11 }, // 0x43 'C' U+0043 + { 262, 6, 12, 8, 1, -11 }, // 0x44 'D' U+0044 + { 271, 6, 12, 8, 1, -11 }, // 0x45 'E' U+0045 + { 280, 6, 12, 8, 1, -11 }, // 0x46 'F' U+0046 + { 289, 6, 12, 8, 1, -11 }, // 0x47 'G' U+0047 + { 298, 6, 12, 8, 1, -11 }, // 0x48 'H' U+0048 + { 307, 6, 12, 8, 1, -11 }, // 0x49 'I' U+0049 + { 316, 6, 12, 8, 1, -11 }, // 0x4a 'J' U+004A + { 325, 7, 12, 8, 0, -11 }, // 0x4b 'K' U+004B + { 336, 6, 12, 8, 1, -11 }, // 0x4c 'L' U+004C + { 345, 7, 12, 8, 0, -11 }, // 0x4d 'M' U+004D + { 356, 6, 12, 8, 1, -11 }, // 0x4e 'N' U+004E + { 365, 6, 12, 8, 1, -11 }, // 0x4f 'O' U+004F + { 374, 6, 12, 8, 1, -11 }, // 0x50 'P' U+0050 + { 383, 6, 12, 8, 1, -11 }, // 0x51 'Q' U+0051 + { 392, 7, 12, 8, 0, -11 }, // 0x52 'R' U+0052 + { 403, 6, 12, 8, 1, -11 }, // 0x53 'S' U+0053 + { 412, 6, 12, 8, 1, -11 }, // 0x54 'T' U+0054 + { 421, 6, 12, 8, 1, -11 }, // 0x55 'U' U+0055 + { 430, 6, 12, 8, 1, -11 }, // 0x56 'V' U+0056 + { 439, 7, 12, 8, 0, -11 }, // 0x57 'W' U+0057 + { 450, 6, 12, 8, 1, -11 }, // 0x58 'X' U+0058 + { 459, 6, 12, 8, 1, -11 }, // 0x59 'Y' U+0059 + { 468, 6, 12, 8, 1, -11 }, // 0x5a 'Z' U+005A + { 477, 4, 12, 8, 3, -11 }, // 0x5b '[' U+005B + { 483, 6, 12, 8, 1, -11 }, // 0x5c '\' U+005C + { 492, 4, 12, 8, 1, -11 }, // 0x5d ']' U+005D + { 498, 7, 8, 8, 0, -12 }, // 0x5e '^' U+005E + { 505, 7, 2, 8, 0, -1 }, // 0x5f '_' U+005F + { 507, 5, 7, 8, 1, -13 }, // 0x60 '`' U+0060 + { 512, 6, 9, 8, 1, -8 }, // 0x61 'a' U+0061 + { 519, 6, 12, 8, 1, -11 }, // 0x62 'b' U+0062 + { 528, 6, 9, 8, 1, -8 }, // 0x63 'c' U+0063 + { 535, 6, 12, 8, 1, -11 }, // 0x64 'd' U+0064 + { 544, 6, 9, 8, 1, -8 }, // 0x65 'e' U+0065 + { 551, 6, 12, 8, 1, -11 }, // 0x66 'f' U+0066 + { 560, 6, 11, 8, 1, -8 }, // 0x67 'g' U+0067 + { 569, 6, 12, 8, 1, -11 }, // 0x68 'h' U+0068 + { 578, 4, 12, 8, 2, -11 }, // 0x69 'i' U+0069 + { 584, 5, 14, 8, 1, -11 }, // 0x6a 'j' U+006A + { 593, 7, 12, 8, 0, -11 }, // 0x6b 'k' U+006B + { 604, 4, 12, 8, 2, -11 }, // 0x6c 'l' U+006C + { 610, 7, 9, 8, 0, -8 }, // 0x6d 'm' U+006D + { 618, 6, 9, 8, 1, -8 }, // 0x6e 'n' U+006E + { 625, 6, 9, 8, 1, -8 }, // 0x6f 'o' U+006F + { 632, 6, 11, 8, 1, -8 }, // 0x70 'p' U+0070 + { 641, 6, 11, 8, 1, -8 }, // 0x71 'q' U+0071 + { 650, 6, 9, 8, 1, -8 }, // 0x72 'r' U+0072 + { 657, 6, 9, 8, 1, -8 }, // 0x73 's' U+0073 + { 664, 6, 11, 8, 1, -10 }, // 0x74 't' U+0074 + { 673, 6, 9, 8, 1, -8 }, // 0x75 'u' U+0075 + { 680, 6, 9, 8, 1, -8 }, // 0x76 'v' U+0076 + { 687, 7, 9, 8, 0, -8 }, // 0x77 'w' U+0077 + { 695, 6, 9, 8, 1, -8 }, // 0x78 'x' U+0078 + { 702, 6, 11, 8, 1, -8 }, // 0x79 'y' U+0079 + { 711, 6, 9, 8, 1, -8 }, // 0x7a 'z' U+007A + { 718, 7, 14, 8, 0, -12 }, // 0x7b '{' U+007B + { 731, 2, 14, 8, 3, -12 }, // 0x7c '|' U+007C + { 735, 7, 14, 8, 0, -12 }, // 0x7d '}' U+007D + { 748, 7, 4, 8, 0, -8 }, // 0x7e '~' U+007E + { 752, 5, 11, 8, 1, -10 }, // 0x7f 'REPLACEMENT CHARACTER *' U+2370 + { 759, 1, 1, 8, 0, 0 }, // 0x80 'NO-BREAK SPACE' U+00A0 + { 760, 2, 12, 8, 3, -10 }, // 0x81 'INVERTED EXCLAMATION MARK' U+00A1 + { 763, 6, 12, 8, 1, -11 }, // 0x82 'CENT SIGN' U+00A2 + { 772, 8, 13, 8, 0, -12 }, // 0x83 'POUND SIGN' U+00A3 + { 785, 5, 11, 8, 1, -10 }, // 0x84 'CURRENCY SIGN' U+00A4 + { 792, 6, 12, 8, 1, -11 }, // 0x85 'YEN SIGN' U+00A5 + { 801, 5, 11, 8, 1, -10 }, // 0x86 'BROKEN BAR' U+00A6 + { 808, 6, 12, 8, 1, -11 }, // 0x87 'SECTION SIGN' U+00A7 + { 817, 5, 11, 8, 1, -10 }, // 0x88 'DIAERESIS' U+00A8 + { 824, 7, 11, 8, 0, -11 }, // 0x89 'COPYRIGHT SIGN' U+00A9 + { 834, 6, 11, 8, 1, -9 }, // 0x8a 'FEMININE ORDINAL INDICATOR' U+00AA + { 843, 7, 7, 8, 0, -7 }, // 0x8b 'LEFT-POINTING DOUBLE ANGLE QUOTATION MARK' U+00AB + { 850, 6, 5, 8, 1, -4 }, // 0x8c 'NOT SIGN' U+00AC + { 854, 4, 2, 8, 2, -4 }, // 0x8d 'SOFT HYPHEN' U+00AD + { 855, 7, 11, 8, 0, -11 }, // 0x8e 'REGISTERED SIGN' U+00AE + { 865, 7, 2, 8, 0, -12 }, // 0x8f 'MACRON' U+00AF + { 867, 5, 5, 8, 1, -12 }, // 0x90 'DEGREE SIGN' U+00B0 + { 871, 6, 11, 8, 1, -10 }, // 0x91 'PLUS-MINUS SIGN' U+00B1 + { 880, 4, 6, 8, 1, -11 }, // 0x92 'SUPERSCRIPT TWO' U+00B2 + { 883, 4, 6, 8, 1, -11 }, // 0x93 'SUPERSCRIPT THREE' U+00B3 + { 886, 5, 11, 8, 1, -10 }, // 0x94 'ACUTE ACCENT' U+00B4 + { 893, 8, 10, 8, 0, -8 }, // 0x95 'MICRO SIGN' U+00B5 + { 903, 7, 12, 8, 0, -11 }, // 0x96 'PILCROW SIGN' U+00B6 + { 914, 4, 4, 8, 2, -6 }, // 0x97 'MIDDLE DOT' U+00B7 + { 916, 5, 11, 8, 1, -10 }, // 0x98 'CEDILLA' U+00B8 + { 923, 2, 6, 8, 1, -11 }, // 0x99 'SUPERSCRIPT ONE' U+00B9 + { 925, 6, 11, 8, 1, -9 }, // 0x9a 'MASCULINE ORDINAL INDICATOR' U+00BA + { 934, 7, 7, 8, 0, -7 }, // 0x9b 'RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK' U+00BB + { 941, 5, 11, 8, 1, -10 }, // 0x9c 'VULGAR FRACTION ONE QUARTER' U+00BC + { 948, 5, 11, 8, 1, -10 }, // 0x9d 'VULGAR FRACTION ONE HALF' U+00BD + { 955, 5, 11, 8, 1, -10 }, // 0x9e 'VULGAR FRACTION THREE QUARTERS' U+00BE + { 962, 6, 12, 8, 1, -11 }, // 0x9f 'INVERTED QUESTION MARK' U+00BF + { 971, 6, 14, 8, 1, -13 }, // 0xa0 'LATIN CAPITAL LETTER A WITH GRAVE' U+00C0 + { 982, 6, 14, 8, 1, -13 }, // 0xa1 'LATIN CAPITAL LETTER A WITH ACUTE' U+00C1 + { 993, 6, 14, 8, 1, -13 }, // 0xa2 'LATIN CAPITAL LETTER A WITH CIRCUMFLEX' U+00C2 + { 1004, 6, 14, 8, 1, -13 }, // 0xa3 'LATIN CAPITAL LETTER A WITH TILDE' U+00C3 + { 1015, 6, 13, 8, 1, -12 }, // 0xa4 'LATIN CAPITAL LETTER A WITH DIAERESIS' U+00C4 + { 1025, 6, 14, 8, 1, -13 }, // 0xa5 'LATIN CAPITAL LETTER A WITH RING ABOVE' U+00C5 + { 1036, 7, 13, 8, 0, -12 }, // 0xa6 'LATIN CAPITAL LETTER AE' U+00C6 + { 1048, 6, 14, 8, 1, -11 }, // 0xa7 'LATIN CAPITAL LETTER C WITH CEDILLA' U+00C7 + { 1059, 6, 14, 8, 1, -13 }, // 0xa8 'LATIN CAPITAL LETTER E WITH GRAVE' U+00C8 + { 1070, 6, 14, 8, 1, -13 }, // 0xa9 'LATIN CAPITAL LETTER E WITH ACUTE' U+00C9 + { 1081, 6, 14, 8, 1, -13 }, // 0xaa 'LATIN CAPITAL LETTER E WITH CIRCUMFLEX' U+00CA + { 1092, 6, 13, 8, 1, -12 }, // 0xab 'LATIN CAPITAL LETTER E WITH DIAERESIS' U+00CB + { 1102, 6, 14, 8, 1, -13 }, // 0xac 'LATIN CAPITAL LETTER I WITH GRAVE' U+00CC + { 1113, 6, 14, 8, 1, -13 }, // 0xad 'LATIN CAPITAL LETTER I WITH ACUTE' U+00CD + { 1124, 6, 14, 8, 1, -13 }, // 0xae 'LATIN CAPITAL LETTER I WITH CIRCUMFLEX' U+00CE + { 1135, 6, 13, 8, 1, -12 }, // 0xaf 'LATIN CAPITAL LETTER I WITH DIAERESIS' U+00CF + { 1145, 7, 12, 8, 0, -11 }, // 0xb0 'LATIN CAPITAL LETTER ETH' U+00D0 + { 1156, 6, 13, 8, 1, -12 }, // 0xb1 'LATIN CAPITAL LETTER N WITH TILDE' U+00D1 + { 1166, 6, 14, 8, 1, -13 }, // 0xb2 'LATIN CAPITAL LETTER O WITH GRAVE' U+00D2 + { 1177, 6, 14, 8, 1, -13 }, // 0xb3 'LATIN CAPITAL LETTER O WITH ACUTE' U+00D3 + { 1188, 6, 14, 8, 1, -13 }, // 0xb4 'LATIN CAPITAL LETTER O WITH CIRCUMFLEX' U+00D4 + { 1199, 6, 14, 8, 1, -13 }, // 0xb5 'LATIN CAPITAL LETTER O WITH TILDE' U+00D5 + { 1210, 6, 13, 8, 1, -12 }, // 0xb6 'LATIN CAPITAL LETTER O WITH DIAERESIS' U+00D6 + { 1220, 6, 5, 8, 1, -6 }, // 0xb7 'MULTIPLICATION SIGN' U+00D7 + { 1224, 8, 14, 8, 0, -12 }, // 0xb8 'LATIN CAPITAL LETTER O WITH STROKE' U+00D8 + { 1238, 6, 14, 8, 1, -13 }, // 0xb9 'LATIN CAPITAL LETTER U WITH GRAVE' U+00D9 + { 1249, 6, 14, 8, 1, -13 }, // 0xba 'LATIN CAPITAL LETTER U WITH ACUTE' U+00DA + { 1260, 6, 14, 8, 1, -13 }, // 0xbb 'LATIN CAPITAL LETTER U WITH CIRCUMFLEX' U+00DB + { 1271, 6, 13, 8, 1, -12 }, // 0xbc 'LATIN CAPITAL LETTER U WITH DIAERESIS' U+00DC + { 1281, 6, 14, 8, 1, -13 }, // 0xbd 'LATIN CAPITAL LETTER Y WITH ACUTE' U+00DD + { 1292, 6, 12, 8, 1, -11 }, // 0xbe 'LATIN CAPITAL LETTER THORN' U+00DE + { 1301, 6, 13, 8, 1, -11 }, // 0xbf 'LATIN SMALL LETTER SHARP S' U+00DF + { 1311, 6, 13, 8, 1, -12 }, // 0xc0 'LATIN SMALL LETTER A WITH GRAVE' U+00E0 + { 1321, 6, 13, 8, 1, -12 }, // 0xc1 'LATIN SMALL LETTER A WITH ACUTE' U+00E1 + { 1331, 6, 13, 8, 1, -12 }, // 0xc2 'LATIN SMALL LETTER A WITH CIRCUMFLEX' U+00E2 + { 1341, 6, 13, 8, 1, -12 }, // 0xc3 'LATIN SMALL LETTER A WITH TILDE' U+00E3 + { 1351, 6, 12, 8, 1, -11 }, // 0xc4 'LATIN SMALL LETTER A WITH DIAERESIS' U+00E4 + { 1360, 6, 13, 8, 1, -12 }, // 0xc5 'LATIN SMALL LETTER A WITH RING ABOVE' U+00E5 + { 1370, 8, 9, 8, 0, -8 }, // 0xc6 'LATIN SMALL LETTER AE' U+00E6 + { 1379, 6, 11, 8, 1, -8 }, // 0xc7 'LATIN SMALL LETTER C WITH CEDILLA' U+00E7 + { 1388, 6, 13, 8, 1, -12 }, // 0xc8 'LATIN SMALL LETTER E WITH GRAVE' U+00E8 + { 1398, 6, 13, 8, 1, -12 }, // 0xc9 'LATIN SMALL LETTER E WITH ACUTE' U+00E9 + { 1408, 6, 13, 8, 1, -12 }, // 0xca 'LATIN SMALL LETTER E WITH CIRCUMFLEX' U+00EA + { 1418, 6, 12, 8, 1, -11 }, // 0xcb 'LATIN SMALL LETTER E WITH DIAERESIS' U+00EB + { 1427, 5, 13, 8, 1, -12 }, // 0xcc 'LATIN SMALL LETTER I WITH GRAVE' U+00EC + { 1436, 5, 13, 8, 2, -12 }, // 0xcd 'LATIN SMALL LETTER I WITH ACUTE' U+00ED + { 1445, 6, 13, 8, 1, -12 }, // 0xce 'LATIN SMALL LETTER I WITH CIRCUMFLEX' U+00EE + { 1455, 6, 12, 8, 1, -11 }, // 0xcf 'LATIN SMALL LETTER I WITH DIAERESIS' U+00EF + { 1464, 6, 13, 8, 1, -12 }, // 0xd0 'LATIN SMALL LETTER ETH' U+00F0 + { 1474, 6, 13, 8, 1, -12 }, // 0xd1 'LATIN SMALL LETTER N WITH TILDE' U+00F1 + { 1484, 6, 13, 8, 1, -12 }, // 0xd2 'LATIN SMALL LETTER O WITH GRAVE' U+00F2 + { 1494, 6, 13, 8, 1, -12 }, // 0xd3 'LATIN SMALL LETTER O WITH ACUTE' U+00F3 + { 1504, 6, 13, 8, 1, -12 }, // 0xd4 'LATIN SMALL LETTER O WITH CIRCUMFLEX' U+00F4 + { 1514, 6, 13, 8, 1, -12 }, // 0xd5 'LATIN SMALL LETTER O WITH TILDE' U+00F5 + { 1524, 6, 12, 8, 1, -11 }, // 0xd6 'LATIN SMALL LETTER O WITH DIAERESIS' U+00F6 + { 1533, 6, 8, 8, 1, -10 }, // 0xd7 'DIVISION SIGN' U+00F7 + { 1539, 8, 11, 8, 0, -9 }, // 0xd8 'LATIN SMALL LETTER O WITH STROKE' U+00F8 + { 1550, 6, 13, 8, 1, -12 }, // 0xd9 'LATIN SMALL LETTER U WITH GRAVE' U+00F9 + { 1560, 6, 13, 8, 1, -12 }, // 0xda 'LATIN SMALL LETTER U WITH ACUTE' U+00FA + { 1570, 6, 13, 8, 1, -12 }, // 0xdb 'LATIN SMALL LETTER U WITH CIRCUMFLEX' U+00FB + { 1580, 6, 12, 8, 1, -11 }, // 0xdc 'LATIN SMALL LETTER U WITH DIAERESIS' U+00FC + { 1589, 6, 15, 8, 1, -12 }, // 0xdd 'LATIN SMALL LETTER Y WITH ACUTE' U+00FD + { 1601, 6, 14, 8, 1, -11 }, // 0xde 'LATIN SMALL LETTER THORN' U+00FE + { 1612, 6, 14, 8, 1, -11 } }; // 0xdf 'LATIN SMALL LETTER Y WITH DIAERESIS' U+000FF + +const GFXfont Atari16px PROGMEM = { + (uint8_t *)Atari16pxBitmaps, + (GFXglyph *)Atari16pxGlyphs, + 0x20, 0xDF, 16 }; + +// Approx. 2974 bytes diff --git a/lib/obp60task/LedSpiTask.h b/lib/obp60task/LedSpiTask.h index 5c2e82c..c21a65e 100644 --- a/lib/obp60task/LedSpiTask.h +++ b/lib/obp60task/LedSpiTask.h @@ -33,6 +33,7 @@ static Color COLOR_BLACK=Color(0,0,0); Color setBrightness(const Color &color,uint8_t brightness); +enum BacklightMode {OFF, ON, SUN, BUS, TIME, KEY}; class LedInterface { private: @@ -93,4 +94,4 @@ class LedTaskData{ void createSpiLedTask(LedTaskData *param); -#endif \ No newline at end of file +#endif diff --git a/lib/obp60task/OBP60Extensions.cpp b/lib/obp60task/OBP60Extensions.cpp index 85393e1..30a85ee 100644 --- a/lib/obp60task/OBP60Extensions.cpp +++ b/lib/obp60task/OBP60Extensions.cpp @@ -22,6 +22,7 @@ #include "DSEG7Classic-BoldItalic30pt7b.h" #include "DSEG7Classic-BoldItalic42pt7b.h" #include "DSEG7Classic-BoldItalic60pt7b.h" +#include "Atari16px8b.h" // Key label font // E-Ink Display #define GxEPD_WIDTH 400 // Display width @@ -130,6 +131,21 @@ Color colorMapping(const String &colorString){ return color; } +BacklightMode backlightMapping(const String &backlightString) { + static std::map const table = { + {"Off", BacklightMode::OFF}, + {"Control by Bus", BacklightMode::BUS}, + {"Control by Time", BacklightMode::TIME}, + {"Control by Key", BacklightMode::KEY}, + {"On", BacklightMode::ON}, + }; + auto it = table.find(backlightString); + if (it != table.end()) { + return it->second; + } + return BacklightMode::OFF; +} + // All defined colors see pixeltypes.h in FastLED lib void setBacklightLED(uint brightness, const Color &color){ if (ledTaskData == nullptr) return; @@ -364,6 +380,49 @@ void displayHeader(CommonData &commonData, GwApi::BoatValue *date, GwApi::BoatVa } } +void displayFooter(CommonData &commonData) { + + static const uint16_t cx[6] = {35, 101, 167, 233, 299, 365}; // label center positions + static const uint16_t cy = 290; + + getdisplay().setFont(&Atari16px); + getdisplay().setTextColor(commonData.fgcolor); + + // Frame around key icon area + getdisplay().drawLine(0, 280, 399, 280, commonData.fgcolor); + getdisplay().drawLine(68, 280, 68, 299, commonData.fgcolor); + getdisplay().drawLine(134, 280, 134, 299, commonData.fgcolor); + getdisplay().drawLine(200, 280, 200, 299, commonData.fgcolor); + getdisplay().drawLine(266, 280, 266, 299, commonData.fgcolor); + getdisplay().drawLine(332, 280, 332, 299, commonData.fgcolor); + + for (int i=0; i<6; i++) { + uint16_t x, y; + if (commonData.keydata[i].label.length() > 0) { + // check if icon is enabled + String icon_name = commonData.keydata[i].label.substring(1); + if (commonData.keydata[i].label[0] == '#') { + if (iconmap.find(icon_name) != iconmap.end()) { + x = commonData.keydata[i].x + (commonData.keydata[i].w - icon_width) / 2; + y = commonData.keydata[i].y + (commonData.keydata[i].h - icon_height) / 2; + getdisplay().drawXBitmap(x, y, iconmap[icon_name], icon_width, icon_height, commonData.fgcolor); + } else { + // icon is missing, use name instead + x = commonData.keydata[i].x + commonData.keydata[i].w / 2; + y = commonData.keydata[i].y + commonData.keydata[i].h / 2; + drawTextCenter(x, y, icon_name); + } + } else { + //drawTextCenter(cx[i], cy, commonData.keydata[i].label); + x = commonData.keydata[i].x + commonData.keydata[i].w / 2; + y = commonData.keydata[i].y + commonData.keydata[i].h / 2; + drawTextCenter(x, y, commonData.keydata[i].label); + } + } + } + +} + // Sunset und sunrise calculation SunData calcSunsetSunrise(GwApi *api, double time, double date, double latitude, double longitude, double timezone){ GwLog *logger=api->getLogger(); diff --git a/lib/obp60task/OBP60Extensions.h b/lib/obp60task/OBP60Extensions.h index ac0c189..e94c535 100644 --- a/lib/obp60task/OBP60Extensions.h +++ b/lib/obp60task/OBP60Extensions.h @@ -37,20 +37,6 @@ extern const GFXfont DSEG7Classic_BoldItalic30pt7b; extern const GFXfont DSEG7Classic_BoldItalic42pt7b; extern const GFXfont DSEG7Classic_BoldItalic60pt7b; -// Icons -#define icon_width 16 -#define icon_height 16 - -static unsigned char swipe_bits[] PROGMEM = { - 0x80, 0x03, 0xe0, 0x06, 0xb0, 0x0a, 0xa8, 0x0a, 0xa8, 0x0a, 0xa8, 0x3a, - 0x28, 0x28, 0x08, 0x28, 0x08, 0x28, 0x08, 0x26, 0x08, 0x21, 0x08, 0x10, - 0x10, 0x08, 0x10, 0x04, 0x10, 0x04, 0x00, 0x00 }; - -static unsigned char lock_bits[] PROGMEM = { - 0xc0, 0x03, 0x60, 0x06, 0x30, 0x0c, 0x10, 0x08, 0x10, 0x08, 0x10, 0x08, - 0xfc, 0x3f, 0x04, 0x20, 0x04, 0x20, 0x84, 0x21, 0x84, 0x21, 0x84, 0x21, - 0x04, 0x20, 0x04, 0x20, 0x04, 0x20, 0xfc, 0x3f }; - // Global functions #ifdef DISPLAY_GDEW042T2 GxEPD2_BW & getdisplay(); @@ -85,6 +71,7 @@ void togglePortPin(uint pin); // Toggle extension port pin Color colorMapping(const String &colorString); // Color mapping string to CHSV colors void setBacklightLED(uint brightness, const Color &color);// Set backlight LEDs void toggleBacklightLED(uint brightness,const Color &color);// Toggle backlight LEDs +BacklightMode backlightMapping(const String &backlightString);// Configuration string to value void setFlashLED(bool status); // Set flash LED void blinkingFlashLED(); // Blinking function for flash LED @@ -102,6 +89,7 @@ void displayTrendHigh(int16_t x, int16_t y, uint16_t size, uint16_t color); void displayTrendLow(int16_t x, int16_t y, uint16_t size, uint16_t color); void displayHeader(CommonData &commonData, GwApi::BoatValue *date, GwApi::BoatValue *time, GwApi::BoatValue *hdop); // Draw display header +void displayFooter(CommonData &commonData); SunData calcSunsetSunrise(GwApi *api, double time, double date, double latitude, double longitude, double timezone); // Calulate sunset and sunrise @@ -112,11 +100,68 @@ void startLedTask(GwApi *api); void doImageRequest(GwApi *api, int *pageno, const PageStruct pages[MAX_PAGE_NUMBER], AsyncWebServerRequest *request); -#define fram_width 16 -#define fram_height 16 +// Icons +#define icon_width 16 +#define icon_height 16 + +static unsigned char left_bits[] PROGMEM = { + 0x00, 0x00, 0xc0, 0x01, 0xe0, 0x01, 0xf0, 0x01, 0xf8, 0x01, 0xfc, 0x7f, + 0xfe, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xfe, 0x7f, 0xfc, 0x7f, 0xf8, 0x01, + 0xf0, 0x01, 0xe0, 0x01, 0xc0, 0x01, 0x00, 0x00 }; + +static unsigned char right_bits[] PROGMEM = { + 0x00, 0x00, 0x80, 0x03, 0x80, 0x07, 0x80, 0x0f, 0x80, 0x1f, 0xfe, 0x3f, + 0xfe, 0x7f, 0xfe, 0xff, 0xfe, 0xff, 0xfe, 0x7f, 0xfe, 0x3f, 0x80, 0x1f, + 0x80, 0x0f, 0x80, 0x07, 0x80, 0x03, 0x00, 0x00 }; + +static unsigned char swipe_bits[] PROGMEM = { + 0x80, 0x03, 0xe0, 0x06, 0xb0, 0x0a, 0xa8, 0x0a, 0xa8, 0x0a, 0xa8, 0x3a, + 0x28, 0x28, 0x08, 0x28, 0x08, 0x28, 0x08, 0x26, 0x08, 0x21, 0x08, 0x10, + 0x10, 0x08, 0x10, 0x04, 0x10, 0x04, 0x00, 0x00 }; + +static unsigned char lock_bits[] PROGMEM = { + 0xc0, 0x03, 0x60, 0x06, 0x30, 0x0c, 0x10, 0x08, 0x10, 0x08, 0x10, 0x08, + 0xfc, 0x3f, 0x04, 0x20, 0x04, 0x20, 0x84, 0x21, 0x84, 0x21, 0x84, 0x21, + 0x04, 0x20, 0x04, 0x20, 0x04, 0x20, 0xfc, 0x3f }; + +static unsigned char plus_bits[] = { + 0x00, 0x00, 0xe0, 0x01, 0x18, 0x06, 0x04, 0x08, 0xc4, 0x08, 0xc2, 0x10, + 0xf2, 0x13, 0xf2, 0x13, 0xc2, 0x10, 0xc4, 0x08, 0x04, 0x0c, 0x18, 0x1e, + 0xe0, 0x39, 0x00, 0x70, 0x00, 0xe0, 0x00, 0xc0 }; + +static unsigned char minus_bits[] = { + 0x00, 0x00, 0xe0, 0x01, 0x18, 0x06, 0x04, 0x08, 0x04, 0x08, 0x02, 0x10, + 0xf2, 0x13, 0xf2, 0x13, 0x02, 0x10, 0x04, 0x08, 0x04, 0x0c, 0x18, 0x1e, + 0xe0, 0x39, 0x00, 0x70, 0x00, 0xe0, 0x00, 0xc0 }; + static unsigned char fram_bits[] = { 0xf8, 0x1f, 0xff, 0xff, 0x9f, 0xff, 0x98, 0x1f, 0xf8, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x1f, 0xf8, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x1f, 0xf8, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x1f }; +static std::map iconmap = { + {"LEFT", left_bits}, + {"RIGHT", right_bits}, + {"SWIPE", swipe_bits}, + {"LOCK", lock_bits}, + {"PLUS", plus_bits}, + {"MINUS", minus_bits} +}; + +// Other symbols +#define exclamation_width 32 +#define exclamation_height 32 +static unsigned char exclamation_bits[] = { + 0x00, 0xc0, 0x03, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0xb0, 0x0d, 0x00, + 0x00, 0xd8, 0x1b, 0x00, 0x00, 0xec, 0x37, 0x00, 0x00, 0xf6, 0x6f, 0x00, + 0x00, 0x3b, 0xdc, 0x00, 0x80, 0x3d, 0xbc, 0x01, 0xc0, 0x3e, 0x7c, 0x03, + 0x60, 0x3f, 0xfc, 0x06, 0xb0, 0x3f, 0xfc, 0x0d, 0xd8, 0x3f, 0xfc, 0x1b, + 0xec, 0x3f, 0xfc, 0x37, 0xf6, 0x3f, 0xfc, 0x6f, 0xfb, 0x3f, 0xfc, 0xdf, + 0xfd, 0x3f, 0xfc, 0xbf, 0xfd, 0x3f, 0xfc, 0xbf, 0xfb, 0x3f, 0xfc, 0xdf, + 0xf6, 0x3f, 0xfc, 0x6f, 0xec, 0x3f, 0xfc, 0x37, 0xd8, 0xff, 0xff, 0x1b, + 0xb0, 0xff, 0xff, 0x0d, 0x60, 0x3f, 0xfc, 0x06, 0xc0, 0x3e, 0x7c, 0x03, + 0x80, 0x3d, 0xbc, 0x01, 0x00, 0x3b, 0xdc, 0x00, 0x00, 0xf6, 0x6f, 0x00, + 0x00, 0xec, 0x37, 0x00, 0x00, 0xd8, 0x1b, 0x00, 0x00, 0xb0, 0x0d, 0x00, + 0x00, 0x60, 0x06, 0x00, 0x00, 0xc0, 0x03, 0x00 }; + #endif diff --git a/lib/obp60task/OBP60Keypad.h b/lib/obp60task/OBP60Keypad.h index e51fe9d..017d07f 100644 --- a/lib/obp60task/OBP60Keypad.h +++ b/lib/obp60task/OBP60Keypad.h @@ -19,6 +19,38 @@ int keydelay = 250; // Delay after key pressed in [ms] bool keylock = false; // Key lock after pressed key is valid (repeat protection by conginous pressing) long starttime = 0; // Start time point for pressed key +void initKeys(CommonData &commonData) { + // coordinates for virtual keyboard keys + commonData.keydata[0].x = 1; + commonData.keydata[0].y = 281; + commonData.keydata[0].w = 67; + commonData.keydata[0].h = 18; + + commonData.keydata[1].x = 69; + commonData.keydata[1].y = 281; + commonData.keydata[1].w = 66; + commonData.keydata[1].h = 18; + + commonData.keydata[2].x = 135; + commonData.keydata[2].y = 281; + commonData.keydata[2].w = 66; + commonData.keydata[2].h = 18; + + commonData.keydata[3].x = 201; + commonData.keydata[3].y = 281; + commonData.keydata[3].w = 66; + commonData.keydata[3].h = 18; + + commonData.keydata[4].x = 267; + commonData.keydata[4].y = 281; + commonData.keydata[4].w = 66; + commonData.keydata[4].h = 18; + + commonData.keydata[5].x = 333; + commonData.keydata[5].y = 281; + commonData.keydata[5].w = 66; + commonData.keydata[5].h = 18; +} int readKeypad(uint thSensitivity) { @@ -177,4 +209,4 @@ int readKeypad(uint thSensitivity) { return keystatus; } -#endif \ No newline at end of file +#endif diff --git a/lib/obp60task/PageBME280.cpp b/lib/obp60task/PageBME280.cpp index 3b68de6..f0f02c0 100644 --- a/lib/obp60task/PageBME280.cpp +++ b/lib/obp60task/PageBME280.cpp @@ -176,17 +176,6 @@ class PageBME280 : public Page // Show bus data getdisplay().print(svalue3); // Real value as formated string - // ############### Key Layout ################ - - // Key Layout - getdisplay().setFont(&Ubuntu_Bold8pt7b); - if(commonData->keylock == false){ - if(String(backlightMode) == "Control by Key"){ // Key for illumination - getdisplay().setCursor(343, 290); - getdisplay().print("[ILUM]"); - } - } - // Update display getdisplay().nextPage(); // Partial update (fast) diff --git a/lib/obp60task/PageBattery.cpp b/lib/obp60task/PageBattery.cpp index 1b12d93..bbde098 100644 --- a/lib/obp60task/PageBattery.cpp +++ b/lib/obp60task/PageBattery.cpp @@ -13,6 +13,11 @@ class PageBattery : public Page common.logger->logDebug(GwLog::LOG,"Instantiate PageBattery"); } + virtual void setupKeys(){ + Page::setupKeys(); + commonData->keydata[0].label = "AVG"; + } + virtual int handleKey(int key){ // Change average if(key == 1){ @@ -283,20 +288,6 @@ class PageBattery : public Page getdisplay().print("---"); // No sensor data (sensor is off) } - - // ############### Key Layout ################ - - // Key Layout - getdisplay().setFont(&Ubuntu_Bold8pt7b); - if(commonData->keylock == false){ - getdisplay().setCursor(10, 290); - getdisplay().print("[AVG]"); - if(String(backlightMode) == "Control by Key"){ // Key for illumination - getdisplay().setCursor(343, 290); - getdisplay().print("[ILUM]"); - } - } - // Update display getdisplay().nextPage(); // Partial update (fast) diff --git a/lib/obp60task/PageBattery2.cpp b/lib/obp60task/PageBattery2.cpp index 4cb4a40..b8694a7 100644 --- a/lib/obp60task/PageBattery2.cpp +++ b/lib/obp60task/PageBattery2.cpp @@ -16,6 +16,12 @@ public: commonData = &common; common.logger->logDebug(GwLog::LOG,"Instantiate PageBattery2"); } + + virtual void setupKeys(){ + Page::setupKeys(); + commonData->keydata[0].label = "AVG"; + } + virtual int handleKey(int key){ // Change average if(key == 1){ @@ -328,17 +334,6 @@ public: getdisplay().setFont(&Ubuntu_Bold16pt7b); getdisplay().print("W"); - // Key Layout - getdisplay().setFont(&Ubuntu_Bold8pt7b); - if(commonData->keylock == false){ - getdisplay().setCursor(10, 290); - getdisplay().print("[AVG]"); - if(String(backlightMode) == "Control by Key"){ // Key for illumination - getdisplay().setCursor(343, 290); - getdisplay().print("[ILUM]"); - } - } - // Update display getdisplay().nextPage(); // Partial update (fast) }; diff --git a/lib/obp60task/PageClock.cpp b/lib/obp60task/PageClock.cpp index f99679a..3442797 100644 --- a/lib/obp60task/PageClock.cpp +++ b/lib/obp60task/PageClock.cpp @@ -312,16 +312,6 @@ public: getdisplay().fillCircle(200, 150, startwidth + 6, commonData->bgcolor); getdisplay().fillCircle(200, 150, startwidth + 4, commonData->fgcolor); -//******************************************************************************************* - // Key Layout - getdisplay().setFont(&Ubuntu_Bold8pt7b); - if(commonData->keylock == false){ - if(String(backlightMode) == "Control by Key"){ // Key for illumination - getdisplay().setCursor(343, 290); - getdisplay().print("[ILUM]"); - } - } - // Update display getdisplay().nextPage(); // Partial update (fast) diff --git a/lib/obp60task/PageDST810.cpp b/lib/obp60task/PageDST810.cpp index 568e3e2..0da67ff 100644 --- a/lib/obp60task/PageDST810.cpp +++ b/lib/obp60task/PageDST810.cpp @@ -242,18 +242,6 @@ public: unit4old = unit4; // Save the old unit } - - // ############### Key Layout ################ - - // Key Layout - getdisplay().setFont(&Ubuntu_Bold8pt7b); - if(commonData->keylock == false){ - if(String(backlightMode) == "Control by Key"){ // Key for illumination - getdisplay().setCursor(343, 290); - getdisplay().print("[ILUM]"); - } - } - // Update display getdisplay().nextPage(); // Partial update (fast) diff --git a/lib/obp60task/PageFluid.cpp b/lib/obp60task/PageFluid.cpp index 6c12635..e03c814 100644 --- a/lib/obp60task/PageFluid.cpp +++ b/lib/obp60task/PageFluid.cpp @@ -57,6 +57,13 @@ static unsigned char gasoline_bits[] = { 0x98, 0xcf, 0x38, 0xe7, 0x78, 0xf0, 0xf8, 0xfa, 0xf8, 0xfa, 0x78, 0xf0, 0x38, 0xe7, 0x98, 0xcf, 0xf8, 0xff, 0xf0, 0x7f }; +#define fish_width 16 +#define fish_height 16 +static unsigned char fish_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0xf0, 0x03, 0xf8, 0x37, + 0xfc, 0x7f, 0xfc, 0x7f, 0xec, 0x3f, 0xfc, 0x7f, 0xfc, 0x7f, 0xf8, 0x37, + 0xf0, 0x03, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00 }; + class PageFluid : public Page { int fluidtype; @@ -150,6 +157,12 @@ class PageFluid : public Page case 1: getdisplay().drawXBitmap(c.x-8, c.y-50, water_bits, water_width, water_height, commonData->fgcolor); break; + case 2: // gray water no symbol yet + // getdisplay().drawXBitmap(c.x-8, c.y-50, gray_bits, gray_width, gray_height, commonData->fgcolor); + break; + case 3: + getdisplay().drawXBitmap(c.x-8, c.y-50, fish_bits, fish_width, fish_height, commonData->fgcolor); + break; case 4: getdisplay().drawXBitmap(c.x-8, c.y-50, oil_bits, oil_width, oil_height, commonData->fgcolor); break; @@ -215,15 +228,6 @@ class PageFluid : public Page getdisplay().fillCircle(c.x, c.y, 6, commonData->bgcolor); } - // Key Layout - getdisplay().setFont(&Ubuntu_Bold8pt7b); - if(commonData->keylock == false){ - if(String(backlightMode) == "Control by Key"){ // Key for illumination - getdisplay().setCursor(343, 296); - getdisplay().print("[ILUM]"); - } - } - // Update display getdisplay().nextPage(); // Partial update (fast) diff --git a/lib/obp60task/PageFourValues.cpp b/lib/obp60task/PageFourValues.cpp index e0c418f..73329e4 100644 --- a/lib/obp60task/PageFourValues.cpp +++ b/lib/obp60task/PageFourValues.cpp @@ -282,18 +282,6 @@ class PageFourValues : public Page unit4old = unit4; // Save the old unit } - - // ############### Key Layout ################ - - // Key Layout - getdisplay().setFont(&Ubuntu_Bold8pt7b); - if(commonData->keylock == false){ - if(String(backlightMode) == "Control by Key"){ // Key for illumination - getdisplay().setCursor(343, 290); - getdisplay().print("[ILUM]"); - } - } - // Update display getdisplay().nextPage(); // Partial update (fast) diff --git a/lib/obp60task/PageFourValues2.cpp b/lib/obp60task/PageFourValues2.cpp index 9f3f07b..6ac5981 100644 --- a/lib/obp60task/PageFourValues2.cpp +++ b/lib/obp60task/PageFourValues2.cpp @@ -282,18 +282,6 @@ class PageFourValues2 : public Page unit4old = unit4; // Save the old unit } - - // ############### Key Layout ################ - - // Key Layout - getdisplay().setFont(&Ubuntu_Bold8pt7b); - if(commonData->keylock == false){ - if(String(backlightMode) == "Control by Key"){ // Key for illumination - getdisplay().setCursor(343, 290); - getdisplay().print("[ILUM]"); - } - } - // Update display getdisplay().nextPage(); // Partial update (fast) diff --git a/lib/obp60task/PageGenerator.cpp b/lib/obp60task/PageGenerator.cpp index fc0c402..20e7652 100644 --- a/lib/obp60task/PageGenerator.cpp +++ b/lib/obp60task/PageGenerator.cpp @@ -203,15 +203,6 @@ public: getdisplay().setFont(&Ubuntu_Bold16pt7b); getdisplay().print("W"); - // Key Layout - getdisplay().setFont(&Ubuntu_Bold8pt7b); - if(commonData->keylock == false){ - if(String(backlightMode) == "Control by Key"){ // Key for illumination - getdisplay().setCursor(343, 290); - getdisplay().print("[ILUM]"); - } - } - // Update display getdisplay().nextPage(); // Partial update (fast) }; diff --git a/lib/obp60task/PageKeelPosition.cpp b/lib/obp60task/PageKeelPosition.cpp index 6ecaf61..f3eac49 100644 --- a/lib/obp60task/PageKeelPosition.cpp +++ b/lib/obp60task/PageKeelPosition.cpp @@ -206,16 +206,6 @@ public: getdisplay().print("No sensor data"); // Info missing sensor } -//******************************************************************************************* - // Key Layout - getdisplay().setFont(&Ubuntu_Bold8pt7b); - if(commonData->keylock == false){ - if(String(backlightMode) == "Control by Key"){ // Key for illumination - getdisplay().setCursor(343, 290); - getdisplay().print("[ILUM]"); - } - } - // Update display getdisplay().nextPage(); // Partial update (fast) diff --git a/lib/obp60task/PageOneValue.cpp b/lib/obp60task/PageOneValue.cpp index 6910890..84aff6d 100644 --- a/lib/obp60task/PageOneValue.cpp +++ b/lib/obp60task/PageOneValue.cpp @@ -102,15 +102,6 @@ class PageOneValue : public Page unit1old = unit1; // Save the old unit } - // Key Layout - getdisplay().setFont(&Ubuntu_Bold8pt7b); - if(commonData->keylock == false){ - if(String(backlightMode) == "Control by Key"){ // Key for illumination - getdisplay().setCursor(343, 290); - getdisplay().print("[ILUM]"); - } - } - // Update display getdisplay().nextPage(); // Partial update (fast) diff --git a/lib/obp60task/PageRollPitch.cpp b/lib/obp60task/PageRollPitch.cpp index b7c4c57..320e43f 100644 --- a/lib/obp60task/PageRollPitch.cpp +++ b/lib/obp60task/PageRollPitch.cpp @@ -305,16 +305,6 @@ public: getdisplay().print("No sensor data"); // Info missing sensor } -//******************************************************************************************* - // Key Layout - getdisplay().setFont(&Ubuntu_Bold8pt7b); - if(commonData->keylock == false){ - if(String(backlightMode) == "Control by Key"){ // Key for illumination - getdisplay().setCursor(343, 290); - getdisplay().print("[ILUM]"); - } - } - // Update display getdisplay().nextPage(); // Partial update (fast) diff --git a/lib/obp60task/PageRudderPosition.cpp b/lib/obp60task/PageRudderPosition.cpp index afceeb4..6ed0d4c 100644 --- a/lib/obp60task/PageRudderPosition.cpp +++ b/lib/obp60task/PageRudderPosition.cpp @@ -205,16 +205,6 @@ public: getdisplay().fillCircle(200, 150, startwidth + 6, commonData->bgcolor); getdisplay().fillCircle(200, 150, startwidth + 4, commonData->fgcolor); -//******************************************************************************************* - // Key Layout - getdisplay().setFont(&Ubuntu_Bold8pt7b); - if(commonData->keylock == false){ - if(String(backlightMode) == "Control by Key"){ // Key for illumination - getdisplay().setCursor(343, 290); - getdisplay().print("[ILUM]"); - } - } - // Update display getdisplay().nextPage(); // Partial update (fast) }; diff --git a/lib/obp60task/PageSolar.cpp b/lib/obp60task/PageSolar.cpp index 786dfe7..646a568 100644 --- a/lib/obp60task/PageSolar.cpp +++ b/lib/obp60task/PageSolar.cpp @@ -199,15 +199,6 @@ public: getdisplay().setFont(&Ubuntu_Bold16pt7b); getdisplay().print("W"); - // Key Layout - getdisplay().setFont(&Ubuntu_Bold8pt7b); - if(commonData->keylock == false){ - if(String(backlightMode) == "Control by Key"){ // Key for illumination - getdisplay().setCursor(343, 290); - getdisplay().print("[ILUM]"); - } - } - // Update display getdisplay().nextPage(); // Partial update (fast) }; diff --git a/lib/obp60task/PageThreeValues.cpp b/lib/obp60task/PageThreeValues.cpp index a4fbf90..c740b30 100644 --- a/lib/obp60task/PageThreeValues.cpp +++ b/lib/obp60task/PageThreeValues.cpp @@ -222,18 +222,6 @@ class PageThreeValues : public Page unit3old = unit3; // Save the old unit } - - // ############### Key Layout ################ - - // Key Layout - getdisplay().setFont(&Ubuntu_Bold8pt7b); - if(commonData->keylock == false){ - if(String(backlightMode) == "Control by Key"){ // Key for illumination - getdisplay().setCursor(343, 290); - getdisplay().print("[ILUM]"); - } - } - // Update display getdisplay().nextPage(); // Partial update (fast) }; diff --git a/lib/obp60task/PageTwoValues.cpp b/lib/obp60task/PageTwoValues.cpp index e8dcf40..6b8d0d1 100644 --- a/lib/obp60task/PageTwoValues.cpp +++ b/lib/obp60task/PageTwoValues.cpp @@ -163,22 +163,6 @@ class PageTwoValues : public Page unit2old = unit2; // Save the old unit } - - // ############### Key Layout ################ - - // Key Layout - getdisplay().setFont(&Ubuntu_Bold8pt7b); - if(commonData->keylock == false){ - if(String(backlightMode) == "Control by Key"){ // Key for illumination - getdisplay().setCursor(343, 290); - getdisplay().print("[ILUM]"); - } - } - else{ - getdisplay().setCursor(130, 290); - getdisplay().print(" [ Keylock active ]"); - } - // Update display getdisplay().nextPage(); // Partial update (fast) }; diff --git a/lib/obp60task/PageVoltage.cpp b/lib/obp60task/PageVoltage.cpp index 76d67e2..cc77b01 100644 --- a/lib/obp60task/PageVoltage.cpp +++ b/lib/obp60task/PageVoltage.cpp @@ -22,6 +22,14 @@ public: mode = fram.read(FRAM_VOLTAGE_MODE); } } + + virtual void setupKeys(){ + Page::setupKeys(); + commonData->keydata[0].label = "AVG"; + commonData->keydata[1].label = "MODE"; + commonData->keydata[4].label = "TRD"; + } + virtual int handleKey(int key){ // Change average if(key == 1){ @@ -242,10 +250,8 @@ public: } } - // Trend indicator // Show trend indicator if(trend == true){ - getdisplay().fillRect(310, 240, 40, 120, commonData->bgcolor); // Clear area getdisplay().fillRect(315, 183, 35, 4, commonData->fgcolor); // Draw separator if(int(raw * 10) > int(valueTrend * 10)){ displayTrendHigh(320, 174, 11, commonData->fgcolor); // Show high indicator @@ -254,10 +260,6 @@ public: displayTrendLow(320, 195, 11, commonData->fgcolor); // Show low indicator } } - // No trend indicator - else{ - getdisplay().fillRect(310, 240, 40, 120, commonData->bgcolor); // Clear area - } } else { @@ -360,27 +362,11 @@ public: // FRAM indicator if (hasFRAM) { - getdisplay().drawXBitmap(300, 240, fram_bits, fram_width, fram_height, commonData->fgcolor); + getdisplay().drawXBitmap(300, 240, fram_bits, icon_width, icon_height, commonData->fgcolor); } } - // Key Layout - getdisplay().setTextColor(commonData->fgcolor); - getdisplay().setFont(&Ubuntu_Bold8pt7b); - if(commonData->keylock == false){ - getdisplay().setCursor(10, 290); - getdisplay().print("[AVG]"); - getdisplay().setCursor(62, 290); - getdisplay().print("[MODE]"); - getdisplay().setCursor(293, 290); - getdisplay().print("[TRD]"); - if(String(backlightMode) == "Control by Key"){ // Key for illumination - getdisplay().setCursor(343, 290); - getdisplay().print("[ILUM]"); - } - } - // Update display getdisplay().nextPage(); // Partial update (fast) }; diff --git a/lib/obp60task/PageWind.cpp b/lib/obp60task/PageWind.cpp index 39f6a67..3702613 100644 --- a/lib/obp60task/PageWind.cpp +++ b/lib/obp60task/PageWind.cpp @@ -229,6 +229,17 @@ public: } } + virtual void setupKeys(){ + Page::setupKeys(); + commonData->keydata[0].label = "MODE"; + if (mode == 'X') { + commonData->keydata[1].label = "#MINUS"; + commonData->keydata[4].label = "#PLUS"; + } else { + commonData->keydata[1].label = "SRC"; + } + } + // Key functions virtual int handleKey(int key){ @@ -241,26 +252,28 @@ public: mode = 'N'; } if (hasFRAM) fram.write(FRAM_WIND_MODE, mode); + setupKeys(); return 0; // Commit the key } - if(key == 3){ // Source switch - if(source == 'A'){ - source = 'T'; + // Set source or reduce instrument size + if(key == 2){ + if(mode == 'X'){ + // Code for reduce + lp = lp - 10; + if(lp < 10){ + lp = 10; + } + if (hasFRAM) fram.write(FRAM_WIND_SIZE, lp); } else { - source = 'A'; + // Code for set source + if(source == 'A'){ + source = 'T'; + } else { + source = 'A'; + } + if (hasFRAM) fram.write(FRAM_WIND_SRC, source); } - if (hasFRAM) fram.write(FRAM_WIND_SRC, source); - return 0; // Commit the key - } - - // Reduce instrument size - if(key == 2 && mode == 'X'){ // Code for reduce - lp = lp - 10; - if(lp < 10){ - lp = 10; - } - if (hasFRAM) fram.write(FRAM_WIND_SIZE, lp); return 0; // Commit the key } @@ -599,25 +612,6 @@ public: } - // Key Layout - getdisplay().setFont(&Ubuntu_Bold8pt7b); - if(commonData->keylock == false){ - getdisplay().setCursor(10, 290); - getdisplay().print("[MODE]"); - - if (mode == 'X') { - getdisplay().setCursor(85, 290); - getdisplay().print("[ - ]"); - getdisplay().setCursor(295, 290); - getdisplay().print("[ + ]"); - } - - if(String(backlightMode) == "Control by Key"){ // Key for illumination - getdisplay().setCursor(343, 290); - getdisplay().print("[ILUM]"); - } - } - // Update display getdisplay().nextPage(); // Partial update (fast) diff --git a/lib/obp60task/PageWindRose.cpp b/lib/obp60task/PageWindRose.cpp index be3d468..88c490f 100644 --- a/lib/obp60task/PageWindRose.cpp +++ b/lib/obp60task/PageWindRose.cpp @@ -10,7 +10,7 @@ int16_t lp = 80; // Pointer length public: PageWindRose(CommonData &common){ commonData = &common; - common.logger->logDebug(GwLog::LOG,"Show PageWindRose"); + common.logger->logDebug(GwLog::LOG,"Instantiate PageWindRose"); } // Key functions @@ -350,15 +350,6 @@ public: getdisplay().print(unit6old); // Unit } - // Key Layout - getdisplay().setFont(&Ubuntu_Bold8pt7b); - if(commonData->keylock == false){ - if(String(backlightMode) == "Control by Key"){ // Key for illumination - getdisplay().setCursor(343, 290); - getdisplay().print("[ILUM]"); - } - } - // Update display getdisplay().nextPage(); // Partial update (fast) }; diff --git a/lib/obp60task/PageWindRoseFlex.cpp b/lib/obp60task/PageWindRoseFlex.cpp index a01e73f..ba4b029 100644 --- a/lib/obp60task/PageWindRoseFlex.cpp +++ b/lib/obp60task/PageWindRoseFlex.cpp @@ -10,7 +10,7 @@ int16_t lp = 80; // Pointer length public: PageWindRoseFlex(CommonData &common){ commonData = &common; - common.logger->logDebug(GwLog::LOG,"Show PageWindRoseFlex"); + common.logger->logDebug(GwLog::LOG,"Instantiate PageWindRoseFlex"); } // Key functions @@ -351,15 +351,6 @@ public: getdisplay().print(unit6old); // Unit } - // Key Layout - getdisplay().setFont(&Ubuntu_Bold8pt7b); - if(commonData->keylock == false){ - if(String(backlightMode) == "Control by Key"){ // Key for illumination - getdisplay().setCursor(343, 290); - getdisplay().print("[ILUM]"); - } - } - // Update display getdisplay().nextPage(); // Partial update (fast) }; diff --git a/lib/obp60task/PageXTETrack.cpp b/lib/obp60task/PageXTETrack.cpp index d16a8b7..7b5f487 100644 --- a/lib/obp60task/PageXTETrack.cpp +++ b/lib/obp60task/PageXTETrack.cpp @@ -197,15 +197,6 @@ class PageXTETrack : public Page drawSegment(399, 100, 318, 24, 289, 24, 350, 100, commonData->fgcolor, seg[4]); drawSegment(399, 54, 354, 24, 325, 24, 399, 90, commonData->fgcolor, seg[5]); - // Key Layout - getdisplay().setFont(&Ubuntu_Bold8pt7b); - if(commonData->keylock == false){ - if(String(backlightMode) == "Control by Key"){ // Key for illumination - getdisplay().setCursor(343, 296); - getdisplay().print("[ILUM]"); - } - } - // Update display getdisplay().nextPage(); // Partial update (fast) diff --git a/lib/obp60task/Pagedata.h b/lib/obp60task/Pagedata.h index 9f9764c..2a72ba6 100644 --- a/lib/obp60task/Pagedata.h +++ b/lib/obp60task/Pagedata.h @@ -3,6 +3,7 @@ #include "GwApi.h" #include #include +#include "LedSpiTask.h" #define MAX_PAGE_NUMBER 10 // Max number of pages for show data @@ -63,12 +64,30 @@ typedef struct{ bool sunDown = true; } SunData; +typedef struct{ + String label = ""; + bool selected = false; // for virtual keyboard function + uint16_t x; + uint16_t y; + uint16_t w; + uint16_t h; +} TouchKeyData; + +typedef struct{ + Color color; // red, orange, yellow, green, blue, aqua, violet, white + BacklightMode mode; // off, on, sun, bus, time, key + uint8_t brightness; // 0% (off), user setting from 20% to 100% full power + bool on; // fast on/off detector +} BacklightData; + typedef struct{ GwApi::Status status; GwLog *logger=NULL; GwConfigHandler *config=NULL; SensorData data; SunData sundata; + TouchKeyData keydata[6]; + BacklightData backlight; GwApi::BoatValue *time=NULL; GwApi::BoatValue *date=NULL; uint16_t fgcolor; @@ -83,6 +102,18 @@ class Page{ public: virtual void displayPage(PageData &pageData)=0; virtual void displayNew(PageData &pageData){} + virtual void setupKeys() { + commonData->keydata[0].label = ""; + commonData->keydata[1].label = ""; + commonData->keydata[2].label = "#LEFT"; + commonData->keydata[3].label = "#RIGHT"; + commonData->keydata[4].label = ""; + if (commonData->backlight.mode == KEY) { + commonData->keydata[5].label = "ILUM"; + } else { + commonData->keydata[5].label = ""; + } + } //return -1 if handled by the page virtual int handleKey(int key){return key;} }; diff --git a/lib/obp60task/obp60task.cpp b/lib/obp60task/obp60task.cpp index ade14fa..f336f68 100644 --- a/lib/obp60task/obp60task.cpp +++ b/lib/obp60task/obp60task.cpp @@ -76,10 +76,10 @@ void OBP60Init(GwApi *api){ if(String(backlightMode) == "On"){ setBacklightLED(brightness, colorMapping(backlightColor)); } - if(String(backlightMode) == "Off"){ + else if(String(backlightMode) == "Off"){ setBacklightLED(0, COLOR_BLACK); // Backlight LEDs off (blue without britghness) } - if(String(backlightMode) == "Control by Key"){ + else if(String(backlightMode) == "Control by Key"){ setBacklightLED(0, COLOR_BLUE); // Backlight LEDs off (blue without britghness) } @@ -285,13 +285,16 @@ void OBP60Task(GwApi *api){ commonData.logger=logger; commonData.config=config; + // Keyboard coordinates for page footer + initKeys(commonData); + tN2kMsg N2kMsg; LOG_DEBUG(GwLog::LOG,"obp60task started"); for (auto it=allPages.pages.begin();it != allPages.pages.end();it++){ LOG_DEBUG(GwLog::LOG,"found registered page %s",(*it)->pageName.c_str()); } - + // Init E-Ink display String displaymode = api->getConfig()->getConfigItem(api->getConfig()->display,true)->asString(); String displaycolor = api->getConfig()->getConfigItem(api->getConfig()->displaycolor,true)->asString(); @@ -416,12 +419,13 @@ void OBP60Task(GwApi *api){ // Configuration values for main loop String gpsFix = api->getConfig()->getConfigItem(api->getConfig()->flashLED,true)->asString(); - String backlight = api->getConfig()->getConfigItem(api->getConfig()->backlight,true)->asString(); String gpsOn=api->getConfig()->getConfigItem(api->getConfig()->useGPS,true)->asString(); String tz = api->getConfig()->getConfigItem(api->getConfig()->timeZone,true)->asString(); - String backlightColor = api->getConfig()->getConfigItem(api->getConfig()->blColor,true)->asString(); - Color color = colorMapping(backlightColor); - uint brightness = 2.55 * uint(api->getConfig()->getConfigItem(api->getConfig()->blBrightness,true)->asInt()); + + commonData.backlight.mode = backlightMapping(config->getConfigItem(config->backlight,true)->asString()); + commonData.backlight.color = colorMapping(config->getConfigItem(config->blColor,true)->asString()); + commonData.backlight.brightness = 2.55 * uint(config->getConfigItem(config->blBrightness,true)->asInt()); + bool uvoltage = api->getConfig()->getConfigItem(api->getConfig()->underVoltage,true)->asBoolean(); String cpuspeed = api->getConfig()->getConfigItem(api->getConfig()->cpuSpeed,true)->asString(); uint hdopAccuracy = uint(api->getConfig()->getConfigItem(api->getConfig()->hdopAccuracy,true)->asInt()); @@ -448,7 +452,9 @@ void OBP60Task(GwApi *api){ long starttime3 = millis(); // Display update all 1s long starttime4 = millis(); // Delayed display update after 4s when select a new page long starttime5 = millis(); // Calculate sunrise and sunset all 1s - + + pages[pageNumber].page->setupKeys(); // Initialize keys for first page + // Main loop runs with 100ms //#################################################################################### @@ -505,14 +511,15 @@ void OBP60Task(GwApi *api){ { // Decoding all key codes // #6 Backlight on if key controled - if(String(backlight) == "Control by Key"){ + if (commonData.backlight.mode == BacklightMode::KEY) { + // if(String(backlight) == "Control by Key"){ if(keyboardMessage == 6){ LOG_DEBUG(GwLog::LOG,"Toggle Backlight LED"); - toggleBacklightLED(brightness, color); + toggleBacklightLED(commonData.backlight.brightness, commonData.backlight.color); } } - // #9 Swipe right - if (keyboardMessage == 9) + // #9 Swipe right or #4 key right + if ((keyboardMessage == 9) or (keyboardMessage == 4)) { pageNumber++; if (pageNumber >= numPages){ @@ -521,8 +528,8 @@ void OBP60Task(GwApi *api){ commonData.data.actpage = pageNumber + 1; commonData.data.maxpage = numPages; } - // #10 Swipe left - if (keyboardMessage == 10) + // #10 Swipe left or #3 key left + if ((keyboardMessage == 10) or (keyboardMessage == 3)) { pageNumber--; if (pageNumber < 0){ @@ -549,9 +556,10 @@ void OBP60Task(GwApi *api){ // Provide sundata to all pages commonData.sundata = calcSunsetSunrise(api, time->value , date->value, lat->value, lon->value, tz.toDouble()); // Backlight with sun control - if(String(backlight) == "Control by Sun"){ + if (commonData.backlight.mode == BacklightMode::SUN) { + // if(String(backlight) == "Control by Sun"){ if(commonData.sundata.sunDown == true){ - setBacklightLED(brightness, color); + setBacklightLED(commonData.backlight.brightness, commonData.backlight.color); } else{ setBacklightLED(0, COLOR_BLUE); // Backlight LEDs off (blue without britghness) @@ -616,11 +624,11 @@ void OBP60Task(GwApi *api){ // Show header if enabled getdisplay().fillRect(0, 0, getdisplay().width(), getdisplay().height(), commonData.bgcolor); // Clear display if (pages[pageNumber].description && pages[pageNumber].description->header){ - //build some header and footer using commonData - getdisplay().fillScreen(commonData.bgcolor); // Clear display - displayHeader(commonData, date, time, hdop); // Sown header + // build header using commonData + getdisplay().fillScreen(commonData.bgcolor); // Clear display + displayHeader(commonData, date, time, hdop); // Show page header } - + // Call the particular page Page *currentPage=pages[pageNumber].page; if (currentPage == NULL){ @@ -630,11 +638,16 @@ void OBP60Task(GwApi *api){ else{ if (lastPage != pageNumber){ if (hasFRAM) fram.write(FRAM_PAGE_NO, pageNumber); // remember page for device restart + currentPage->setupKeys(); currentPage->displayNew(pages[pageNumber].parameters); lastPage=pageNumber; } //call the page code LOG_DEBUG(GwLog::DEBUG,"calling page %d",pageNumber); + // Show footer if enabled (together with header) + if (pages[pageNumber].description && pages[pageNumber].description->header){ + displayFooter(commonData); + } currentPage->displayPage(pages[pageNumber].parameters); } }