From 374f1d78eba0d124331ebfae1fe97647d24052d0 Mon Sep 17 00:00:00 2001 From: Amy Gale Ruth Bowersox Date: Fri, 6 Dec 2019 20:41:26 -0700 Subject: [PATCH] added the rules to create the splash screen data and the external references to the binary data --- src/Makefile | 8 +++++++- src/fbinit.c | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index 4a6441b..30a6305 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,4 +1,4 @@ -OBJS=main.o sysinput.o fbinit.o log.o gpio.o msg_queue.o time_func.o +OBJS=main.o sysinput.o fbinit.o log.o gpio.o msg_queue.o time_func.o splash.o LIBS=-lbcm2835 -lpthread upiwin: $(OBJS) @@ -7,5 +7,11 @@ upiwin: $(OBJS) .c.o: gcc -c $(CFLAGS) $< +splash.o: splash.bin + ld -r -b binary --rename-section .data=.rodata,alloc,load,readonly,data,contents -o splash.o splash.bin + +splash.bin: splash.png ../buildutils/mksplash + ../buildutils/mksplash splash.png splash.bin + clean: rm -f upiwin *.o *~ diff --git a/src/fbinit.c b/src/fbinit.c index 82f2af4..79a2cde 100644 --- a/src/fbinit.c +++ b/src/fbinit.c @@ -10,6 +10,11 @@ #include "fbinit.h" #include "scode.h" +/* references to splash screen data in splash.o/splash.bin */ +extern uint8_t _binary_splash_start[]; +extern uint8_t _binary_splash_end; +extern uint8_t _binary_splash_size; + static int fb_fd = -1; static FBINFO local_info;