Commit Graph

46 Commits (5fcac8699950a5585bd90ef0d155328b4c67b428)

Author SHA1 Message Date
nirenjan 5be91b6e50 Fix stringification of libx52_led_state
A missing comma at the end of the STRINGIFY line was causing builds with
clang to have segfaults with the default configuration. It turned out
that due to the missing comma, the N_("Unknown LED state %d") and
N_("off") parameters were getting merged into a single parameter by
clang, but interestingly, not by GCC.

As a result, when building with clang, the array is "on", "red",
"amber", "green" - note the missing "off" at the beginning of the array.
This causes clang generated builds to segfault when attemping to log a
trace message when configuring LED A (which defaults to green, and the
index of LIBX52_LED_STATE_GREEN exceeds the array bounds).
2021-08-25 14:09:28 -07:00
nirenjan e968656672 Fix Cflags and add libx52util.pc 2021-08-03 12:53:26 -07:00
nirenjan f6cfc59cb6 Fix libx52 pkgconfig file 2021-08-03 12:42:15 -07:00
nirenjan 3efdce5abe Fix make distcheck 2021-08-01 23:56:37 -07:00
nirenjan 38917ed6e5 Add documentation for x52d 2021-08-01 23:47:24 -07:00
nirenjan ac68ee07e5 Use non-recursive Automake 2021-07-29 23:53:21 -07:00
nirenjan e3bccd3ac3 Move libx52 to top level 2021-07-29 21:41:07 -07:00
nirenjan f0a0a7dcaf Reorganize source layout 2017-07-27 17:56:51 -07:00
nirenjan 7bc0ba522c Use LIBUSB_* values instead of magic numbers 2017-07-27 17:37:58 -07:00
nirenjan e053e1ac1c Add support for the X52 (non-Pro model)
This uses the published device IDs for the Saitek X52 (non-Pro) model.
However, based on my knowledge, the X52 uses single color LEDs compared
to the X52 Pro's tri-color LEDs (Red/Amber/Green). For the time being,
until we can determine the actual control messages being sent to the
X52, setting the LED state will not be supported.

This commit also operates on the assumption that the other controls are
the same as the X52 Pro, specifically the following:
- Setting MFD/LED brightness
- Setting MFD text
- Setting blink and shift
- Seting time and date on the MFD clock

Issue: #11
2017-01-10 22:03:13 -08:00
nirenjan 793cd519a2 Add check for X52 vs X52 Pro
This doesn't do anything at the moment, but this should make it easier
to distinguish between the Pro and non-pro models.

Issue: #11
2017-01-10 21:18:26 -08:00
nirenjan 0f7b5e5668 Remove unused members from struct libx52_device 2017-01-10 21:15:14 -08:00
Ryan Drake ae97d58bd5 Use zero instead of LIBUSB_ERROR_OTHER as default value for rc 2016-10-08 09:22:17 -07:00
Ryan Drake aaab4c6b1d Conditionalize use of ELIBACC on __linux__ as it is linux-specific 2016-10-07 19:18:55 -07:00
Ryan Drake 95e933e27c Fix warnings about uninitialized variables 2016-10-06 15:43:32 -07:00
nirenjan ea2927859b Fix includedir location for headers 2016-05-16 22:15:19 -07:00
nirenjan db19e4dcae Install headers to includedir 2015-12-13 13:44:32 -08:00
nirenjan 059ec6af1a Make libx52_set_clock return 0 only if fields changed
This is used by an application to check if it needs to call
libx52_update. If libx52_set_clock returns 0, it can be assumed that the
clock did change values that require an update, but any other value
indicates that an update is not required.
2015-12-12 23:11:36 -08:00
nirenjan b0309b1b40 Reduce number of control messages for clock update
Compare the stored clock value against the requested value and only
send the USB vendor control messages if necessary. This should reduce
the number of messages from 5 for every clock update to 1-3, depending
on whether the date has changed or not. Only if the timezone of the
default clock changes should the additional 2 messages for the offset
clocks be sent.
2015-12-11 09:04:54 -08:00
nirenjan ce9f58c15a Add README files to distribution 2015-12-10 22:44:44 -08:00
nirenjan c87e785a18 Restructure code layout
Copy files to individual folders. This makes it cleaner to add new
functionality in the future.
2015-12-08 21:46:42 -08:00
nirenjan 326075406a Fix check for libusb in configure.ac 2015-12-08 20:07:04 -08:00
nirenjan 7ddde96cc6 Add character map parser generator
This also adds automake rules to generate the utility library from the
generated source file.
2015-12-08 07:55:54 -08:00
nirenjan 0ad71bd24f Add X52 character mapping configuration file
This file is parsed during compilation time to generate a static lookup
table which is used to convert UTF-8 text to a character supported by
the X52 MFD.
2015-12-07 23:08:21 -08:00
nirenjan b7141a3e8b Add check for joystick when initializing library
Fix C++ inclusion
2015-12-06 12:57:15 -08:00
nirenjan f2ee9707cb Wrap public header in extern C 2015-12-05 23:22:11 -08:00
nirenjan 531c92ecab Add header file to x52test_SOURCES
The absence was causing `make distcheck' to fail.
2015-12-04 20:33:08 -08:00
nirenjan b7fe3e484c Enhance clock test to test all portions of clock 1 2015-12-04 19:34:19 -08:00
nirenjan f8a7257b54 Export vendor command interface
The vendor command interface allows the user to write a vendor request
packet using the known vendor interface. However, it is not intended for
regular use, since the existing API is better suited to abstract it away
from the user. Rather, the prime goal is for a test harness interface
that can be used to debug problems seen during regular library accesses.
2015-12-04 18:27:21 -08:00
nirenjan cd4fca0d2e Add tests for blink, shift & clock display 2015-12-04 17:58:34 -08:00
nirenjan ebf566d9be Add retry to libx52_vendor_command
Sometimes the vendor control request failes with LIBUSB_PIPE_ERROR. Most
of the time a retry fixes it right away. To allow for a transient
failure, make the function retry the control transfer up to 3 times
before failing.
2015-12-04 16:44:41 -08:00
nirenjan 21f5440349 Make x52test more verbose 2015-12-04 10:48:24 -08:00
nirenjan 9dcc3507ed Fix Readme & help output 2015-12-03 08:39:01 -08:00
nirenjan 5d0684a154 Add x52cli command for interfacing with the X52Pro
This adds a CLI frontend to the X52 library so that the user can send
the joystick commands without having to write any code.
2015-12-02 19:11:06 -08:00
nirenjan c1f3b6abdf Add installation instructions 2015-11-30 23:37:22 -08:00
nirenjan edfff0a5f6 Add readme for libx52 2015-11-30 23:23:27 -08:00
nirenjan 77cf6c490f Move test program into src directory 2015-11-30 22:52:12 -08:00
nirenjan 032dda1dd4 Cleanup autotools code and add gitignore 2015-11-30 22:30:14 -08:00
nirenjan 5e4a6dc826 Use autotools to generate library 2015-11-30 22:12:16 -08:00
nirenjan d688334eb9 Add code to write clocks 2015-11-30 20:54:55 -08:00
nirenjan 995c5b3c63 Breakout functionality into individual files 2015-11-30 20:12:34 -08:00
nirenjan 2ccfd79bd6 Remove deprecated API functions 2015-11-30 20:02:54 -08:00
nirenjan 548f2e9357 Document X52 library functions
This is still a relative work-in-progress, since some of the functions
are being cleaned and enhanced to provide proper functionality similar
to the Windows driver.
2015-11-29 22:50:36 -08:00
nirenjan 0a541e18ba Update test cases for X52 library 2015-11-28 10:04:12 -08:00
nirenjan b5d33226c5 Implement all X52 Pro vendor commands
The current contents of the libx52 folder contain all the source code
necessary to implement the X52 Pro vendor API. These have been tested,
although the committed test file does not list all the APIs.
2015-10-31 23:19:10 -07:00
Nirenjan Krishnan 223331342e Add libx52 API files
Initial frmework of libx52. This library allows the user to write to
the X52 joystick MFD and LEDs.
2012-10-14 18:02:57 -07:00