Skip to content

Commit 10c955a

Browse files
committed
Add ASCII characters
1 parent 38e8632 commit 10c955a

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

firmware/MAD_FW_1_0/matrix/matrix.c

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,34 @@ const __flash unsigned char ascii[][5] = {
469469
0b0000001,
470470
0b0000010,
471471
0b0000000
472+
},
473+
{ // {
474+
0b0001000,
475+
0b0110110,
476+
0b1000001,
477+
0b1000001,
478+
0b0000000
479+
},
480+
{ // |
481+
0b0000000,
482+
0b0000000,
483+
0b1111111,
484+
0b0000000,
485+
0b0000000
486+
},
487+
{ // }
488+
0b0000000,
489+
0b1000001,
490+
0b1000001,
491+
0b0110110,
492+
0b0001000
493+
},
494+
{ // ~
495+
0b0001000,
496+
0b0000100,
497+
0b0001000,
498+
0b0000100,
499+
0b0001000
472500
}
473501
};
474502

@@ -653,8 +681,16 @@ static void matrix_array2buffer(unsigned char *source, volatile unsigned char *d
653681
static void matrix_ascii2buffer()
654682
{
655683
unsigned char temp[MATRIX_DOTS_X];
684+
if (matrix_queue_data > 'z')
685+
{
686+
matrix_queue_data = matrix_queue_data - ('z' - 'a') - 1;
687+
}
688+
else
689+
{
690+
matrix_queue_data = toupper(matrix_queue_data);
691+
}
656692

657-
memcpy_P(temp, ascii[(toupper(matrix_queue_data) - ' ')], sizeof(temp));
693+
memcpy_P(temp, ascii[(matrix_queue_data - ' ')], sizeof(temp));
658694
matrix_array2buffer(temp, matrix_display_buffer);
659695
}
660696

0 commit comments

Comments
 (0)