Upgraded SDK to v4.2.3

This commit is contained in:
demik 2022-04-03 21:28:45 +02:00
parent b4024687b4
commit eeb5772664
4 changed files with 30 additions and 36 deletions

View File

@ -1,3 +1,8 @@
## v1.4.4
- update to ESP-IDF v4.2.3:
- https://github.com/espressif/esp-idf/releases/tag/v4.2.2
- mostly bluetooth related security and bug fixes
## v1.4.3 ## v1.4.3
- provides some slight acceleration and desceleration on bluetooth mouses - provides some slight acceleration and desceleration on bluetooth mouses

View File

@ -2,7 +2,7 @@
### Supported SDK versions: ### Supported SDK versions:
The code is designed to be build with ESP-IDF SDK version 4.2.2. To workaround some patchs or limitations of this specific release, you need to apply the patch located in the SDK subfolder The code is designed to be build with ESP-IDF SDK version 4.2.3. To workaround some patchs or limitations of this specific release, you need to apply the patch located in the SDK subfolder
### Unsupported mouse conversions: ### Unsupported mouse conversions:

View File

@ -1,30 +1,17 @@
diff --git a/components/bt/host/bluedroid/bta/hh/bta_hh_le.c b/components/bt/host/bluedroid/bta/hh/bta_hh_le.c
index 6c86cb9be7..8fdf1a1dc3 100644
--- a/components/bt/host/bluedroid/bta/hh/bta_hh_le.c
+++ b/components/bt/host/bluedroid/bta/hh/bta_hh_le.c
@@ -498,7 +498,7 @@ tBTA_HH_LE_RPT *bta_hh_le_find_rpt_by_idtype(tBTA_HH_LE_RPT *p_head, UINT8 mode,
UINT8 i;
#if BTA_HH_DEBUG == TRUE
- APPL_TRACE_DEBUG("bta_hh_le_find_rpt_by_idtype: r_type: %d rpt_id: %d", r_type, rpt_id);
+ :required:("bta_hh_le_find_rpt_by_idtype: r_type: %d rpt_id: %d", r_type, rpt_id);
#endif
for (i = 0 ; i < BTA_HH_LE_RPT_MAX; i ++, p_rpt++) {
diff --git a/components/esp_hid/include/esp_hidh.h b/components/esp_hid/include/esp_hidh.h diff --git a/components/esp_hid/include/esp_hidh.h b/components/esp_hid/include/esp_hidh.h
index b1a8264307..bedcb42b65 100644 index b1a8264307..d3d1002103 100644
--- a/components/esp_hid/include/esp_hidh.h --- a/components/esp_hid/include/esp_hidh.h
+++ b/components/esp_hid/include/esp_hidh.h +++ b/components/esp_hid/include/esp_hidh.h
@@ -100,6 +100,7 @@ typedef union { @@ -100,6 +100,7 @@ typedef union {
typedef struct { typedef struct {
esp_event_handler_t callback; esp_event_handler_t callback;
+ uint16_t event_stack_size; + uint16_t event_stack_size;
} esp_hidh_config_t; } esp_hidh_config_t;
/** /**
diff --git a/components/esp_hid/src/ble_hidh.c b/components/esp_hid/src/ble_hidh.c diff --git a/components/esp_hid/src/ble_hidh.c b/components/esp_hid/src/ble_hidh.c
index 5fe54f2fa7..28cc35e295 100644 index 5fe54f2fa7..a56eb04c44 100644
--- a/components/esp_hid/src/ble_hidh.c --- a/components/esp_hid/src/ble_hidh.c
+++ b/components/esp_hid/src/ble_hidh.c +++ b/components/esp_hid/src/ble_hidh.c
@@ -617,7 +617,7 @@ esp_err_t esp_ble_hidh_init(const esp_hidh_config_t *config) @@ -617,7 +617,7 @@ esp_err_t esp_ble_hidh_init(const esp_hidh_config_t *config)
@ -32,12 +19,12 @@ index 5fe54f2fa7..28cc35e295 100644
.task_name = "esp_ble_hidh_events", .task_name = "esp_ble_hidh_events",
.task_priority = uxTaskPriorityGet(NULL), .task_priority = uxTaskPriorityGet(NULL),
- .task_stack_size = 2048, - .task_stack_size = 2048,
+ .task_stack_size = config->event_stack_size > 0 ? config->event_stack_size : 2048, + .task_stack_size = config->event_stack_size > 0 ? config->event_stack_size : 2048,
.task_core_id = tskNO_AFFINITY .task_core_id = tskNO_AFFINITY
}; };
ret = esp_event_loop_create(&event_task_args, &event_loop_handle); ret = esp_event_loop_create(&event_task_args, &event_loop_handle);
diff --git a/components/esp_hid/src/bt_hidh.c b/components/esp_hid/src/bt_hidh.c diff --git a/components/esp_hid/src/bt_hidh.c b/components/esp_hid/src/bt_hidh.c
index 1a17e6aa35..6ae12958ff 100644 index 1a17e6aa35..16fae9e65a 100644
--- a/components/esp_hid/src/bt_hidh.c --- a/components/esp_hid/src/bt_hidh.c
+++ b/components/esp_hid/src/bt_hidh.c +++ b/components/esp_hid/src/bt_hidh.c
@@ -320,7 +320,7 @@ esp_err_t esp_bt_hidh_init(const esp_hidh_config_t *config) @@ -320,7 +320,7 @@ esp_err_t esp_bt_hidh_init(const esp_hidh_config_t *config)
@ -45,30 +32,31 @@ index 1a17e6aa35..6ae12958ff 100644
.task_name = "esp_bt_hidh_events", .task_name = "esp_bt_hidh_events",
.task_priority = uxTaskPriorityGet(NULL), .task_priority = uxTaskPriorityGet(NULL),
- .task_stack_size = 2048, - .task_stack_size = 2048,
+ .task_stack_size = config->event_stack_size > 0 ? config->event_stack_size : 2048, + .task_stack_size = config->event_stack_size > 0 ? config->event_stack_size : 2048,
.task_core_id = tskNO_AFFINITY .task_core_id = tskNO_AFFINITY
}; };
esp_err_t ret = esp_event_loop_create(&event_task_args, &event_loop_handle); esp_err_t ret = esp_event_loop_create(&event_task_args, &event_loop_handle);
@@ -386,6 +386,23 @@ void bta_hh_co_data(uint8_t handle, uint8_t *p_rpt, uint16_t len, tBTA_HH_PROTO_ @@ -386,6 +386,24 @@ void bta_hh_co_data(uint8_t handle, uint8_t *p_rpt, uint16_t len, tBTA_HH_PROTO_
ESP_LOGE(TAG, "Device Not Found: handle %u", handle); ESP_LOGE(TAG, "Device Not Found: handle %u", handle);
return; return;
} }
+ +
+ /* + /*
+ * quack patch: mode is always ESP_HID_PROTOCOL_MODE_BOOT even if the device is in BOOT mode + * quack patch: mode is always ESP_HID_PROTOCOL_MODE_BOOT even if the device is in BOOT mode
+ * BTA_HH_PROTO_RPT_MODE from Bluedroid is 0 + * BTA_HH_PROTO_RPT_MODE from Bluedroid is 0
+ * BOOT report id is also questionable, assume than an REPORT mode with a lengh of 3 or 4 is a BOOT packet + * BOOT report id is also questionable, assume than an REPORT mode with a lengh of 3 or 4 is a BOOT packet
+ */ + */
+ if (len >= 2 + 1 && p_rpt[0] == 2 && mode == 0) { +
+ esp_hidh_event_data_t p = {0}; + if (len >= 2 + 1 && p_rpt[0] == 2 && mode == 0) {
+ p.input.dev = dev; + esp_hidh_event_data_t p = {0};
+ p.feature.report_id = 2; + p.input.dev = dev;
+ p.feature.usage = ESP_HID_USAGE_MOUSE; + p.feature.report_id = 2;
+ p.feature.data = p_rpt + 1; + p.feature.usage = ESP_HID_USAGE_MOUSE;
+ p.input.length = len - 1; + p.feature.data = p_rpt + 1;
+ esp_event_post_to(event_loop_handle, ESP_HIDH_EVENTS, ESP_HIDH_INPUT_EVENT, &p, sizeof(esp_hidh_event_data_t), portMAX_DELAY); + p.input.length = len - 1;
+ return ; + esp_event_post_to(event_loop_handle, ESP_HIDH_EVENTS, ESP_HIDH_INPUT_EVENT, &p, sizeof(esp_hidh_event_data_t), portMAX_DELAY);
+ } + return ;
+ }
+ +
report = esp_hidh_dev_get_input_report_by_id_and_proto(dev, p_rpt[0], mode ? ESP_HID_PROTOCOL_MODE_BOOT : ESP_HID_PROTOCOL_MODE_REPORT); report = esp_hidh_dev_get_input_report_by_id_and_proto(dev, p_rpt[0], mode ? ESP_HID_PROTOCOL_MODE_BOOT : ESP_HID_PROTOCOL_MODE_REPORT);
if (report == NULL) { if (report == NULL) {

View File

@ -877,6 +877,7 @@ CONFIG_LWIP_ESP_GRATUITOUS_ARP=y
CONFIG_LWIP_GARP_TMR_INTERVAL=60 CONFIG_LWIP_GARP_TMR_INTERVAL=60
CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32
CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y
# CONFIG_LWIP_DHCP_DISABLE_CLIENT_ID is not set
# CONFIG_LWIP_DHCP_RESTORE_LAST_IP is not set # CONFIG_LWIP_DHCP_RESTORE_LAST_IP is not set
# #
@ -1257,7 +1258,7 @@ CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT=30
# CONFIG_WPA_MBEDTLS_CRYPTO is not set # CONFIG_WPA_MBEDTLS_CRYPTO is not set
# CONFIG_WPA_DEBUG_PRINT is not set # CONFIG_WPA_DEBUG_PRINT is not set
# CONFIG_WPA_TESTING_OPTIONS is not set # CONFIG_WPA_TESTING_OPTIONS is not set
# CONFIG_WPA_WPS_WARS is not set # CONFIG_WPA_WPS_STRICT is not set
# end of Supplicant # end of Supplicant
# end of Component config # end of Component config