use asusctl command to set leds
This commit is contained in:
parent
8a97652d05
commit
612fb701c5
3 changed files with 12 additions and 19 deletions
|
|
@ -15,11 +15,6 @@ set(ALLINONE_EXECUTABLE_NAME "allynone")
|
|||
|
||||
find_package(PkgConfig REQUIRED) # Include functions provided by PkgConfig module.
|
||||
|
||||
pkg_check_modules(DBUS REQUIRED dbus-1) # This calls pkgconfig with appropriate arguments
|
||||
# Use results of pkg_check_modules() call.
|
||||
include_directories(${DBUS_INCLUDE_DIRS})
|
||||
link_directories(${DBUS_LIBRARY_DIRS})
|
||||
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
|
|
@ -72,7 +67,7 @@ add_executable(${ALLINONE_EXECUTABLE_NAME}
|
|||
|
||||
set_property(TARGET ${ALLINONE_EXECUTABLE_NAME} PROPERTY C_STANDARD 17)
|
||||
|
||||
target_link_libraries(${ALLINONE_EXECUTABLE_NAME} PRIVATE Threads::Threads ${DBUS_LIBRARIES} -levdev -ludev -lconfig -lm -lz)
|
||||
target_link_libraries(${ALLINONE_EXECUTABLE_NAME} PRIVATE Threads::Threads -levdev -ludev -lconfig -lm -lz)
|
||||
|
||||
set_target_properties(${ALLINONE_EXECUTABLE_NAME} PROPERTIES LINKER_LANGUAGE C)
|
||||
|
||||
|
|
@ -80,7 +75,7 @@ install(TARGETS ${ALLINONE_EXECUTABLE_NAME} DESTINATION bin)
|
|||
|
||||
set_property(TARGET ${ROGUE_EXECUTABLE_NAME} PROPERTY C_STANDARD 17)
|
||||
|
||||
target_link_libraries(${ROGUE_EXECUTABLE_NAME} PRIVATE Threads::Threads ${DBUS_LIBRARIES} -levdev -ludev -lconfig -lm)
|
||||
target_link_libraries(${ROGUE_EXECUTABLE_NAME} PRIVATE Threads::Threads -levdev -ludev -lconfig -lm)
|
||||
|
||||
set_target_properties(${ROGUE_EXECUTABLE_NAME} PROPERTIES LINKER_LANGUAGE C)
|
||||
|
||||
|
|
|
|||
18
rog_ally.c
18
rog_ally.c
|
|
@ -63,9 +63,11 @@ typedef struct rc71l_platform {
|
|||
|
||||
rc71l_timer_user_data_t* timer_data;
|
||||
|
||||
DBusError dbus_error;
|
||||
|
||||
DBusConnection * dbus_conn;
|
||||
struct {
|
||||
uint8_t r;
|
||||
uint8_t g;
|
||||
uint8_t b;
|
||||
} static_led_color;
|
||||
|
||||
} rc71l_platform_t;
|
||||
|
||||
|
|
@ -101,7 +103,6 @@ static rc71l_platform_t hw_platform = {
|
|||
.kbd_user_data = &asus_userdata,
|
||||
.xbox360_user_data = &controller_user_data,
|
||||
.timer_data = &timer_user_data,
|
||||
.dbus_conn = NULL,
|
||||
};
|
||||
|
||||
static char* find_kernel_sysfs_device_path(struct udev *udev) {
|
||||
|
|
@ -1235,8 +1236,6 @@ static int rc71l_platform_init(const dev_in_settings_t *const conf, void** platf
|
|||
goto rc71l_platform_init_err;
|
||||
}
|
||||
|
||||
dbus_error_init(&platform->dbus_error);
|
||||
|
||||
res = 0;
|
||||
|
||||
rc71l_platform_init_err:
|
||||
|
|
@ -1250,9 +1249,6 @@ static void rc71l_platform_deinit(const dev_in_settings_t *const conf, void** pl
|
|||
if (platform->kbd_user_data != NULL) {
|
||||
udev_unref(platform->kbd_user_data->udev);
|
||||
}
|
||||
|
||||
// Close the D-Bus connection
|
||||
dbus_connection_close(platform->dbus_conn);
|
||||
}
|
||||
|
||||
*platform_data = NULL;
|
||||
|
|
@ -1265,6 +1261,10 @@ static int rc71l_platform_leds(const dev_in_settings_t *const conf, uint8_t r, u
|
|||
return 0;
|
||||
}
|
||||
|
||||
platform->static_led_color.r = r;
|
||||
platform->static_led_color.g = g;
|
||||
platform->static_led_color.b = b;
|
||||
|
||||
char command_str[64] = "\0";
|
||||
sprintf(command_str, "asusctl led-mode static -c %02X%02X%02X", r ,g ,b);
|
||||
|
||||
|
|
|
|||
|
|
@ -46,8 +46,6 @@
|
|||
|
||||
#include <zlib.h>
|
||||
|
||||
#include <dbus-1.0/dbus/dbus.h>
|
||||
|
||||
#define LSB_PER_RAD_S_2000_DEG_S ((double)0.001064724)
|
||||
#define LSB_PER_RAD_S_2000_DEG_S_STR "0.001064724"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue