Lines Matching full:map

65 static int add_report(temp_hid_report_map_t *map, esp_hid_report_item_t *item)  in add_report()  argument
67 if (map->reports_len >= 64) { in add_report()
71 memcpy(&(map->reports[map->reports_len]), item, sizeof(esp_hid_report_item_t)); in add_report()
72 map->reports_len++; in add_report()
85 temp_hid_report_map_t *map = s_temp_hid_report_map; in handle_report() local
87 memset(map, 0, sizeof(temp_hid_report_map_t)); in handle_report()
92 map->usage_mask |= ESP_HID_USAGE_KEYBOARD; in handle_report()
101 if (add_report(map, &item) != 0) { in handle_report()
107 if (add_report(map, &item) != 0) { in handle_report()
119 if (add_report(map, &item) != 0) { in handle_report()
125 if (add_report(map, &item) != 0) { in handle_report()
131 map->usage_mask |= ESP_HID_USAGE_MOUSE; in handle_report()
140 if (add_report(map, &item) != 0) { in handle_report()
146 if (add_report(map, &item) != 0) { in handle_report()
155 map->usage_mask |= ESP_HID_USAGE_JOYSTICK; in handle_report()
159 map->usage_mask |= ESP_HID_USAGE_GAMEPAD; in handle_report()
164 map->usage_mask |= ESP_HID_USAGE_CCONTROL; in handle_report()
168 map->usage_mask |= ESP_HID_USAGE_VENDOR; in handle_report()
180 if (add_report(map, &item) != 0) { in handle_report()
187 if (add_report(map, &item) != 0) { in handle_report()
194 if (add_report(map, &item) != 0) { in handle_report()
374 temp_hid_report_map_t *map = s_temp_hid_report_map; in esp_hid_parse_report_map() local
376 …esp_hid_report_item_t *reports = (esp_hid_report_item_t *)calloc(1, map->reports_len * sizeof(esp_… in esp_hid_parse_report_map()
378 ESP_LOGE(TAG, "hid_report_items malloc failed! %u maps", map->reports_len); in esp_hid_parse_report_map()
385 if (map->usage_mask & ESP_HID_USAGE_KEYBOARD) { in esp_hid_parse_report_map()
388 } else if (map->usage_mask & ESP_HID_USAGE_MOUSE) { in esp_hid_parse_report_map()
391 } else if (map->usage_mask & ESP_HID_USAGE_JOYSTICK) { in esp_hid_parse_report_map()
394 } else if (map->usage_mask & ESP_HID_USAGE_GAMEPAD) { in esp_hid_parse_report_map()
397 } else if (map->usage_mask & ESP_HID_USAGE_CCONTROL) { in esp_hid_parse_report_map()
404 out->reports_len = map->reports_len; in esp_hid_parse_report_map()
405 memcpy(reports, map->reports, map->reports_len * sizeof(esp_hid_report_item_t)); in esp_hid_parse_report_map()
413 void esp_hid_free_report_map(esp_hid_report_map_t *map) in esp_hid_free_report_map() argument
415 if (map != NULL){ in esp_hid_free_report_map()
416 free(map->reports); in esp_hid_free_report_map()
417 free(map); in esp_hid_free_report_map()