X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=input.c;h=12654e4168578ef521ec82bd0784ad45750b631b;hb=c54d04fd84f59c60c6ecdbd2502fbda5de735b4b;hp=38818585cef3f68488ea136715522e302bc88c15;hpb=f89d84717ae3536779f04cdfb57cf940d2bd8ade;p=libpicofe.git diff --git a/input.c b/input.c index 3881858..12654e4 100644 --- a/input.c +++ b/input.c @@ -17,10 +17,6 @@ #include "plat.h" #include "lprintf.h" -#ifdef IN_GP2X -#error needs update: in_gp2x_init in_gp2x_update -#include "../gp2x/in_gp2x.h" -#endif #ifdef IN_VK #error needs update: in_vk_init in_vk_update #include "../win32/in_vk.h" @@ -518,6 +514,9 @@ int in_get_config(int dev_id, int what, void *val) case IN_CFG_KEY_NAMES: return -1; /* not implemented */ default: + if (!dev->probed) + return -1; + return DRV(dev->drv_id).get_config(dev->drv_data, what, ival); } @@ -531,9 +530,12 @@ static int in_set_blocking(int is_blocking) /* have_async_devs means we will have to do all reads async anyway.. */ if (!in_have_async_devs) { for (i = 0; i < in_dev_count; i++) { - if (in_devices[i].probed) - DRV(in_devices[i].drv_id).set_config(in_devices[i].drv_data, - IN_CFG_BLOCKING, is_blocking); + if (!in_devices[i].probed) + continue; + + DRV(in_devices[i].drv_id).set_config( + in_devices[i].drv_data, IN_CFG_BLOCKING, + is_blocking); } } @@ -880,7 +882,7 @@ void in_clean_binds(void) int ret, count, *binds, *def_binds; in_dev_t *dev = &in_devices[i]; - if (dev->binds == NULL || dev->drv_data == NULL) + if (dev->binds == NULL || !dev->probed) continue; count = dev->key_count;