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
Expand all
Show whitespace changes
Inline
Side-by-side
epicardium/epicardium.h
View file @
2da41e3f
...
...
@@ -1237,8 +1237,8 @@ API(API_DISP_PRINT,
uint16_t
posy
,
const
char
*
pString
,
uint16_t
fg
,
uint16_t
bg
)
);
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
This diff is collapsed.
Click to expand it.
lib/gfx/meson.build
View file @
2da41e3f
...
...
@@ -8,6 +8,7 @@ includes = include_directories(
sources = files(
'./GUI_DEV/DEV_Config.c',
'./LCD/LCD_Driver.c',
'./Fonts/gohufont.c',
'./Fonts/font8.c',
'./Fonts/font12.c',
'./Fonts/font16.c',
...
...
pycardium/modules/py/display.py
View file @
2da41e3f
...
...
@@ -7,6 +7,7 @@ FONT12 = 1
FONT16
=
2
FONT20
=
3
FONT24
=
4
GOHUFONT
=
99
class
Display
:
...
...
pycardium/modules/sys_display.c
View file @
2da41e3f
...
...
@@ -43,14 +43,16 @@ static mp_obj_t mp_display_print(size_t n_args, const mp_obj_t *args)
uint32_t
posy
=
mp_obj_get_int
(
args
[
2
]);
uint32_t
fg
=
get_color
(
args
[
3
]);
uint32_t
bg
=
get_color
(
args
[
4
]);
int
res
=
epic_disp_print
(
posx
,
posy
,
(
const
char
*
)
print
,
fg
,
bg
);
uint8_t
font
=
mp_obj_get_int
(
args
[
5
]);
int
res
=
epic_disp_print
(
posx
,
posy
,
(
const
char
*
)
print
,
fg
,
bg
,
font
);
if
(
res
<
0
)
{
mp_raise_OSError
(
-
res
);
}
return
mp_const_none
;
}
static
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN
(
display_print_obj
,
5
,
5
,
mp_display_print
display_print_obj
,
6
,
6
,
mp_display_print
);
/* print something on the display */
...
...
tools/code-style.sh
View file @
2da41e3f
...
...
@@ -45,6 +45,7 @@ formatter_blacklist=(
lib/mx25lba/
lib/sdk/
lib/vendor/
lib/gfx/
openocd/
docker/
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment