SIM: Several fixes to the simulated joystick driver. Still buggy
This commit is contained in:
parent
e6927cfcac
commit
ebd263d3bd
@ -149,7 +149,7 @@ static int trv_joystick_wait(void)
|
|||||||
{
|
{
|
||||||
int errcode = errno;
|
int errcode = errno;
|
||||||
|
|
||||||
fprintf(stderr, "ERROR: sigwaitinfo() failed: %d\n", errcode);
|
fprintf(stderr, "ERROR: sigwaitinfo() failed: %d\n", errcode);
|
||||||
return -errcode;
|
return -errcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,7 +158,7 @@ static int trv_joystick_wait(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: trv_joystick_sample
|
* Name: trv_joystick_read
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Read one sample from the analog joystick
|
* Read one sample from the analog joystick
|
||||||
@ -524,18 +524,14 @@ void trv_input_read(void)
|
|||||||
#if defined(CONFIG_GRAPHICS_TRAVELER_JOYSTICK)
|
#if defined(CONFIG_GRAPHICS_TRAVELER_JOYSTICK)
|
||||||
#if defined(CONFIG_GRAPHICS_TRAVELER_AJOYSTICK)
|
#if defined(CONFIG_GRAPHICS_TRAVELER_AJOYSTICK)
|
||||||
struct ajoy_sample_s sample;
|
struct ajoy_sample_s sample;
|
||||||
ssize_t nread;
|
int ret;
|
||||||
|
|
||||||
/* Read data from the analog joystick */
|
/* Read data from the analog joystick */
|
||||||
|
|
||||||
nread = trv_joystick_read(&sample);
|
ret = trv_joystick_read(&sample);
|
||||||
if (nread < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
trv_abort("ERROR: Joystick read error: %d\n", errno);
|
trv_abort("ERROR: trv_joystick_read() failed: %d\n", ret);
|
||||||
}
|
|
||||||
else if (nread != sizeof(struct ajoy_sample_s))
|
|
||||||
{
|
|
||||||
trv_abort("ERROR: Unexpected joystick read size: %ld\n", (long)nread);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Determine the input data to return to the POV logic */
|
/* Determine the input data to return to the POV logic */
|
||||||
|
Loading…
Reference in New Issue
Block a user