diff options
author | Gabe Black <gabeblack@chromium.org> | 2011-07-21 02:21:03 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2011-08-29 10:59:14 -0700 |
commit | d7ea23293dfd81bbfb4a3e3d1cc7e6b89afaabc5 (patch) | |
tree | bb87f646f3468661c5ddce87d764300ef0a975c3 /lib/vbexport | |
parent | 8d49b64ce973fe4b4767b26d10fea252322d34dc (diff) |
Conditionally implement vbexport functions
There are a few functions in display.c in the vbexport library which depend
on being able to call functions provided by the LCD driver. If that support
isn't turned on then compilation will fail. It can't always be turned on
because it's not always the right driver to use.
This change conditionally compiles in the existing implementation if the
right support is available and compiles in a warning message and a failing
return code if it isn't.
BUG=chrome-os-partner:4552
TEST=Built on x86.
Signed-off-by: Gabe Black <gabeblack@google.com>
Change-Id: I70695f06bb1b55063d035307e0420f8fc58b1efa
Reviewed-on: http://gerrit.chromium.org/gerrit/4768
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
Diffstat (limited to 'lib/vbexport')
-rw-r--r-- | lib/vbexport/display.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/vbexport/display.c b/lib/vbexport/display.c index b1f50133a5b..4f72cedf821 100644 --- a/lib/vbexport/display.c +++ b/lib/vbexport/display.c @@ -54,6 +54,7 @@ VbError_t VbExDisplayBacklight(uint8_t enable) return VBERROR_SUCCESS; } +#ifdef CONFIG_LCD /* Print the message on the center of LCD. */ static void print_on_center(const char *message) { @@ -84,9 +85,11 @@ static void print_on_center(const char *message) VbExDisplayDebugInfo(result); } +#endif VbError_t VbExDisplayScreen(uint32_t screen_type) { +#ifdef CONFIG_LCD /* * Show the debug messages for development. It is a backup method * when GBB does not contain a full set of bitmaps. @@ -117,8 +120,13 @@ VbError_t VbExDisplayScreen(uint32_t screen_type) return 1; } return VBERROR_SUCCESS; +#else + printf("VbExDisplayScreen needs lcd support which isn't configured.\n"); + return 1; +#endif } +#ifdef CONFIG_LCD static uint8_t *uncompress_lzma(uint8_t *in_addr, SizeT in_size, SizeT out_size) { @@ -133,10 +141,12 @@ static uint8_t *uncompress_lzma(uint8_t *in_addr, SizeT in_size, } return out_addr; } +#endif VbError_t VbExDisplayImage(uint32_t x, uint32_t y, const ImageInfo *info, const void *buffer) { +#ifdef CONFIG_LCD int ret; uint8_t *raw_data; @@ -172,14 +182,24 @@ VbError_t VbExDisplayImage(uint32_t x, uint32_t y, const ImageInfo *info, } return VBERROR_SUCCESS; +#else + printf("VbExDisplayImage needs lcd support which isn't configured.\n"); + return 1; +#endif } VbError_t VbExDisplayDebugInfo(const char *info_str) { +#ifdef CONFIG_LCD /* Show the debug message on the upper left corner */ console_col = 0; console_row = 0; lcd_puts(info_str); return VBERROR_SUCCESS; +#else + printf("VbExDisplayDebugInfo needs lcd support which isn't " + "configured.\n"); + return 1; +#endif } |