MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / tmate2MainGlyph

Function tmate2MainGlyph

src/core/HidEncoderManager.cpp:48–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46struct SmallGlyph { uint8_t high; uint8_t low; };
47
48static MainGlyph tmate2MainGlyph(QChar ch)
49{
50 if (ch.isDigit()) {
51 const int digit = ch.digitValue();
52 return { kMainHigh[digit], kMainLow[digit] };
53 }
54
55 switch (ch.toLatin1()) {
56 case 'A': case 'a': return { 0x07, 0x07 };
57 case 'C': case 'c': return { 0x01, 0x0D };
58 case 'D': case 'd': return { 0x06, 0x0E }; // lowercase-d: B+C + D+E+G
59 case 'E': case 'e': return { 0x01, 0x0F };
60 case 'F': case 'f': return { 0x01, 0x07 };
61 case 'G': case 'g': return { 0x05, 0x0D };
62 case 'H': case 'h': return { 0x06, 0x07 };
63 case 'I': case 'i': return { 0x00, 0x04 };
64 case 'K': case 'k': return { 0x00, 0x0F };
65 case 'L': case 'l': return { 0x00, 0x0D };
66 case 'M': case 'm': return { 0x04, 0x06 };
67 case 'N': case 'n': return { 0x04, 0x06 };
68 case 'O': case 'o': return { 0x07, 0x0D };
69 case 'P': case 'p': return { 0x03, 0x07 };
70 case 'R': case 'r': return { 0x00, 0x06 };
71 case 'S': case 's': return { 0x05, 0x0B };
72 case 'T': case 't': return { 0x00, 0x0F };
73 case 'U': case 'u': return { 0x06, 0x0D };
74 case 'V': case 'v': return { 0x06, 0x0D };
75 case 'W': case 'w': return { 0x06, 0x0D };
76 case 'X': case 'x': return { 0x06, 0x07 };
77 case 'Y': case 'y': return { 0x06, 0x0B };
78 case '-': return { 0x00, 0x02 };
79 case ' ': return { 0x00, 0x00 };
80 default: return { 0x00, 0x00 };
81 }
82}
83
84static SmallGlyph tmate2SmallGlyph(QChar ch)
85{

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected