From deddb00a3a3ccee1f3b258b6d5e9c4074bdf0f50 Mon Sep 17 00:00:00 2001 From: Christian Groessler Date: Sun, 1 Jun 2014 19:17:02 +0200 Subject: [PATCH] use DYN_DRV and MOUSE_DRIVER defines to decide which driver to use --- testcode/lib/joy-test.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/testcode/lib/joy-test.c b/testcode/lib/joy-test.c index f9b3a668a..bea8be718 100644 --- a/testcode/lib/joy-test.c +++ b/testcode/lib/joy-test.c @@ -5,8 +5,15 @@ #include #include +#ifdef MOUSE_DRIVER +/* A statically linked driver was named on the compiler's command line. +** Make sure that it is used instead of a dynamic one. +*/ +# undef DYN_DRV +# define DYN_DRV 0 +#endif + #if defined(__NES__) || defined(__ATARI5200__) -#define STATIC_DRIVER #define NO_OSERROR #endif @@ -17,11 +24,14 @@ int main (void) unsigned char count; unsigned char i; -#ifdef STATIC_DRIVER - unsigned char Res = joy_install (&joy_static_stddrv); -#else +#if DYN_DRV unsigned char Res = joy_load_driver (joy_stddrv); +#elif defined(MOUSE_DRIVER) + unsigned char Res = joy_install (&MOUSE_DRIVER); +#else + unsigned char Res = joy_install (&joy_static_stddrv); #endif + if (Res != JOY_ERR_OK) { cprintf ("Error in joy_load_driver: %u\r\n", Res); #ifndef NO_OSERROR @@ -64,4 +74,3 @@ int main (void) } return 0; } - -- 2.39.5