From 20cd72f75b7b91f22e9b25c51fe7fa9ad3bf3d97 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 24 Feb 2018 12:09:15 -0600 Subject: [PATCH] apps/examples/ft80x: Fix some dangling compile issues when bitmap examples are disabled. --- examples/ft80x/ft80x.h | 2 ++ examples/ft80x/ft80x_coprocessor.c | 14 ++++++++++++++ examples/ft80x/ft80x_main.c | 2 ++ 3 files changed, 18 insertions(+) diff --git a/examples/ft80x/ft80x.h b/examples/ft80x/ft80x.h index 1af0a94e9..2dbd5daf2 100644 --- a/examples/ft80x/ft80x.h +++ b/examples/ft80x/ft80x.h @@ -164,7 +164,9 @@ int ft80x_coproc_dial(int fd, FAR struct ft80x_dlbuffer_s *buffer); int ft80x_coproc_toggle(int fd, FAR struct ft80x_dlbuffer_s *buffer); int ft80x_coproc_number(int fd, FAR struct ft80x_dlbuffer_s *buffer); int ft80x_coproc_calibrate(int fd, FAR struct ft80x_dlbuffer_s *buffer); +#ifndef CONFIG_EXAMPLES_FT80X_EXCLUDE_BITMAPS int ft80x_coproc_spinner(int fd, FAR struct ft80x_dlbuffer_s *buffer); +#endif int ft80x_coproc_screensaver(int fd, FAR struct ft80x_dlbuffer_s *buffer); int ft80x_coproc_logo(int fd, FAR struct ft80x_dlbuffer_s *buffer); diff --git a/examples/ft80x/ft80x_coprocessor.c b/examples/ft80x/ft80x_coprocessor.c index 212f741a8..0986c43a1 100644 --- a/examples/ft80x/ft80x_coprocessor.c +++ b/examples/ft80x/ft80x_coprocessor.c @@ -524,7 +524,9 @@ int ft80x_coproc_button(int fd, FAR struct ft80x_dlbuffer_s *buffer) int ft80x_coproc_clock(int fd, FAR struct ft80x_dlbuffer_s *buffer) { +#ifndef CONFIG_EXAMPLES_FT80X_EXCLUDE_BITMAPS FAR const struct ft80x_bitmaphdr_s *bmhdr = &g_lenaface_bmhdr; +#endif int16_t xoffset; int16_t yoffset; int16_t radius; @@ -604,6 +606,7 @@ int ft80x_coproc_clock(int fd, FAR struct ft80x_dlbuffer_s *buffer) xdist = FT80X_DISPLAY_WIDTH / 5; radius = xdist / 2 - FT80X_DISPLAY_WIDTH / 64; +#ifndef CONFIG_EXAMPLES_FT80X_EXCLUDE_BITMAPS /* Copy the image into graphics ram for the Lena faced clock */ ret = ft80x_ramg_write(fd, 0, bmhdr->data, bmhdr->stride * bmhdr->height); @@ -612,6 +615,7 @@ int ft80x_coproc_clock(int fd, FAR struct ft80x_dlbuffer_s *buffer) ft80x_err("ERROR: ft80x_ramg_write() failed: %d\n", ret); return ret; } +#endif /* Create the hardware display list */ @@ -834,6 +838,7 @@ int ft80x_coproc_clock(int fd, FAR struct ft80x_dlbuffer_s *buffer) return ret; } +#ifndef CONFIG_EXAMPLES_FT80X_EXCLUDE_BITMAPS /* Lena clock with no background and no ticks */ xoffset += 2 * radius + 10; @@ -910,6 +915,7 @@ int ft80x_coproc_clock(int fd, FAR struct ft80x_dlbuffer_s *buffer) ft80x_err("ERROR: ft80x_dl_data failed: %d\n", ret); return ret; } +#endif /* Finally, terminate the display list */ @@ -932,7 +938,9 @@ int ft80x_coproc_clock(int fd, FAR struct ft80x_dlbuffer_s *buffer) int ft80x_coproc_gauge(int fd, FAR struct ft80x_dlbuffer_s *buffer) { +#ifndef CONFIG_EXAMPLES_FT80X_EXCLUDE_BITMAPS FAR const struct ft80x_bitmaphdr_s *bmhdr = &g_lenaface_bmhdr; +#endif int16_t xoffset; int16_t yoffset; int16_t radius; @@ -1020,6 +1028,7 @@ int ft80x_coproc_gauge(int fd, FAR struct ft80x_dlbuffer_s *buffer) xdist = FT80X_DISPLAY_WIDTH / 5; radius = xdist / 2 - FT80X_DISPLAY_WIDTH / 64; +#ifndef CONFIG_EXAMPLES_FT80X_EXCLUDE_BITMAPS /* Copy the image into graphics ram for the Lena faced gauge */ ret = ft80x_ramg_write(fd, 0, bmhdr->data, bmhdr->stride * bmhdr->height); @@ -1028,6 +1037,7 @@ int ft80x_coproc_gauge(int fd, FAR struct ft80x_dlbuffer_s *buffer) ft80x_err("ERROR: ft80x_ramg_write() failed: %d\n", ret); return ret; } +#endif /* Create the hardware display list */ @@ -1297,6 +1307,7 @@ int ft80x_coproc_gauge(int fd, FAR struct ft80x_dlbuffer_s *buffer) return ret; } +#ifndef CONFIG_EXAMPLES_FT80X_EXCLUDE_BITMAPS /* Lena gauge with no background and no ticks */ xoffset += 2 * radius + 10; @@ -1368,6 +1379,7 @@ int ft80x_coproc_gauge(int fd, FAR struct ft80x_dlbuffer_s *buffer) ft80x_err("ERROR: ft80x_dl_data failed: %d\n", ret); return ret; } +#endif /* Finally, terminate the display list */ @@ -3889,6 +3901,7 @@ int ft80x_coproc_spinner(int fd, FAR struct ft80x_dlbuffer_s *buffer) * ****************************************************************************/ +#ifndef CONFIG_EXAMPLES_FT80X_EXCLUDE_BITMAPS int ft80x_coproc_screensaver(int fd, FAR struct ft80x_dlbuffer_s *buffer) { FAR const struct ft80x_bitmaphdr_s *bmhdr = &g_lenaface_bmhdr; @@ -4044,6 +4057,7 @@ int ft80x_coproc_screensaver(int fd, FAR struct ft80x_dlbuffer_s *buffer) return ret; } +#endif /**************************************************************************** * Name: ft80x_coproc_logo diff --git a/examples/ft80x/ft80x_main.c b/examples/ft80x/ft80x_main.c index 5a2a1e379..8ead4a8c2 100644 --- a/examples/ft80x/ft80x_main.c +++ b/examples/ft80x/ft80x_main.c @@ -142,7 +142,9 @@ static const struct ft80x_exampleinfo_s g_coproc[] = { "Number", ft80x_coproc_number }, { "Calibrate", ft80x_coproc_calibrate }, { "Spinner", ft80x_coproc_spinner }, +#ifndef CONFIG_EXAMPLES_FT80X_EXCLUDE_BITMAPS { "Screen Saver", ft80x_coproc_screensaver }, +#endif { "Logo", ft80x_coproc_logo } };