From dcc4943b3d6693d7779a978854ffcbacf0994993 Mon Sep 17 00:00:00 2001 From: gengyuchao Date: Thu, 20 Feb 2020 19:19:33 +0800 Subject: [PATCH] example/ble_hid_device_demo fix the wrong mask value according to HID protocol --- .../ble_hid_device_demo/main/esp_hidd_prf_api.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/examples/bluetooth/ble_hid_device_demo/main/esp_hidd_prf_api.h b/examples/bluetooth/ble_hid_device_demo/main/esp_hidd_prf_api.h index 32c8c6c0c..513bcbef3 100644 --- a/examples/bluetooth/ble_hid_device_demo/main/esp_hidd_prf_api.h +++ b/examples/bluetooth/ble_hid_device_demo/main/esp_hidd_prf_api.h @@ -50,14 +50,15 @@ typedef enum { ESP_HIDD_DEINIT_FAILED = 0, } esp_hidd_deinit_state_t; -#define LEFT_CONTROL_KEY_MASK (1 >> 0) -#define LEFT_SHIFT_KEY_MASK (1 >> 1) -#define LEFT_ALT_KEY_MASK (1 >> 2) -#define LEFT_GUI_KEY_MASK (1 >> 3) -#define RIGHT_CONTROL_KEY_MASK (1 >> 4) -#define RIGHT_SHIFT_KEY_MASK (1 >> 5) -#define RIGHT_ALT_KEY_MASK (1 >> 6) -#define RIGHT_GUI_KEY_MASK (1 >> 7) +#define LEFT_CONTROL_KEY_MASK (1 << 0) +#define LEFT_SHIFT_KEY_MASK (1 << 1) +#define LEFT_ALT_KEY_MASK (1 << 2) +#define LEFT_GUI_KEY_MASK (1 << 3) +#define RIGHT_CONTROL_KEY_MASK (1 << 4) +#define RIGHT_SHIFT_KEY_MASK (1 << 5) +#define RIGHT_ALT_KEY_MASK (1 << 6) +#define RIGHT_GUI_KEY_MASK (1 << 7) + typedef uint8_t key_mask_t; /** * @brief HIDD callback parameters union