diff --git a/configs/sam3u-ek/src/up_spi.c b/configs/sam3u-ek/src/up_spi.c index 3b5089238b0..5c70a5ab536 100644 --- a/configs/sam3u-ek/src/up_spi.c +++ b/configs/sam3u-ek/src/up_spi.c @@ -134,18 +134,21 @@ void weak_function sam3u_spiinitialize(void) ****************************************************************************/ #ifdef CONFIG_SAM3U_SPI -void sam3u_spiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) +int sam3u_spiselect(enum spi_dev_e devid) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + int cs = -EINVAL; #if defined(CONFIG_INPUT) && defined(CONFIG_INPUT_ADS7843E) if (devid == SPIDEV_TOUCHSCREEN) { /* Assert the CS pin to the OLED display */ - (void)lpc17_gpiowrite(GPIO_TSC_NPCS2, !selected); + cs = 2; } #endif + + spidbg("devid: %d CS: %d\n", (int)devid, cs); + return cs; } uint8_t sam3u_spistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid) diff --git a/configs/sam3u-ek/src/up_touchscreen.c b/configs/sam3u-ek/src/up_touchscreen.c index 2d4b2ef18fa..40dd2db15b0 100755 --- a/configs/sam3u-ek/src/up_touchscreen.c +++ b/configs/sam3u-ek/src/up_touchscreen.c @@ -50,11 +50,21 @@ #include #include "sam3u_internal.h" -#include "sam3uek_internal.h.h" +#include "sam3uek_internal.h" /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ +/* Configuration ************************************************************/ + +#ifdef CONFIG_INPUT_ADS7843E +#ifndef CONFIG_INPUT +# error "Touchscreen support requires CONFIG_INPUT" +#endif + +#ifndef CONFIG_SAM3U_SPI +# error "Touchscreen support requires CONFIG_SAM3U_SPI" +#endif /**************************************************************************** * Static Function Prototypes @@ -150,7 +160,6 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state) return sam3u_gpioread(GPIO_ADS7843E); } -#endif /* HAVE_TOUCHSCREEN */ /**************************************************************************** * Public Functions @@ -195,3 +204,4 @@ int up_tcinitialize(void) return OK; } +#endif /* CONFIG_INPUT_ADS7843E */ \ No newline at end of file diff --git a/configs/sam3u-ek/touchscreen/defconfig b/configs/sam3u-ek/touchscreen/defconfig index f1692919374..4ce1dea24ae 100755 --- a/configs/sam3u-ek/touchscreen/defconfig +++ b/configs/sam3u-ek/touchscreen/defconfig @@ -322,7 +322,7 @@ CONFIG_SEM_NNESTPRIO=0 CONFIG_FDCLONE_DISABLE=n CONFIG_FDCLONE_STDIO=n CONFIG_SDCLONE_DISABLE=y -CONFIG_SCHED_WORKQUEUE=n +CONFIG_SCHED_WORKQUEUE=y CONFIG_SCHED_WORKPRIORITY=50 CONFIG_SCHED_WORKPERIOD=(50*1000) CONFIG_SCHED_WORKSTACKSIZE=1024