summaryrefslogtreecommitdiff
path: root/apps/core_keymap.c
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2022-02-25 23:50:38 -0500
committerWilliam Wilgus <wilgus.william@gmail.com>2022-02-26 00:40:42 -0500
commit6b360d8b0401bf3337b1b4f70e0bf630abdc421b (patch)
tree5a3766ffaf124d8d601c6ef08735e71e1445c3ce /apps/core_keymap.c
parent887249671ce2d39e0e75bcab87a1cecefde7406b (diff)
downloadrockbox-6b360d8b0401bf3337b1b4f70e0bf630abdc421b.tar.gz
rockbox-6b360d8b0401bf3337b1b4f70e0bf630abdc421b.zip
action.c keyremap clean-up add logf to core_keymap.c
move the remap out of the loop and eliminate a status flag Change-Id: I9ab841037a8ea7dff736b452ff55e8242084af82
Diffstat (limited to 'apps/core_keymap.c')
-rw-r--r--apps/core_keymap.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/apps/core_keymap.c b/apps/core_keymap.c
index 131c48f45d..dbe7ae0072 100644
--- a/apps/core_keymap.c
+++ b/apps/core_keymap.c
@@ -23,6 +23,9 @@
23#include "core_alloc.h" 23#include "core_alloc.h"
24#include "core_keymap.h" 24#include "core_keymap.h"
25 25
26/*#define LOGF_ENABLE*/
27#include "logf.h"
28
26#if !defined(__PCTOOL__) || defined(CHECKWPS) 29#if !defined(__PCTOOL__) || defined(CHECKWPS)
27static int keymap_handle = -1; 30static int keymap_handle = -1;
28 31
@@ -76,6 +79,7 @@ int core_load_key_remap(const char *filename)
76 if (core_alloc_keymap(fsize) <= 0) 79 if (core_alloc_keymap(fsize) <= 0)
77 { 80 {
78 count = -30; 81 count = -30;
82 logf("core_keymap: %d Failed to allocate buffer", count);
79 break; 83 break;
80 } 84 }
81 buf = core_get_data(keymap_handle); 85 buf = core_get_data(keymap_handle);
@@ -84,7 +88,10 @@ int core_load_key_remap(const char *filename)
84 count = action_set_keymap((struct button_mapping *) buf, count); 88 count = action_set_keymap((struct button_mapping *) buf, count);
85 } 89 }
86 else 90 else
91 {
87 count = -40; 92 count = -40;
93 logf("core_keymap: %d Failed to read", count);
94 }
88 break; 95 break;
89 } 96 }
90 close(fd); 97 close(fd);
@@ -108,6 +115,7 @@ int open_key_remap(const char *filename, int *fd, size_t *fsize)
108 if (count * sizeof(struct button_mapping) != *fsize) 115 if (count * sizeof(struct button_mapping) != *fsize)
109 { 116 {
110 count = -10; 117 count = -10;
118 logf("core_keymap: %d Size mismatch", count);
111 break; 119 break;
112 } 120 }
113 121
@@ -125,6 +133,7 @@ int open_key_remap(const char *filename, int *fd, size_t *fsize)
125 else /* Header mismatch */ 133 else /* Header mismatch */
126 { 134 {
127 count = -20; 135 count = -20;
136 logf("core_keymap: %d Header mismatch", count);
128 break; 137 break;
129 } 138 }
130 } 139 }