Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add make graphics option and rename logo to gfx-logo #180

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions opendps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ endif

ifeq ($(SPLASH_SCREEN),1)
CFLAGS +=-DCONFIG_SPLASH_SCREEN
OBJS += gfx-logo.o
endif

ifeq ($(WIFI),1)
Expand Down Expand Up @@ -182,6 +183,23 @@ fonts:
@python ./gen_lookup.py -f $(METER_FONT_FILE) -s $(METER_FONT_MEDIUM_SIZE) -o meter_medium
@python ./gen_lookup.py -f $(METER_FONT_FILE) -s $(METER_FONT_LARGE_SIZE) -o meter_large

graphics:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we renamed the logos to have a postfix cc.gfx.png, logo.gfx.png we might be able to do something like:

%.gfx.o: %.gfx.png
    @python ./gen_lookup.py -i $< -o $@

Not sure if Makefiles let you do this with a prefix.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the only downside to this is it means the end user must have python and Pillow installed to compile the firmware

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless we check-in the .gfx.o files. Then the makefile should not create them unless the user performed a clean / cleanall.

If they use the docker image it should not matter. (Reminder to update that too). If you are going to be building this manually rather than use the releases, I think it could be expected that you have these tools installed.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would of course be handy to have the graphics rebuild when a png is modified but I could live with a manual step for doing that and not require Pillow to be installed for firmware compilation.

@python ./gen_lookup.py -i gfx/png/cc.png -o cc
@python ./gen_lookup.py -i gfx/png/wifi.png -o wifi
@python ./gen_lookup.py -i gfx/png/thermometer.png -o thermometer
@python ./gen_lookup.py -i gfx/png/square.png -o square
@python ./gen_lookup.py -i gfx/png/sin.png -o sin
@python ./gen_lookup.py -i gfx/png/saw.png -o saw
@python ./gen_lookup.py -i gfx/png/poweron.png -o poweron
@python ./gen_lookup.py -i gfx/png/poweroff.png -o poweroff
@python ./gen_lookup.py -i gfx/png/power.png -o power
@python ./gen_lookup.py -i gfx/png/padlock.png -o padlock
@python ./gen_lookup.py -i gfx/png/cv.png -o cv
@python ./gen_lookup.py -i gfx/png/crosshair.png -o crosshair
@python ./gen_lookup.py -i gfx/png/cl.png -o cl
@python ./gen_lookup.py -i gfx/png/cc.png -o cc
@python ./gen_lookup.py -i gfx/png/logo.png -o logo

test:
@make -C tests

Expand Down
Loading