Fix NXFFS compilation error

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3990 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2011-09-28 18:24:00 +00:00
parent d9d6990d9f
commit 07acb131f0
3 changed files with 21 additions and 39 deletions

View File

@ -44,7 +44,6 @@
#include <nuttx/arch.h>
#include <nuttx/fs.h>
#include "os_internal.h"
#include "up_internal.h"
/****************************************************************************
@ -107,24 +106,4 @@ void up_initialize(void)
#ifdef CONFIG_NET
uipdriver_init(); /* Our "real" netwok driver */
#endif
/* Start the X11 event loop and register the touchscreen driver */
#if defined(CONFIG_SIM_X11FB) && defined(CONFIG_SIM_TOUCHSCREEN)
{
int ret;
/* Start the X11 event loop */
ret = KERNEL_THREAD("evloop", CONFIG_SIM_EVLOOPPRIORITY,
CONFIG_SIM_EVLOOPSTACKSIZE,
(main_t)up_x11eventloop, (const char **)NULL);
ASSERT(ret != ERROR);
/* Register the touchscreen driver */
ret = up_tcregister(0);
ASSERT(ret == OK);
}
#endif
}

View File

@ -182,7 +182,6 @@ extern int up_x11eventloop(int argc, char *argv[]);
#ifdef CONFIG_SIM_X11FB
#ifdef CONFIG_SIM_TOUCHSCREEN
extern int up_tcregister(int minor);
extern int up_tcenter(int x, int y, int buttons);
extern int up_tcleave(int x, int y, int buttons);
#endif

View File

@ -58,6 +58,7 @@
#include <nuttx/input/touchscreen.h>
#include "os_internal.h"
#include "up_internal.h"
/****************************************************************************
@ -106,6 +107,7 @@ struct up_dev_s
bool penchange; /* An unreported event is buffered */
sem_t devsem; /* Manages exclusive access to this structure */
sem_t waitsem; /* Used to wait for the availability of data */
pid_t eventloop; /* PID of the eventloop */
struct up_sample_s sample; /* Last sampled touch point data */
@ -604,15 +606,13 @@ errout:
****************************************************************************/
/****************************************************************************
* Name: up_tcregister
* Name: up_simtouchscreen
*
* Description:
* Configure the touchscreen to use the provided I2C device instance. This
* will register the driver as /dev/inputN where N is the minor device
* number
* Configure the simulated touchscreen. This will register the driver as
* /dev/inputN where N is the minor device number
*
* Input Parameters:
* dev - An I2C driver instance
* minor - The input device minor number
*
* Returned Value:
@ -621,9 +621,9 @@ errout:
*
****************************************************************************/
int up_tcregister(int minor)
int up_simtouchscreen(int minor)
{
FAR struct up_dev_s *priv;
FAR struct up_dev_s *priv = ( FAR struct up_dev_s *)&g_simtouchscreen;
char devname[DEV_NAMELEN];
int ret;
@ -631,11 +631,7 @@ int up_tcregister(int minor)
/* Debug-only sanity checks */
DEBUGASSERT(minor >= 0 && minor < 100);
/* Create and initialize a touchscreen device driver instance */
priv = &g_simtouchscreen;
DEBUGASSERT(minor >= 0 && minor < 100 && priv->eventloop == 0);
/* Initialize the touchscreen device driver instance */
@ -643,6 +639,18 @@ int up_tcregister(int minor)
sem_init(&priv->devsem, 0, 1); /* Initialize device structure semaphore */
sem_init(&priv->waitsem, 0, 0); /* Initialize pen event wait semaphore */
/* Start the X11 event loop */
ret = KERNEL_THREAD("evloop", CONFIG_SIM_EVLOOPPRIORITY,
CONFIG_SIM_EVLOOPSTACKSIZE,
(main_t)up_x11eventloop, (const char **)NULL);
if (ret < 0)
{
idbg("Failed to start event loop: %d\n", ret);
goto errout_with_priv;
}
priv->eventloop = ret;
/* Register the device as an input device */
(void)snprintf(devname, DEV_NAMELEN, DEV_FORMAT, minor);
@ -660,10 +668,8 @@ int up_tcregister(int minor)
return OK;
errout_with_priv:
sem_destroy(&priv->waitsem);
sem_destroy(&priv->devsem);
#ifdef CONFIG_touchscreen_MULTIPLE
kfree(priv);
#endif
return ret;
}
@ -749,5 +755,3 @@ int up_tcleave(int x, int y, int buttons)
}
return OK;
}