Merge pull request #17 from joeycastillo/wip-launcher

Resolves #13
This commit is contained in:
joeycastillo
2021-10-18 15:37:41 -04:00
committed by GitHub
19 changed files with 1286 additions and 21 deletions

View File

@@ -115,8 +115,8 @@ static const uint8_t Character_Set[] =
0b01010000, // r
0b01101101, // s
0b01111000, // t
0b01100010, // u (appears as superscript to work in more positions)
0b01100010, // v (appears as superscript to work in more positions)
0b01100010, // u (appears in (u)pper half to work in more positions)
0b00011100, // v (looks like u but in the lower half)
0b10111110, // w (only works in position 0)
0b01111110, // x
0b01101110, // y
@@ -167,9 +167,23 @@ inline void watch_clear_pixel(uint8_t com, uint8_t seg) {
slcd_sync_seg_off(&SEGMENT_LCD_0, SLCD_SEGID(com, seg));
}
void watch_clear_display() {
SLCD->SDATAL0.reg = 0;
SLCD->SDATAL1.reg = 0;
SLCD->SDATAL2.reg = 0;
}
void watch_display_character(uint8_t character, uint8_t position) {
// handle lowercase 7 if needed
if (character == '7' && (position == 4 || position == 6)) character = '&';
// special cases for positions 4 and 6
if (position == 4 || position == 6) {
if (character == '7') character = '&'; // "lowercase" 7
if (character == 'v') character = 'u'; // bottom segment duplicated, so show in top half
if (character == 'J') character = 'j'; // same
} else if (position != 4 && position != 6) {
if (character == 'u') character = 'v'; // we can use the bottom segment; move to lower half
if (character == 'j') character = 'J'; // same but just display a normal J
}
if (position == 0) slcd_sync_seg_off(&SEGMENT_LCD_0, SLCD_SEGID(0, 15)); // clear funky ninth segment
uint64_t segmap = Segment_Map[position];
uint64_t segdata = Character_Set[character - 0x20];
@@ -188,7 +202,8 @@ void watch_display_character(uint8_t character, uint8_t position) {
segmap = segmap >> 8;
segdata = segdata >> 1;
}
if (character == 'T' && position == 1) slcd_sync_seg_on(&SEGMENT_LCD_0, SLCD_SEGID(1, 12));
if (character == 'T' && position == 1) slcd_sync_seg_on(&SEGMENT_LCD_0, SLCD_SEGID(1, 12)); // add descender
else if (position == 0 && (character == 'B' || character == 'D')) slcd_sync_seg_on(&SEGMENT_LCD_0, SLCD_SEGID(0, 15)); // add funky ninth segment
}
void watch_display_string(char *string, uint8_t position) {