From 5548eb806fc2872a3b2856bac2c67b9e272426bb Mon Sep 17 00:00:00 2001 From: Denis Date: Sat, 16 Dec 2023 23:19:32 +0100 Subject: [PATCH] Improved mode switch --- rog_ally.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rog_ally.c b/rog_ally.c index ea6fc35..6fe9c81 100644 --- a/rog_ally.c +++ b/rog_ally.c @@ -90,9 +90,9 @@ static int get_next_mode(int current_mode) { if (current_mode == 2) return 3; if (current_mode == 3) - return 2; + return 1; else - fprintf(stderr, "Invalid current mode: %d -- gamepad will be set\n", current_mode); + fprintf(stderr, "Invalid current mode: %d -- 1 (gamepad) will be set\n", current_mode); return 1; } @@ -188,7 +188,7 @@ static int asus_kbd_ev_map( memset(tmp_path, 0, tmp_path_max_len); snprintf(tmp_path, tmp_path_max_len - 1, "%s/gamepad_mode", kernel_sysfs); - int gamepad_mode_fd = open(tmp_path, O_RDONLY | O_NONBLOCK); + int gamepad_mode_fd = open(tmp_path, O_RDONLY); if (gamepad_mode_fd > 0) { char current_mode_str[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; int current_mode_read_res = read(gamepad_mode_fd, (void*)current_mode_str, sizeof(current_mode_str));