Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
meh
firmware
Commits
2da41e3f
Unverified
Commit
2da41e3f
authored
Aug 23, 2019
by
meh
Browse files
feat: add GohuFont as supported font
parent
622d2145
Pipeline
#3617
failed with stages
in 1 minute and 1 second
Changes
10
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
epicardium/epicardium.h
View file @
2da41e3f
...
...
@@ -1233,12 +1233,12 @@ API(API_DISP_UPDATE, int epic_disp_update());
*/
API
(
API_DISP_PRINT
,
int
epic_disp_print
(
uint16_t
posx
,
uint16_t
posy
,
const
char
*
pString
,
uint16_t
fg
,
uint16_t
bg
)
);
uint16_t
posx
,
uint16_t
posy
,
const
char
*
pString
,
uint16_t
fg
,
uint16_t
bg
,
uint8_t
font
)
);
/*
* Font Selection
...
...
@@ -1249,6 +1249,7 @@ enum disp_font_name {
DISP_FONT16
=
2
,
DISP_FONT20
=
3
,
DISP_FONT24
=
4
,
DISP_GOHUFONT
=
99
,
};
/**
...
...
epicardium/main.c
View file @
2da41e3f
...
...
@@ -26,8 +26,8 @@ int main(void)
const
char
*
version_buf
=
CARD10_VERSION
;
const
int
off
=
(
160
-
(
int
)
strlen
(
version_buf
)
*
14
)
/
2
;
epic_disp_clear
(
0x9dc0
);
epic_disp_print
(
10
,
20
,
"Epicardium"
,
0x6c20
,
0x9dc0
);
epic_disp_print
(
off
>
0
?
off
:
0
,
40
,
version_buf
,
0x6c20
,
0x9dc0
);
epic_disp_print
(
10
,
20
,
"Epicardium"
,
0x6c20
,
0x9dc0
,
0
);
epic_disp_print
(
off
>
0
?
off
:
0
,
40
,
version_buf
,
0x6c20
,
0x9dc0
,
0
);
epic_disp_update
();
mxc_delay
(
2000000
);
...
...
epicardium/modules/display.c
View file @
2da41e3f
...
...
@@ -26,7 +26,8 @@ int epic_disp_print(
uint16_t
posy
,
const
char
*
pString
,
uint16_t
fg
,
uint16_t
bg
uint16_t
bg
,
uint8_t
font
)
{
return
epic_disp_print_adv
(
DISP_FONT20
,
posx
,
posy
,
pString
,
fg
,
bg
);
}
...
...
@@ -35,6 +36,7 @@ static const sFONT *font_map[] = {
[
DISP_FONT8
]
=
&
Font8
,
[
DISP_FONT12
]
=
&
Font12
,
[
DISP_FONT16
]
=
&
Font16
,
[
DISP_FONT20
]
=
&
Font20
,
[
DISP_FONT24
]
=
&
Font24
,
[
DISP_GOHUFONT
]
=
&
GohuFont
};
int
epic_disp_print_adv
(
...
...
@@ -63,6 +65,38 @@ int epic_disp_print_adv(
);
return
0
;
}
sFONT
*
pick
=
&
Font20
;
switch
(
font
)
{
case
8
:
pick
=
&
Font8
;
break
;
case
12
:
pick
=
&
Font12
;
break
;
case
16
:
pick
=
&
Font16
;
break
;
case
20
:
pick
=
&
Font20
;
break
;
case
24
:
pick
=
&
Font24
;
break
;
case
99
:
pick
=
&
GohuFont
;
break
;
}
gfx_puts
(
pick
,
&
display_screen
,
posx
,
posy
,
pString
,
fg
,
bg
);
return
0
;
}
int
epic_disp_clear
(
uint16_t
color
)
...
...
epicardium/modules/pmic.c
View file @
2da41e3f
...
...
@@ -180,9 +180,9 @@ __attribute__((noreturn)) static void pmic_die(float u_batt)
/* Draw an error screen */
epic_disp_clear
(
0x0000
);
epic_disp_print
(
0
,
0
,
" Battery"
,
0xffff
,
0x0000
);
epic_disp_print
(
0
,
20
,
" critical"
,
0xffff
,
0x0000
);
epic_disp_print
(
0
,
40
,
" !!!!"
,
0xffff
,
0x0000
);
epic_disp_print
(
0
,
0
,
" Battery"
,
0xffff
,
0x0000
,
0
);
epic_disp_print
(
0
,
20
,
" critical"
,
0xffff
,
0x0000
,
0
);
epic_disp_print
(
0
,
40
,
" !!!!"
,
0xffff
,
0x0000
,
0
);
epic_disp_update
();
/* Vibrate violently */
...
...
lib/gfx/Fonts/fonts.h
View file @
2da41e3f
...
...
@@ -61,6 +61,8 @@ typedef struct _tFont
}
sFONT
;
extern
sFONT
GohuFont
;
extern
sFONT
Font24
;
extern
sFONT
Font20
;
extern
sFONT
Font16
;
...
...
lib/gfx/Fonts/gohufont.c
0 → 100644
View file @
2da41e3f
#include
"fonts.h"
const
uint8_t
GohuFont_Table
[]
=
{
// @32 ' ' (6 pixels wide)
0x00
,
//
0x00
,
//
0x00
,
//
0x00
,
//
0x00
,
//
0x00
,
//
0x00
,
//
0x00
,
//
0x00
,
//
0x00
,
//
0x00
,
//
// @33 '!' (6 pixels wide)
0x00
,
//
0x20
,
//#
0x20
,
//#
0x20
,
//#
0x20
,
//#
0x20
,
//#
0x20
,
//#
0x00
,
//
0x20
,
//#
0x00
,
//
0x00
,
//
// @34 '\"' (6 pixels wide)
0x00
,
//
0x50
,
//# #
0x50
,
//# #
0x50
,
//# #
0x00
,
//
0x00
,
//
0x00
,
//
0x00
,
//
0x00
,
//
0x00
,
//
0x00
,
//
// @35 '#' (6 pixels wide)
0x00
,
//
0x50
,
//# #
0x50
,
//# #
0xF8
,
//#####
0x50
,
//# #
0xF8
,
//#####
0x50
,
//# #
0x50
,
//# #
0x00
,
//
0x00
,
//
0x00
,
//
// @36 '$' (6 pixels wide)
0x00
,
//
0x20
,
//#
0x70
,
//###
0xA8
,
//# # #
0xA0
,
//# #
0x70
,
//###
0x28
,
//# #
0xA8
,
//# # #
0x70
,
//###
0x20
,
//#
0x00
,
//
// @37 '%' (6 pixels wide)
0x00
,
//
0x00
,
//
0x48
,
//# #
0xA8
,
//# # #
0x50
,
//# #
0x20
,
//#
0x50
,
//# #
0xA8
,
//# # #
0x90
,
//# #
0x00
,
//
0x00
,
//
// @38 '&' (6 pixels wide)
0x00
,
//
0x00
,
//
0x60
,
//##
0x90
,
//# #
0xA0
,
//# #
0x40
,
//#
0xA8
,
//# # #
0x90
,
//# #
0x68
,
//## #
0x00
,
//
0x00
,
//
// @39 '\'' (6 pixels wide)
0x00
,
//
0x20
,
//#
0x20
,
//#
0x20
,
//#
0x00
,
//
0x00
,
//
0x00
,
//
0x00
,
//
0x00
,
//
0x00
,
//
0x00
,
//
// @40 '(' (6 pixels wide)
0x00
,
//
0x10
,
// #
0x20
,
//#
0x20
,
//#
0x40
,
//#
0x40
,
//#
0x40
,
//#
0x20
,
//#
0x20
,
//#
0x10
,
// #
0x00
,
//
// @41 ')' (6 pixels wide)
0x00
,
//
0x40
,
//#
0x20
,
//#
0x20
,
//#
0x10
,
// #
0x10
,
// #
0x10
,
// #
0x20
,
//#
0x20
,
//#
0x40
,
//#
0x00
,
//
// @42 '*' (6 pixels wide)
0x00
,
//
0x00
,
//
0x00
,
//
0x20
,
//#
0xA8
,
//# # #
0x70
,
//###
0xA8
,
//# # #
0x20
,
//#
0x00
,
//
0x00
,
//
0x00
,
//
// @43 '+' (6 pixels wide)
0x00
,
//
0x00
,
//
0x00
,
//
0x20
,
//#
0x20
,
//#
0xF8
,
//#####
0x20
,
//#
0x20
,
//#
0x00
,
//
0x00
,
//
0x00
,
//
// @44 ',' (6 pixels wide)
0x00
,
//
0x00
,
//
0x00
,
//
0x00
,
//
0x00
,
//
0x00
,
//
0x00
,
//
0x60
,
//##
0x60
,
//##
0x20
,
//#
0x40
,
//#
// @45 '-' (6 pixels wide)
0x00
,
//
0x00
,
//
0x00
,
//
0x00
,
//
0x00
,
//
0xF8
,
//#####
0x00
,
//
0x00
,
//
0x00
,
//
0x00
,
//
0x00
,
//
// @46 '.' (6 pixels wide)
0x00
,
//
0x00
,
//
0x00
,
//
0x00
,
//
0x00
,
//
0x00
,
//
0x00
,
//
0x60
,
//##
0x60
,
//##
0x00
,
//
0x00
,
//
// @47 '/' (6 pixels wide)
0x00
,
//
0x08
,
// #
0x08
,
// #
0x10
,
// #
0x10
,
// #
0x20
,
//#
0x20
,
//#
0x40
,
//#
0x40
,
//#
0x80
,
//#
0x80
,
//#
// @48 '0' (6 pixels wide)
0x00
,
//
0x00
,
//
0x70
,
//###
0x88
,
//# #
0x98
,
//# ##
0xA8
,
//# # #
0xC8
,
//## #
0x88
,
//# #
0x70
,
//###
0x00
,
//
0x00
,
//
// @49 '1' (6 pixels wide)
0x00
,
//
0x00
,
//
0x20
,
//#
0x60
,
//##
0xA0
,
//# #
0x20
,
//#
0x20
,
//#
0x20
,
//#
0x20
,
//#
0x00
,
//
0x00
,
//
// @50 '2' (6 pixels wide)
0x00
,
//
0x00
,
//
0x70
,
//###
0x88
,
//# #
0x08
,
// #
0x10
,
// #
0x20
,
//#
0x40
,
//#
0xF8
,
//#####
0x00
,
//
0x00
,
//
// @51 '3' (6 pixels wide)
0x00
,
//
0x00
,
//
0x70
,
//###
0x88
,
//# #
0x08
,
// #
0x30
,
//##
0x08
,
// #
0x88
,
//# #
0x70
,
//###
0x00
,
//
0x00
,
//
// @52 '4' (6 pixels wide)
0x00
,
//
0x00
,
//
0x10
,
// #
0x30
,
//##
0x50
,
//# #
0x90
,
//# #
0xF8
,
//#####
0x10
,
// #
0x10
,
// #
0x00
,
//
0x00
,
//
// @53 '5' (6 pixels wide)
0x00
,
//
0x00
,
//
0xF8
,
//#####
0x80
,
//#
0xF0
,
//####
0x08
,
// #
0x08
,
// #
0x88
,
//# #
0x70
,
//###
0x00
,
//
0x00
,
//
// @54 '6' (6 pixels wide)
0x00
,
//
0x00
,
//
0x70
,
//###
0x80
,
//#
0xF0
,
//####
0x88
,
//# #
0x88
,
//# #
0x88
,
//# #
0x70
,
//###
0x00
,
//
0x00
,
//
// @55 '7' (6 pixels wide)
0x00
,
//
0x00
,
//
0xF8
,
//#####
0x08
,
// #
0x10
,
// #
0x10
,
// #
0x20
,
//#
0x20
,
//#
0x20
,
//#
0x00
,
//
0x00
,
//
// @56 '8' (6 pixels wide)
0x00
,
//
0x00
,
//
0x70
,
//###
0x88
,
//# #
0x88
,
//# #
0x70
,
//###
0x88
,
//# #
0x88
,
//# #
0x70
,
//###
0x00
,
//
0x00
,
//
// @57 '9' (6 pixels wide)
0x00
,
//
0x00
,
//
0x70
,
//###
0x88
,
//# #
0x88
,
//# #
0x78
,
//####
0x08
,
// #
0x08
,
// #
0x70
,
//###
0x00
,
//
0x00
,
//
// @58 ':' (6 pixels wide)
0x00
,
//
0x00
,
//
0x00
,
//
0x00
,
//
0x30
,
//##
0x30
,
//##
0x00
,
//
0x30
,
//##
0x30
,
//##
0x00
,
//
0x00
,
//
// @59 ';' (6 pixels wide)
0x00
,
//
0x00
,
//
0x00
,
//
0x00
,
//
0x60
,
//##
0x60
,
//##
0x00
,
//
0x60
,
//##
0x60
,
//##
0x20
,
//#
0x40
,
//#
// @60 '<' (6 pixels wide)
0x00
,
//
0x00
,
//
0x08
,
// #
0x10
,
// #
0x20
,
//#
0x40
,
//#
0x20
,
//#
0x10
,
// #
0x08
,
// #
0x00
,
//
0x00
,
//
// @61 '=' (6 pixels wide)
0x00
,
//
0x00
,
//
0x00
,
//
0x00
,
//
0xF8
,
//#####
0x00
,
//
0xF8
,
//#####
0x00
,
//
0x00
,
//
0x00
,
//
0x00
,
//
// @62 '>' (6 pixels wide)
0x00
,
//
0x00
,
//
0x40
,
//#
0x20
,
//#
0x10
,
// #
0x08
,
// #
0x10
,
// #
0x20
,
//#
0x40
,
//#
0x00
,
//
0x00
,
//
// @63 '?' (6 pixels wide)
0x00
,
//
0x00
,
//
0x70
,
//###
0x88
,
//# #
0x08
,
// #
0x10
,
// #
0x20
,
//#
0x00
,
//
0x20
,
//#
0x00
,
//
0x00
,
//
// @64 '@' (6 pixels wide)
0x00
,
//
0x00
,
//
0x70
,
//###
0x88
,
//# #
0xB8
,
//# ###
0xA8
,
//# # #
0xB8
,
//# ###
0x80
,
//#
0x78
,
//####
0x00
,
//
0x00
,
//
// @65 'A' (6 pixels wide)
0x00
,
//
0x70
,
//###
0x88
,
//# #
0x88
,
//# #
0xF8
,
//#####
0x88
,
//# #
0x88
,
//# #
0x88
,
//# #
0x88
,
//# #
0x00
,
//
0x00
,
//
// @66 'B' (6 pixels wide)
0x00
,
//
0xF0
,
//####
0x88
,
//# #
0x88
,
//# #
0xF0
,
//####
0x88
,
//# #
0x88
,
//# #
0x88
,
//# #
0xF0
,
//####
0x00
,
//
0x00
,
//
// @67 'C' (6 pixels wide)
0x00
,
//
0x70
,
//###
0x88
,
//# #
0x80
,
//#
0x80
,
//#
0x80
,
//#
0x80
,
//#
0x88
,
//# #
0x70
,
//###
0x00
,
//
0x00
,
//
// @68 'D' (6 pixels wide)
0x00
,
//
0xF0
,
//####
0x88
,
//# #
0x88
,
//# #
0x88
,
//# #
0x88
,
//# #
0x88
,
//# #
0x88
,
//# #
0xF0
,
//####
0x00
,
//
0x00
,
//
// @69 'E' (6 pixels wide)
0x00
,
//
0xF8
,
//#####
0x80
,
//#
0x80
,
//#
0xF0
,
//####
0x80
,
//#
0x80
,
//#
0x80
,
//#
0xF8
,
//#####
0x00
,
//
0x00
,
//
// @70 'F' (6 pixels wide)
0x00
,
//
0xF8
,
//#####
0x80
,
//#
0x80
,
//#
0xF0
,
//####
0x80
,
//#
0x80
,
//#
0x80
,
//#
0x80
,
//#
0x00
,
//
0x00
,
//
// @71 'G' (6 pixels wide)
0x00
,
//