scripts: gen_cfb_font_header: remove guard and make font data private
The output of this script is intended to be put into an implementation file, where the font data is accessed by index to an array maintained by the linker script. There is no need for protection against multiple includes, and the font data array should not be a global symbol. Signed-off-by: Peter A. Bigot <pab@pabigot.com>
This commit is contained in:
parent
1090dbc6b4
commit
f14b19b00a
1 changed files with 3 additions and 11 deletions
|
@ -65,8 +65,6 @@ def extract_image_glyphs():
|
|||
|
||||
def generate_header():
|
||||
"""Generate CFB font header file"""
|
||||
guard = "__CFB_FONT_{:s}_{:d}{:d}_H__".format(args.name.upper(), args.width,
|
||||
args.height)
|
||||
|
||||
zephyr_base = os.environ.get('ZEPHYR_BASE', "")
|
||||
|
||||
|
@ -89,15 +87,11 @@ def generate_header():
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef {guard}
|
||||
#define {guard}
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <display/cfb.h>
|
||||
|
||||
const u8_t cfb_font_{name:s}_{width:d}{height:d}[{elem:d}][{b:.0f}] = {{\n"""
|
||||
static const u8_t cfb_font_{name:s}_{width:d}{height:d}[{elem:d}][{b:.0f}] = {{\n"""
|
||||
.format(cmd=" ".join(clean_cmd),
|
||||
guard=guard,
|
||||
name=args.name,
|
||||
width=args.width,
|
||||
height=args.height,
|
||||
|
@ -124,10 +118,8 @@ FONT_ENTRY_DEFINE({name}_{width}{height},
|
|||
{first},
|
||||
{last}
|
||||
);
|
||||
|
||||
#endif /* {guard} */""" .format(name=args.name, width=args.width,
|
||||
height=args.height, first=args.first,
|
||||
last=args.last, guard=guard))
|
||||
""" .format(name=args.name, width=args.width, height=args.height,
|
||||
first=args.first, last=args.last))
|
||||
|
||||
def parse_args():
|
||||
"""Parse arguments"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue