Squashed commit of the following:
apps/examples/ft80x: Fix some size calculations. Add option to disable primitive tests... just too boring to have to watch over and over again. apps/graphics/ft80x: Fix a typo in backlight fade logic; Fix error in formmatted display light debug dump output. apps/graphics/ft80x: Fix some warnings when debug features are enabled.
This commit is contained in:
parent
3211ab9069
commit
b0a0a39f7a
@ -18,6 +18,13 @@ config EXAMPLES_FT80X_DEVPATH
|
||||
default "/dev/ft800" if LCD_FT800
|
||||
default "/dev/ft801" if LCD_FT801
|
||||
|
||||
config EXAMPLES_FT80X_PRIMITIVES
|
||||
bool "Enable primitive examples"
|
||||
default n
|
||||
---help---
|
||||
Enable some low level tests of GPU primitives. Not very interesting
|
||||
for the most part.
|
||||
|
||||
config EXAMPLES_FT80X_EXCLUDE_BITMAPS
|
||||
bool "Exclude bitmaps"
|
||||
default n
|
||||
|
@ -47,8 +47,12 @@ STACKSIZE = $(CONFIG_EXAMPLES_FT80X_STACKSIZE)
|
||||
# FT80X example
|
||||
|
||||
ASRCS =
|
||||
CSRCS = ft80x_coprocessor.c
|
||||
|
||||
ifeq ($(CONFIG_EXAMPLES_FT80X_PRIMITIVES),y)
|
||||
CSRCS += ft80x_primitives.c
|
||||
endif
|
||||
|
||||
CSRCS = ft80x_primitives.c ft80x_coprocessor.c
|
||||
ifneq ($(CONFIG_EXAMPLES_FT80X_EXCLUDE_BITMAPS),y)
|
||||
CSRCS += ft80x_bitmaps.c
|
||||
endif
|
||||
|
@ -1154,7 +1154,7 @@ int ft80x_coproc_gauge(int fd, FAR struct ft80x_dlbuffer_s *buffer)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* no background color */
|
||||
/* No background color */
|
||||
|
||||
xoffset += xdist;
|
||||
|
||||
|
@ -64,6 +64,7 @@ struct ft80x_exampleinfo_s
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_EXAMPLES_FT80X_PRIMITIVES
|
||||
/* GPU Primitive display examples. Most primitives are used, but not many of
|
||||
* their various options.
|
||||
*
|
||||
@ -102,7 +103,8 @@ static const struct ft80x_exampleinfo_s g_primitives[] =
|
||||
{ "Alpha Blend", ft80x_prim_alphablend }
|
||||
};
|
||||
|
||||
#define NPRIMITIVES (sizeof(g_primitives) / sizeof(ft80x_example_t))
|
||||
#define NPRIMITIVES (sizeof(g_primitives) / sizeof(struct ft80x_exampleinfo_s))
|
||||
#endif /* CONFIG_EXAMPLES_FT80X_PRIMITIVES */
|
||||
|
||||
/* Co-processor display examples. Only a small, but interesting, subset
|
||||
* here co-processor command are exercised and these with only a few of the
|
||||
@ -133,6 +135,7 @@ static const struct ft80x_exampleinfo_s g_primitives[] =
|
||||
|
||||
static const struct ft80x_exampleinfo_s g_coproc[] =
|
||||
{
|
||||
{ "Calibrate", ft80x_coproc_calibrate }, /* Need to calibrate before Interactive. */
|
||||
{ "Button", ft80x_coproc_button },
|
||||
{ "Clock", ft80x_coproc_clock },
|
||||
{ "Gauge", ft80x_coproc_gauge },
|
||||
@ -144,7 +147,6 @@ static const struct ft80x_exampleinfo_s g_coproc[] =
|
||||
{ "Dial", ft80x_coproc_dial },
|
||||
{ "Toggle", ft80x_coproc_toggle },
|
||||
{ "Number", ft80x_coproc_number },
|
||||
{ "Calibrate", ft80x_coproc_calibrate },
|
||||
{ "Spinner", ft80x_coproc_spinner },
|
||||
#ifndef CONFIG_EXAMPLES_FT80X_EXCLUDE_BITMAPS
|
||||
{ "Screen Saver", ft80x_coproc_screensaver },
|
||||
@ -152,7 +154,7 @@ static const struct ft80x_exampleinfo_s g_coproc[] =
|
||||
{ "Logo", ft80x_coproc_logo }
|
||||
};
|
||||
|
||||
#define NCOPROC (sizeof(g_primitives) / sizeof(ft80x_example_t))
|
||||
#define NCOPROC (sizeof(g_coproc) / sizeof(struct ft80x_exampleinfo_s))
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
@ -320,6 +322,7 @@ int ft80x_main(int argc, char *argv[])
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_EXAMPLES_FT80X_PRIMITIVES
|
||||
/* Perform tests on a few of the FT80x primitive functions */
|
||||
|
||||
ft80x_info("FT80x Primitive Functions\n");
|
||||
@ -328,6 +331,7 @@ int ft80x_main(int argc, char *argv[])
|
||||
{
|
||||
(void)ft80x_example(fd, buffer, &g_primitives[i]);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Perform tests on a few of the FT80x Co-processor functions */
|
||||
|
||||
|
@ -63,7 +63,6 @@
|
||||
* fd - The file descriptor of the FT80x device. Opened by the caller
|
||||
* with write access.
|
||||
* duty - The new backlight duty (as a percentage 0..100)
|
||||
* delay - The duration of the fade in milliseconds.
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) on success. A negated errno value on failure.
|
||||
@ -118,7 +117,7 @@ int ft80x_backlight_fade(int fd, uint8_t duty, uint16_t delay)
|
||||
|
||||
/* Perform the IOCTL to perform the fade */
|
||||
|
||||
fade.delay = duty;
|
||||
fade.duty = duty;
|
||||
fade.delay = delay;
|
||||
|
||||
ret = ioctl(fd, FT80X_IOC_FADE, (unsigned long)((uintptr_t)&fade));
|
||||
|
@ -96,7 +96,7 @@ static void ft80x_dl_dump(FAR struct ft80x_dlbuffer_s *buffer,
|
||||
max = i + 4;
|
||||
if (max >= nwords)
|
||||
{
|
||||
max = nwords - i;
|
||||
max = nwords;
|
||||
}
|
||||
|
||||
for (j = i; j < max; j++)
|
||||
@ -107,9 +107,9 @@ static void ft80x_dl_dump(FAR struct ft80x_dlbuffer_s *buffer,
|
||||
putchar(' ');
|
||||
|
||||
max = i + 8;
|
||||
if (i + max >= nwords)
|
||||
if (max >= nwords)
|
||||
{
|
||||
max = nwords - i;
|
||||
max = nwords;
|
||||
}
|
||||
|
||||
for (j = i + 4; j < max; j++)
|
||||
|
@ -225,7 +225,7 @@ int ft80x_putreg8(int fd, uint32_t addr, uint8_t value)
|
||||
struct ft80x_register_s reg;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(value != NULL && (addr & 3) == 0 && addr < 0xffc00000);
|
||||
DEBUGASSERT((addr & 3) == 0 && addr < 0xffc00000);
|
||||
|
||||
/* Perform the IOCTL to get the register value */
|
||||
|
||||
@ -248,7 +248,7 @@ int ft80x_putreg16(int fd, uint32_t addr, uint16_t value)
|
||||
struct ft80x_register_s reg;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(value != NULL && (addr & 3) == 0 && addr < 0xffc00000);
|
||||
DEBUGASSERT((addr & 3) == 0 && addr < 0xffc00000);
|
||||
|
||||
/* Perform the IOCTL to get the register value */
|
||||
|
||||
@ -271,7 +271,7 @@ int ft80x_putreg32(int fd, uint32_t addr, uint32_t value)
|
||||
struct ft80x_register_s reg;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(value != NULL && (addr & 3) == 0 && addr < 0xffc00000);
|
||||
DEBUGASSERT((addr & 3) == 0 && addr < 0xffc00000);
|
||||
|
||||
/* Perform the IOCTL to get the register value */
|
||||
|
||||
|
@ -510,7 +510,6 @@ int ft80x_audio_playfile(int fd, FAR struct ft80x_dlbuffer_s *buffer,
|
||||
* fd - The file descriptor of the FT80x device. Opened by the caller
|
||||
* with write access.
|
||||
* duty - The new backlight duty (as a percentage 0..100)
|
||||
* delay - The duration of the fade in milliseconds.
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) on success. A negated errno value on failure.
|
||||
|
Loading…
x
Reference in New Issue
Block a user