Commit Graph

131 Commits (v0.3.0)

Author SHA1 Message Date
nirenjan cf89e3d610 Override `time` from libc
Prior to this change, there were spurious build failures seen in Github
CI, especially on macOS builds, where one test out of ~2000 would fail
randomly. After adding an option to display the diagnostics, it was
determined that the failure was only in the tests that included the
timestamp. This was because the time call was returning different values
between `test_setup` and `pinelog_log_message`. Even though they may
have been called milliseconds apart, the time skew was enough to have a
1 second difference between the two returned values.

This change overrides the `time` method from libc, and returns a static
value. With this change, CI should work fine regardless of how slow the
tests run.
2021-11-11 07:02:21 -08:00
nirenjan e9d4e81a4d Display TAP diagnostics in build log 2021-11-11 06:21:20 -08:00
nirenjan f4a8e7c4d5 Do not print NULL module names
Prior to this change, if a module had not registered a name, then the
output would display `(null): `, which was not really helpful. This
change eliminates that by checking if the module name is not NULL prior
to calling the print routines.
2021-11-10 09:27:40 -08:00
nirenjan 86f599fc6e Update logging library to include module and string buffer
This commit adds the following changes to pinelog:

- Optional buffer to write the message to prior to writing to the output
  stream. This reduces the likelihood of log messages from multiple
  threads interleaving due to multiple calls to fputs/fprintf, etc. The
  default is to still write directly to the output stream, but the
  integrator can add a define of PINELOG_BUFFER_SZ to the CFLAGS, and
  this will allow the application to log messages that are shorter than
  the above size, including the timestamp, level and backtrace if any.

- Optional module level logging. This allows more fine-grained
  debugging, where the application can control the log levels of the
  individual modules. By default, when modules are configured, they
  default to the global log level, but this can be overridden by the
  application.
2021-11-08 16:18:30 -08:00
nirenjan 6d78ab1940 Add noreturn attribute to tap_bailout
This change is necessary since clang warns on a missing noreturn
attribute.
2021-10-25 12:56:41 -07:00
nirenjan 3c006d0929 Merge commit '6c17e73284fbe49a6bc7890d3e221b95db29d56f' 2021-10-25 12:51:04 -07:00
nirenjan a39945f461 Import inih library into source tree
Prior to this change, the user needed to install inih as a dependency,
either from the distribution repositories, or from source. On some
platforms (notably macOS), inih is not available prepackaged, and must
be installed by the user. This tends to cause needless friction.

This change imports the ini.c and ini.h files from the upstream inih
repository into the X52 source tree. This will allow us to build the
repository on any system with the original set of dependencies, and not
have to force the user to install packages themselves.
2021-08-26 22:16:38 -07:00
nirenjan 52d6920352 Merge commit '4c9ef85223ec6e638976eb279b82b9e9ea676b35' 2021-08-25 14:22:04 -07:00
nirenjan d9c1c80163 Merge commit 'dc72e43f1e43a0149c48a684d3b5fd40441ef83c' 2021-08-03 11:26:06 -07:00
nirenjan 3b2378a54b Move libusbx52 to top level 2021-07-29 21:57:19 -07:00
nirenjan 7f30863e5d Move libx52io to top level 2021-07-29 21:51:11 -07:00
nirenjan 34adeaec45 Move libx52util to top level 2021-07-29 21:47:07 -07:00
nirenjan e3bccd3ac3 Move libx52 to top level 2021-07-29 21:41:07 -07:00
nirenjan 0eeab91a8d Remove libx52 as a dependency of libx52util 2021-07-29 21:23:00 -07:00
nirenjan 7a4d63adc1 Merge commit '8db1be2ba8dc66d3abf69a8360990c659bf28f16' into daemon 2021-07-27 17:02:49 -07:00
nirenjan 06b8d15dda Make stringification function names similar to libx52io 2021-07-27 09:34:57 -07:00
nirenjan 018852a012 Add stringification functions to libx52 2021-07-27 02:00:39 -07:00
nirenjan 77606ae906 Use lookup table to implement *_strerror 2021-07-27 01:35:31 -07:00
nirenjan e54f6037d4 Fix pinelog builds on MacOS 2021-07-19 11:15:42 -07:00
nirenjan 3a68148472 Merge commit '9fa1a428a45eabff0122e199a687068f0e6280dd' into daemon 2021-07-19 09:50:42 -07:00
nirenjan 27eb123062 Update README to include destructor attribute 2021-07-16 08:33:22 -07:00
nirenjan 0d407d77fe Add method to close output stream and reset to default 2021-07-16 08:29:11 -07:00
nirenjan e32f836485 Fix format-literal error in clang 2021-07-15 18:31:01 -07:00
nirenjan 4b1d524d39 Integrate pinelog into autotools build framework 2021-07-15 10:33:52 -07:00
nirenjan fd79166a89 Merge commit '50dc946c3177f5006e4bd63eef4bf67331f59dea' as 'lib/pinelog' 2021-07-14 15:54:58 -07:00
nirenjan 2c522b9a66 Add reference to libx52_connect in integration documentation 2021-02-09 00:09:48 -08:00
nirenjan 7116af8f66 Remove hotplugging section from caveats list 2021-02-09 00:06:40 -08:00
nirenjan 9fb2d246c6 Move headers to $(includedir)/libx52 2020-07-17 15:27:42 -07:00
nirenjan 798714dd1c Add thumbstick test cases 2020-07-16 03:53:25 -07:00
nirenjan 453f9517d9 Add button and hat test cases 2020-07-16 03:41:32 -07:00
nirenjan 869d564aa3 Add more parser test cases 2020-07-14 00:47:13 -07:00
nirenjan f6136fcef0 Add device info API 2020-07-12 00:08:33 -07:00
nirenjan c8ad37b3f7 Save USB device strings when opening HID device
This change saves the manufacturer, product and serial number strings in
a multibyte format, so that it can be used by the clients of the library
to print details about the connected device. This also ensures that
those multibyte strings are freed when closing the device.
2020-07-11 17:13:27 -07:00
nirenjan 81cb7367f8 Fix test builds on OSX 2020-07-11 11:31:09 -07:00
nirenjan 4982071764 Map hat to axis 2020-07-11 00:09:39 -07:00
nirenjan 62894dea43 Add string representations and associated i18n 2020-07-10 18:01:53 -07:00
nirenjan a0b7769dab Add HATX and HATY axis values 2020-07-10 17:26:23 -07:00
nirenjan 2c40785c2b Add test suite for parser - WIP 2020-07-10 02:35:53 -07:00
nirenjan 4bd3ae69fe Fix builds on OSX 2020-07-09 16:21:40 -07:00
nirenjan 16cb1e4698 Implement libx52io read APIs 2020-07-09 15:12:55 -07:00
nirenjan 9ab3cce73e Fix report format to correctly handle mouse stick
Prior to this change, the report parser treated the mouse stick axes in
the reverse order of the USB HID report descriptor.

This change fixes that issue and also updates the specification
documentation to reflect it correctly.
2020-07-09 02:44:31 -07:00
nirenjan 4f18aa3dc8 Add tests for axis API 2020-07-09 01:53:54 -07:00
nirenjan 63a2f465d2 Replace hard-coded values with #define's 2020-07-08 17:35:17 -07:00
nirenjan 9d3acfd35a Add report parser implementation 2020-07-08 17:28:06 -07:00
nirenjan aebd5e14f9 Add axis API implementation 2020-07-08 16:43:20 -07:00
nirenjan 329274e6c9 Add initial version of libx52io 2020-07-08 00:33:03 -07:00
nirenjan 1cbad472df Revert "Save PID in libx52_device structure"
This reverts commit f963991161.

The updated design uses hidapi to create a separate connection to the
X52 device, and libx52 is limited to only dealing with the vendor
specific commands.
2020-07-05 16:10:23 -07:00
nirenjan f963991161 Save PID in libx52_device structure
This will support a parser interface which will parse the HID report
from the X52, but given that the device has different PIDs, the parser
will need to behave differently depending on the PID.
2020-07-04 23:29:25 -07:00
nirenjan 945ddc63a3 Update for release 0.2.1 2020-06-28 13:31:25 -07:00
nirenjan c40847b833 Add clock tests to verify PDT/PST/UTC 2020-06-28 11:32:19 -07:00