Skip to content

Commit

Permalink
scripts: gen_cfb_font_header: remove guard and make font data private
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
pabigot authored and galak committed Jul 31, 2019
1 parent 1090dbc commit f14b19b
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions scripts/gen_cfb_font_header.py
Expand Up @@ -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', "")

Expand All @@ -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,
Expand All @@ -124,10 +118,8 @@ def generate_header():
{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"""
Expand Down

0 comments on commit f14b19b

Please sign in to comment.