From f1310686dead78d5bbfecba31ee10bc2ec5d3bc3 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 1 May 2012 23:31:47 +0000 Subject: Missed Calypso file git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4685 42af7a65-404d-4744-a932-0658087f49c3 --- NxWidgets/libnxwidgets/include/nxconfig.hxx | 30 +++++++++++++++++++++++------ NxWidgets/nxwm/include/nxwmconfig.hxx | 10 +++++++++- nuttx/arch/arm/src/calypso/calypso_spi.h | 30 +++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 7 deletions(-) create mode 100644 nuttx/arch/arm/src/calypso/calypso_spi.h diff --git a/NxWidgets/libnxwidgets/include/nxconfig.hxx b/NxWidgets/libnxwidgets/include/nxconfig.hxx index 682eadb82..1c7b6a3f0 100644 --- a/NxWidgets/libnxwidgets/include/nxconfig.hxx +++ b/NxWidgets/libnxwidgets/include/nxconfig.hxx @@ -119,13 +119,18 @@ */ #ifndef CONFIG_NXWIDGETS_SERVERPRIO -# define CONFIG_NXWIDGETS_SERVERPRIO SCHED_PRIORITY_DEFAULT +# define CONFIG_NXWIDGETS_SERVERPRIO (SCHED_PRIORITY_DEFAULT+1) #endif #ifndef CONFIG_NXWIDGETS_CLIENTPRIO # define CONFIG_NXWIDGETS_CLIENTPRIO SCHED_PRIORITY_DEFAULT #endif +#if CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWIDGETS_CLIENTPRIO +# warning "CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWIDGETS_CLIENTPRIO" +# warning" -- This can result in data overrun errors" +#endif + /** * NX server thread stack size (in multi-user mode) */ @@ -142,6 +147,11 @@ # define CONFIG_NXWIDGETS_LISTENERPRIO SCHED_PRIORITY_DEFAULT #endif +#if CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWIDGETS_LISTENERPRIO +# warning "CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWIDGETS_LISTENERPRIO" +# warning" -- This can result in data overrun errors" +#endif + /** * NX listener thread stack size (in multi-user mode) */ @@ -157,11 +167,19 @@ * CONFIG_NXWIDGETS_DEVNO - LCD device number (in case there are more than * one LCDs connected. Default: 0 * CONFIG_NXWIDGETS_VPLANE - Only a single video plane is supported. Default: 0 - * CONFIG_NXWIDGETS_SERVERPRIO - Priority of the NX server (in multi-user mode). - * Default: 50 - * CONFIG_NXWIDGETS_CLIENTPRIO - * CONFIG_NXWIDGETS_LISTENERPRIO - Priority of the NX event listener thread (in - * multi-user mode). Default: 50 + * CONFIG_NXWIDGETS_SERVERPRIO - Priority of the NX server. This applies + * only if NX is configured in multi-user mode (CONFIG_NX_MULTIUSER=y). + * Default: SCHED_PRIORITY_DEFAULT+1. NOTE: Of the three priority + * definitions here, CONFIG_NXWIDGETS_SERVERPRIO should have the highest + * priority to avoid data overrun race conditions. Such errors would most + * likely appear as duplicated rows of data on the display. + * CONFIG_NXWIDGETS_CLIENTPRIO - The thread that calls CNxServer::connect() + * will be re-prioritized to this priority. This applies only if NX is + * configured in multi-user mode (CONFIG_NX_MULTIUSER=y). Default: + * SCHED_PRIORITY_DEFAULT + * CONFIG_NXWIDGETS_LISTENERPRIO - Priority of the NX event listener thread. + * This applies only if NX is configured in multi-user mode + * (CONFIG_NX_MULTIUSER=y). Default: SCHED_PRIORITY_DEFAULT * CONFIG_NXWIDGETS_EXTERNINIT - Define to support external display * initialization. * CONFIG_NXWIDGETS_SERVERSTACK - NX server thread stack size (in multi-user diff --git a/NxWidgets/nxwm/include/nxwmconfig.hxx b/NxWidgets/nxwm/include/nxwmconfig.hxx index d76b08098..cfdd7510e 100644 --- a/NxWidgets/nxwm/include/nxwmconfig.hxx +++ b/NxWidgets/nxwm/include/nxwmconfig.hxx @@ -282,7 +282,10 @@ * NxConsole Window Configuration * * CONFIG_NXWM_NXCONSOLE_PRIO - Priority of the NxConsole task. Default: - * SCHED_PRIORITY_DEFAULT + * SCHED_PRIORITY_DEFAULT. NOTE: This priority should be less than + * CONFIG_NXWIDGETS_SERVERPRIO or else there may be data overrun errors. + * Such errors would most likely appear as duplicated rows of data on the + * display. * CONFIG_NXWM_NXCONSOLE_STACKSIZE - The stack size to use when starting the * NxConsole task. Default: 2048 bytes. * CONFIG_NXWM_NXCONSOLE_WCOLOR - The color of the NxConsole window background. @@ -297,6 +300,11 @@ # define CONFIG_NXWM_NXCONSOLE_PRIO SCHED_PRIORITY_DEFAULT #endif +#if CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWM_NXCONSOLE_PRIO +# warning "CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWM_NXCONSOLE_PRIO" +# warning" -- This can result in data overrun errors" +#endif + #ifndef CONFIG_NXWM_NXCONSOLE_STACKSIZE # define CONFIG_NXWM_NXCONSOLE_STACKSIZE 2048 #endif diff --git a/nuttx/arch/arm/src/calypso/calypso_spi.h b/nuttx/arch/arm/src/calypso/calypso_spi.h new file mode 100644 index 000000000..cb44a6291 --- /dev/null +++ b/nuttx/arch/arm/src/calypso/calypso_spi.h @@ -0,0 +1,30 @@ +#ifndef ___ARCH_ARM_SRC_CALYPSO_CALYPSO_SPI_H +#define ___ARCH_ARM_SRC_CALYPSO_CALYPSO_SPI_H + +#define BASE_ADDR_SPI 0xfffe3000 +#define SPI_REG(n) (BASE_ADDR_SPI+(n)) + +enum spi_regs { + REG_SET1 = 0x00, + REG_SET2 = 0x02, + REG_CTRL = 0x04, + REG_STATUS = 0x06, + REG_TX_LSB = 0x08, + REG_TX_MSB = 0x0a, + REG_RX_LSB = 0x0c, + REG_RX_MSB = 0x0e, +}; + +#define SPI_SET1_EN_CLK (1 << 0) +#define SPI_SET1_WR_IRQ_DIS (1 << 4) +#define SPI_SET1_RDWR_IRQ_DIS (1 << 5) + +#define SPI_CTRL_RDWR (1 << 0) +#define SPI_CTRL_WR (1 << 1) +#define SPI_CTRL_NB_SHIFT 2 +#define SPI_CTRL_AD_SHIFT 7 + +#define SPI_STATUS_RE (1 << 0) /* Read End */ +#define SPI_STATUS_WE (1 << 1) /* Write End */ + +#endif /* ___ARCH_ARM_SRC_CALYPSO_CALYPSO_SPI_H */ -- cgit v1.2.3