aboutsummaryrefslogtreecommitdiffstats
path: root/tmk_core/protocol/ps2_mouse.c
diff options
context:
space:
mode:
authorOfer Plesser <plesserofer@gmail.com>2016-12-16 21:52:51 +0200
committerOfer Plesser <plesserofer@gmail.com>2016-12-16 21:52:51 +0200
commit6a462c818cc35ad5a51576bee96077d9614b1a8d (patch)
treecda535a4e64bd0183b800b6abe87005c3f98a74f /tmk_core/protocol/ps2_mouse.c
parent6e7cfa83b9424061914793b02757fa4ec75b356b (diff)
parentb8e13167c813b59ebd6f4484dccae37bde2bfdba (diff)
downloadfirmware-6a462c818cc35ad5a51576bee96077d9614b1a8d.tar.gz
firmware-6a462c818cc35ad5a51576bee96077d9614b1a8d.tar.bz2
firmware-6a462c818cc35ad5a51576bee96077d9614b1a8d.zip
Merge branch 'master' into feature/combos
Diffstat (limited to 'tmk_core/protocol/ps2_mouse.c')
-rw-r--r--tmk_core/protocol/ps2_mouse.c52
1 files changed, 6 insertions, 46 deletions
diff --git a/tmk_core/protocol/ps2_mouse.c b/tmk_core/protocol/ps2_mouse.c
index af971dd49..d9ccbecb4 100644
--- a/tmk_core/protocol/ps2_mouse.c
+++ b/tmk_core/protocol/ps2_mouse.c
@@ -28,52 +28,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* ============================= MACROS ============================ */
-#define PS2_MOUSE_SEND(command, message) \
-do { \
- uint8_t rcv = ps2_host_send(command); \
- if (debug_mouse) { \
- print((message)); \
- xprintf(" command: %X, result: %X, error: %X \n", command, rcv, ps2_error); \
- } \
-} while(0)
-
-#define PS2_MOUSE_SEND_SAFE(command, message) \
-do { \
- if (PS2_MOUSE_STREAM_MODE == ps2_mouse_mode) { \
- ps2_mouse_disable_data_reporting(); \
- } \
- PS2_MOUSE_SEND(command, message); \
- if (PS2_MOUSE_STREAM_MODE == ps2_mouse_mode) { \
- ps2_mouse_enable_data_reporting(); \
- } \
-} while(0)
-
-#define PS2_MOUSE_SET_SAFE(command, value, message) \
-do { \
- if (PS2_MOUSE_STREAM_MODE == ps2_mouse_mode) { \
- ps2_mouse_disable_data_reporting(); \
- } \
- PS2_MOUSE_SEND(command, message); \
- PS2_MOUSE_SEND(value, "Sending value"); \
- if (PS2_MOUSE_STREAM_MODE == ps2_mouse_mode) { \
- ps2_mouse_enable_data_reporting(); \
- } \
-} while(0)
-
-#define PS2_MOUSE_RECEIVE(message) \
-do { \
- uint8_t rcv = ps2_host_recv_response(); \
- if (debug_mouse) { \
- print((message)); \
- xprintf(" result: %X, error: %X \n", rcv, ps2_error); \
- } \
-} while(0)
-
-static enum ps2_mouse_mode_e {
- PS2_MOUSE_STREAM_MODE,
- PS2_MOUSE_REMOTE_MODE,
-} ps2_mouse_mode = PS2_MOUSE_STREAM_MODE;
-
static report_mouse_t mouse_report = {};
static inline void ps2_mouse_print_report(report_mouse_t *mouse_report);
@@ -108,6 +62,12 @@ void ps2_mouse_init(void) {
#ifdef PS2_MOUSE_USE_2_1_SCALING
ps2_mouse_set_scaling_2_1();
#endif
+
+ ps2_mouse_init_user();
+}
+
+__attribute__((weak))
+void ps2_mouse_init_user(void) {
}
void ps2_mouse_task(void) {