Compare commits
2 Commits
8832ba2227
...
aea9c334e0
Author | SHA1 | Date | |
---|---|---|---|
aea9c334e0 | |||
e53cddb030 |
@ -138,19 +138,27 @@ endif ()
|
||||
|
||||
# Generate documentation from help output
|
||||
if (NOT WIN32 AND NOT CMAKE_CROSSCOMPILING)
|
||||
find_program (HELP2MAN_EXECUTABLE help2man)
|
||||
if (NOT HELP2MAN_EXECUTABLE)
|
||||
message (FATAL_ERROR "help2man not found")
|
||||
endif ()
|
||||
set (HELP2ADOC "${PROJECT_SOURCE_DIR}/liberty/tools/help2adoc.awk")
|
||||
set (ASCIIMAN "${PROJECT_SOURCE_DIR}/liberty/tools/asciiman.awk")
|
||||
|
||||
foreach (target ${targets})
|
||||
set (page_output "${PROJECT_BINARY_DIR}/${target}.1")
|
||||
list (APPEND project_MAN_PAGES "${page_output}")
|
||||
add_custom_command (OUTPUT ${page_output}
|
||||
COMMAND ${HELP2MAN_EXECUTABLE} -N
|
||||
"${PROJECT_BINARY_DIR}/${target}" -o ${page_output}
|
||||
DEPENDS ${target}
|
||||
COMMENT "Generating man page for ${target}" VERBATIM)
|
||||
set (page_adoc "${PROJECT_BINARY_DIR}/${target}.1.adoc")
|
||||
set (page_roff "${PROJECT_BINARY_DIR}/${target}.1")
|
||||
list (APPEND project_MAN_PAGES "${page_roff}")
|
||||
|
||||
# $<TARGET_FILE:tgt> could be used, if we didn't have to escape it.
|
||||
string (REPLACE "\\" "\\\\"
|
||||
target_path "${PROJECT_BINARY_DIR}/${target}")
|
||||
add_custom_command (OUTPUT "${page_adoc}"
|
||||
COMMAND env LC_ALL=C awk -f "${HELP2ADOC}"
|
||||
-v "Target=${target_path}" > "${page_adoc}"
|
||||
DEPENDS "${target}" "${HELP2ADOC}"
|
||||
COMMENT "Generating AsciiDoc man page for ${target}" VERBATIM)
|
||||
add_custom_command (OUTPUT "${page_roff}"
|
||||
COMMAND env LC_ALL=C awk -f "${ASCIIMAN}"
|
||||
"${page_adoc}" > "${page_roff}"
|
||||
DEPENDS "${page_adoc}" "${ASCIIMAN}"
|
||||
COMMENT "Generating roff man page for ${target}" VERBATIM)
|
||||
endforeach ()
|
||||
|
||||
add_custom_target (docs ALL DEPENDS ${project_MAN_PAGES})
|
||||
|
@ -59,7 +59,7 @@ https://git.janouch.name/p/usb-drivers/releases[the Releases page on Gitea].
|
||||
Building
|
||||
--------
|
||||
Build dependencies:
|
||||
CMake, pkg-config, liberty (included), help2man +
|
||||
CMake, pkg-config, liberty (included) +
|
||||
Runtime dependencies:
|
||||
libusb-1.0 (elksmart-comm, razer-bw-te-ctl), hidapi >= 0.14 (eizoctl)
|
||||
|
||||
|
@ -196,7 +196,7 @@ compress_value(unsigned value, struct str *encoded)
|
||||
}
|
||||
|
||||
static void
|
||||
compress_pulses (const struct pulse *pulses, size_t len, struct str *encoded)
|
||||
compress_pulses(const struct pulse *pulses, size_t len, struct str *encoded)
|
||||
{
|
||||
unsigned counts[len];
|
||||
memset(counts, 0, sizeof counts);
|
||||
@ -527,15 +527,15 @@ send_identify(libusb_device_handle *device, struct error **e)
|
||||
#if 0
|
||||
// The EKX4S does not respond to this request.
|
||||
static uint8_t c_serial[] = { -5, -5, -5, -5 };
|
||||
if ((result = libusb_bulk_transfer (device, g.endpoint_out,
|
||||
if ((result = libusb_bulk_transfer(device, g.endpoint_out,
|
||||
c_serial, sizeof c_serial, &len, 100)))
|
||||
return error_set (e, "serial/send: %s", libusb_strerror (result));
|
||||
if ((result = libusb_bulk_transfer (device, g.endpoint_in,
|
||||
return error_set(e, "serial/send: %s", libusb_strerror(result));
|
||||
if ((result = libusb_bulk_transfer(device, g.endpoint_in,
|
||||
buffer, sizeof buffer, &len, 100)))
|
||||
return error_set (e, "serial/recv: %s", libusb_strerror (result));
|
||||
return error_set(e, "serial/recv: %s", libusb_strerror(result));
|
||||
if (len < (int) sizeof c_serial ||
|
||||
memcmp (buffer, c_serial, sizeof c_serial))
|
||||
return error_set (e, "serial retrieval failed");
|
||||
memcmp(buffer, c_serial, sizeof c_serial))
|
||||
return error_set(e, "serial retrieval failed");
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
2
liberty
2
liberty
@ -1 +1 @@
|
||||
Subproject commit 1930f138d4836f8ed9613a17bfe09dc53441618a
|
||||
Subproject commit 9268fb8eba4a60499809965b3b69c2eb7e3798e7
|
@ -198,8 +198,8 @@ parse_options(int argc, char *argv[],
|
||||
};
|
||||
|
||||
if (argc == 1) {
|
||||
show_usage (argv[0]);
|
||||
exit (EXIT_FAILURE);
|
||||
show_usage(argv[0]);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
int c;
|
||||
@ -256,7 +256,7 @@ parse_options(int argc, char *argv[],
|
||||
!strcasecmp(optarg, "on") ||
|
||||
!strcasecmp(optarg, "yes")) {
|
||||
new_config->gaming_mode = true;
|
||||
} else if (!strcasecmp (optarg, "false") ||
|
||||
} else if (!strcasecmp(optarg, "false") ||
|
||||
!strcasecmp(optarg, "off") ||
|
||||
!strcasecmp(optarg, "no")) {
|
||||
new_config->gaming_mode = false;
|
||||
@ -362,7 +362,7 @@ main(int argc, char *argv[])
|
||||
|
||||
if ((result = apply_options(device, &options, &new_config)))
|
||||
FAIL(error_4, "operation failed: %s\n",
|
||||
libusb_error_name (result));
|
||||
libusb_error_name(result));
|
||||
error_4:
|
||||
if ((result = libusb_release_interface(device, BW_CTL_IFACE)))
|
||||
FAIL(error_3, "couldn't release interface: %s\n",
|
||||
|
Loading…
x
Reference in New Issue
Block a user