example/ble_hid_device_demo fix the wrong mask value according to HID protocol

This commit is contained in:
gengyuchao 2020-02-20 19:19:33 +08:00
parent 53664c80ff
commit dcc4943b3d

View file

@ -50,14 +50,15 @@ typedef enum {
ESP_HIDD_DEINIT_FAILED = 0, ESP_HIDD_DEINIT_FAILED = 0,
} esp_hidd_deinit_state_t; } esp_hidd_deinit_state_t;
#define LEFT_CONTROL_KEY_MASK (1 >> 0) #define LEFT_CONTROL_KEY_MASK (1 << 0)
#define LEFT_SHIFT_KEY_MASK (1 >> 1) #define LEFT_SHIFT_KEY_MASK (1 << 1)
#define LEFT_ALT_KEY_MASK (1 >> 2) #define LEFT_ALT_KEY_MASK (1 << 2)
#define LEFT_GUI_KEY_MASK (1 >> 3) #define LEFT_GUI_KEY_MASK (1 << 3)
#define RIGHT_CONTROL_KEY_MASK (1 >> 4) #define RIGHT_CONTROL_KEY_MASK (1 << 4)
#define RIGHT_SHIFT_KEY_MASK (1 >> 5) #define RIGHT_SHIFT_KEY_MASK (1 << 5)
#define RIGHT_ALT_KEY_MASK (1 >> 6) #define RIGHT_ALT_KEY_MASK (1 << 6)
#define RIGHT_GUI_KEY_MASK (1 >> 7) #define RIGHT_GUI_KEY_MASK (1 << 7)
typedef uint8_t key_mask_t; typedef uint8_t key_mask_t;
/** /**
* @brief HIDD callback parameters union * @brief HIDD callback parameters union