From 77cf6c490f37b2fd9556c65203a12dc6666a645b Mon Sep 17 00:00:00 2001 From: nirenjan Date: Mon, 30 Nov 2015 22:52:12 -0800 Subject: [PATCH] Move test program into src directory --- libx52/Makefile.am | 9 ++++++++- libx52/configure.ac | 1 + libx52/{x52test.c => src/x52_test.c} | 7 ++++--- 3 files changed, 13 insertions(+), 4 deletions(-) rename libx52/{x52test.c => src/x52_test.c} (99%) diff --git a/libx52/Makefile.am b/libx52/Makefile.am index 2ac8dbb..5270877 100644 --- a/libx52/Makefile.am +++ b/libx52/Makefile.am @@ -1,6 +1,13 @@ +ACLOCAL_AMFLAGS = -I m4 + lib_LTLIBRARIES = libx52.la libx52_la_SOURCES = src/x52_common.h src/x52_commands.h src/libx52.h \ src/x52_control.c src/x52_core.c \ src/x52_date_time.c src/x52_mfd_led.c -libx52_la_LDFLAGS = -version-info 1:0:0 +libx52_la_LDFLAGS = -version-info 1:0:0 -lusb-1.0 pkginclude_HEADERS = src/libx52.h + +noinst_PROGRAMS = x52_test +x52_test_SOURCES = src/x52_test.c +x52_test_LDADD = libx52.la + diff --git a/libx52/configure.ac b/libx52/configure.ac index d21d01e..cab3d8d 100644 --- a/libx52/configure.ac +++ b/libx52/configure.ac @@ -1,4 +1,5 @@ AC_INIT([libx52], [1.0.0], [nirenjan@gmail.com]) +AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects]) AC_PROG_CC AM_PROG_AR diff --git a/libx52/x52test.c b/libx52/src/x52_test.c similarity index 99% rename from libx52/x52test.c rename to libx52/src/x52_test.c index 6910a45..0a13b61 100644 --- a/libx52/x52test.c +++ b/libx52/src/x52_test.c @@ -12,9 +12,6 @@ typedef void (*test_func)(libx52_device *dev, int step); /* Run test initializations */ static void test_cleanup(libx52_device *dev) { - libx52_set_brightness(dev, 1, 127); - libx52_set_brightness(dev, 0, 127); - /* Set the default LED states */ libx52_set_led_state(dev, LIBX52_LED_FIRE, LIBX52_LED_STATE_ON); libx52_set_led_state(dev, LIBX52_LED_A, LIBX52_LED_STATE_GREEN); @@ -36,6 +33,10 @@ static void test_cleanup(libx52_device *dev) libx52_set_text(dev, 0, " Saitek X52 Pro", 15); libx52_set_text(dev, 1, " Flight ", 15); libx52_set_text(dev, 2, " Control System", 15); + + /* Maximum brightness */ + libx52_set_brightness(dev, 1, 127); + libx52_set_brightness(dev, 0, 127); } static void test_mfd_display(libx52_device *dev, int step)