From 8e3ad708b2b8f1f7004fe0e23926672f6d5d118c Mon Sep 17 00:00:00 2001 From: Venelin Efremov Date: Thu, 30 Dec 2021 04:49:03 -0800 Subject: [PATCH 1/3] Fix compile isse when TinyUSB task is not enabled. --- components/tinyusb/additions/src/tusb_tasks.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/tinyusb/additions/src/tusb_tasks.c b/components/tinyusb/additions/src/tusb_tasks.c index 731247380a..08251199df 100644 --- a/components/tinyusb/additions/src/tusb_tasks.c +++ b/components/tinyusb/additions/src/tusb_tasks.c @@ -20,6 +20,8 @@ #include "tinyusb.h" #include "tusb_tasks.h" +#if !CONFIG_TINYUSB_NO_DEFAULT_TASK + const static char *TAG = "tusb_tsk"; static TaskHandle_t s_tusb_tskh; @@ -52,3 +54,5 @@ esp_err_t tusb_stop_task(void) s_tusb_tskh = NULL; return ESP_OK; } + +#endif // !CONFIG_TINYUSB_NO_DEFAULT_TASK \ No newline at end of file From cba1f571478116160611b9538f9315f8bca51086 Mon Sep 17 00:00:00 2001 From: morris Date: Tue, 4 Jan 2022 10:17:32 +0800 Subject: [PATCH 2/3] tusb: update copyright header --- .../tinyusb/additions/include/tinyusb.h | 19 ++++++------------ .../tinyusb/additions/include/tinyusb_types.h | 18 +++++------------ .../tinyusb/additions/include/tusb_cdc_acm.h | 18 +++++------------ .../tinyusb/additions/include/tusb_console.h | 18 +++++------------ .../tinyusb/additions/include/tusb_tasks.h | 18 +++++------------ .../tinyusb/additions/include/vfs_tinyusb.h | 18 +++++------------ .../tinyusb/additions/include_private/cdc.h | 18 +++++------------ .../include_private/descriptors_control.h | 18 +++++------------ .../include_private/usb_descriptors.h | 18 +++++------------ components/tinyusb/additions/src/cdc.c | 18 +++++------------ .../additions/src/descriptors_control.c | 18 +++++------------ .../tinyusb/additions/src/tusb_cdc_acm.c | 18 +++++------------ .../tinyusb/additions/src/tusb_console.c | 18 +++++------------ components/tinyusb/additions/src/tusb_tasks.c | 20 ++++++------------- .../tinyusb/additions/src/usb_descriptors.c | 18 +++++------------ .../tinyusb/additions/src/vfs_tinyusb.c | 18 +++++------------ tools/ci/check_copyright_ignore.txt | 17 ---------------- 17 files changed, 82 insertions(+), 226 deletions(-) diff --git a/components/tinyusb/additions/include/tinyusb.h b/components/tinyusb/additions/include/tinyusb.h index aaa48fa725..f4cdecfaec 100644 --- a/components/tinyusb/additions/include/tinyusb.h +++ b/components/tinyusb/additions/include/tinyusb.h @@ -1,20 +1,13 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include +#include "esp_err.h" #include "tusb.h" #include "tusb_option.h" #include "tusb_config.h" diff --git a/components/tinyusb/additions/include/tinyusb_types.h b/components/tinyusb/additions/include/tinyusb_types.h index 0f226f3fa1..2c59f114a6 100644 --- a/components/tinyusb/additions/include/tinyusb_types.h +++ b/components/tinyusb/additions/include/tinyusb_types.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) Co. Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/components/tinyusb/additions/include/tusb_cdc_acm.h b/components/tinyusb/additions/include/tusb_cdc_acm.h index fb837a5f31..f0e189d77b 100644 --- a/components/tinyusb/additions/include/tusb_cdc_acm.h +++ b/components/tinyusb/additions/include/tusb_cdc_acm.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) Co. Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/components/tinyusb/additions/include/tusb_console.h b/components/tinyusb/additions/include/tusb_console.h index 530221dc6f..568fee0999 100644 --- a/components/tinyusb/additions/include/tusb_console.h +++ b/components/tinyusb/additions/include/tusb_console.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) Co. Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/components/tinyusb/additions/include/tusb_tasks.h b/components/tinyusb/additions/include/tusb_tasks.h index 7f3209db51..22b6df6c27 100644 --- a/components/tinyusb/additions/include/tusb_tasks.h +++ b/components/tinyusb/additions/include/tusb_tasks.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/components/tinyusb/additions/include/vfs_tinyusb.h b/components/tinyusb/additions/include/vfs_tinyusb.h index 233b7f149f..79c69bd726 100644 --- a/components/tinyusb/additions/include/vfs_tinyusb.h +++ b/components/tinyusb/additions/include/vfs_tinyusb.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) Co. Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/components/tinyusb/additions/include_private/cdc.h b/components/tinyusb/additions/include_private/cdc.h index b3aa870f25..360ff1645b 100644 --- a/components/tinyusb/additions/include_private/cdc.h +++ b/components/tinyusb/additions/include_private/cdc.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) Co. Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/components/tinyusb/additions/include_private/descriptors_control.h b/components/tinyusb/additions/include_private/descriptors_control.h index 461ffa85e9..f8fd9a4285 100644 --- a/components/tinyusb/additions/include_private/descriptors_control.h +++ b/components/tinyusb/additions/include_private/descriptors_control.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/components/tinyusb/additions/include_private/usb_descriptors.h b/components/tinyusb/additions/include_private/usb_descriptors.h index 76c2b54b91..65cb9f9e9a 100644 --- a/components/tinyusb/additions/include_private/usb_descriptors.h +++ b/components/tinyusb/additions/include_private/usb_descriptors.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/components/tinyusb/additions/src/cdc.c b/components/tinyusb/additions/src/cdc.c index ce46497f72..4fbdcbfa16 100644 --- a/components/tinyusb/additions/src/cdc.c +++ b/components/tinyusb/additions/src/cdc.c @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) Co. Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include #include "esp_check.h" diff --git a/components/tinyusb/additions/src/descriptors_control.c b/components/tinyusb/additions/src/descriptors_control.c index d7fbf0bda7..134ce0f21a 100644 --- a/components/tinyusb/additions/src/descriptors_control.c +++ b/components/tinyusb/additions/src/descriptors_control.c @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include "esp_log.h" #include "descriptors_control.h" diff --git a/components/tinyusb/additions/src/tusb_cdc_acm.c b/components/tinyusb/additions/src/tusb_cdc_acm.c index 4dad2bc062..6ee0057f57 100644 --- a/components/tinyusb/additions/src/tusb_cdc_acm.c +++ b/components/tinyusb/additions/src/tusb_cdc_acm.c @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) Co. Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include #include "esp_check.h" diff --git a/components/tinyusb/additions/src/tusb_console.c b/components/tinyusb/additions/src/tusb_console.c index 1942a05b1f..e8580bab44 100644 --- a/components/tinyusb/additions/src/tusb_console.c +++ b/components/tinyusb/additions/src/tusb_console.c @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) Co. Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include diff --git a/components/tinyusb/additions/src/tusb_tasks.c b/components/tinyusb/additions/src/tusb_tasks.c index 08251199df..2044382079 100644 --- a/components/tinyusb/additions/src/tusb_tasks.c +++ b/components/tinyusb/additions/src/tusb_tasks.c @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include "sdkconfig.h" #include "freertos/FreeRTOS.h" @@ -55,4 +47,4 @@ esp_err_t tusb_stop_task(void) return ESP_OK; } -#endif // !CONFIG_TINYUSB_NO_DEFAULT_TASK \ No newline at end of file +#endif // !CONFIG_TINYUSB_NO_DEFAULT_TASK diff --git a/components/tinyusb/additions/src/usb_descriptors.c b/components/tinyusb/additions/src/usb_descriptors.c index 3b24337f83..d087006897 100644 --- a/components/tinyusb/additions/src/usb_descriptors.c +++ b/components/tinyusb/additions/src/usb_descriptors.c @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include "usb_descriptors.h" #include "sdkconfig.h" diff --git a/components/tinyusb/additions/src/vfs_tinyusb.c b/components/tinyusb/additions/src/vfs_tinyusb.c index 0349bb8696..fdf31e6a9a 100644 --- a/components/tinyusb/additions/src/vfs_tinyusb.c +++ b/components/tinyusb/additions/src/vfs_tinyusb.c @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) Co. Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include #include diff --git a/tools/ci/check_copyright_ignore.txt b/tools/ci/check_copyright_ignore.txt index f84beac2c3..c346dd42af 100644 --- a/tools/ci/check_copyright_ignore.txt +++ b/tools/ci/check_copyright_ignore.txt @@ -2126,23 +2126,6 @@ components/tcp_transport/transport_utils.c components/tcpip_adapter/include/tcpip_adapter.h components/tcpip_adapter/include/tcpip_adapter_compatible/tcpip_adapter_compat.h components/tcpip_adapter/include/tcpip_adapter_types.h -components/tinyusb/additions/include/tinyusb.h -components/tinyusb/additions/include/tinyusb_types.h -components/tinyusb/additions/include/tusb_cdc_acm.h -components/tinyusb/additions/include/tusb_config.h -components/tinyusb/additions/include/tusb_console.h -components/tinyusb/additions/include/tusb_tasks.h -components/tinyusb/additions/include/vfs_tinyusb.h -components/tinyusb/additions/include_private/cdc.h -components/tinyusb/additions/include_private/descriptors_control.h -components/tinyusb/additions/include_private/usb_descriptors.h -components/tinyusb/additions/src/cdc.c -components/tinyusb/additions/src/descriptors_control.c -components/tinyusb/additions/src/tusb_cdc_acm.c -components/tinyusb/additions/src/tusb_console.c -components/tinyusb/additions/src/tusb_tasks.c -components/tinyusb/additions/src/usb_descriptors.c -components/tinyusb/additions/src/vfs_tinyusb.c components/touch_element/include/touch_element/touch_button.h components/touch_element/include/touch_element/touch_element.h components/touch_element/include/touch_element/touch_element_private.h From 6e661871c57e5f51e61ec47eb5a203c05e29a6d9 Mon Sep 17 00:00:00 2001 From: morris Date: Tue, 4 Jan 2022 10:33:23 +0800 Subject: [PATCH 3/3] tusb: optional compile tusb_task --- components/tinyusb/CMakeLists.txt | 5 ++++- components/tinyusb/additions/src/tusb_tasks.c | 4 ---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/components/tinyusb/CMakeLists.txt b/components/tinyusb/CMakeLists.txt index 854a7e7378..5e90277ec2 100644 --- a/components/tinyusb/CMakeLists.txt +++ b/components/tinyusb/CMakeLists.txt @@ -53,10 +53,13 @@ if(CONFIG_TINYUSB) "tinyusb/src/tusb.c" "additions/src/descriptors_control.c" "additions/src/tinyusb.c" - "additions/src/tusb_tasks.c" "additions/src/usb_descriptors.c" ) + if(NOT CONFIG_TINYUSB_NO_DEFAULT_TASK) + list(APPEND srcs "additions/src/tusb_tasks.c") + endif() + # when no builtin class driver is enabled, an uint8_t data compared with `BUILTIN_DRIVER_COUNT` will always be false set_source_files_properties("tinyusb/src/device/usbd.c" PROPERTIES COMPILE_FLAGS "-Wno-type-limits") diff --git a/components/tinyusb/additions/src/tusb_tasks.c b/components/tinyusb/additions/src/tusb_tasks.c index 2044382079..bf0681db54 100644 --- a/components/tinyusb/additions/src/tusb_tasks.c +++ b/components/tinyusb/additions/src/tusb_tasks.c @@ -12,8 +12,6 @@ #include "tinyusb.h" #include "tusb_tasks.h" -#if !CONFIG_TINYUSB_NO_DEFAULT_TASK - const static char *TAG = "tusb_tsk"; static TaskHandle_t s_tusb_tskh; @@ -46,5 +44,3 @@ esp_err_t tusb_stop_task(void) s_tusb_tskh = NULL; return ESP_OK; } - -#endif // !CONFIG_TINYUSB_NO_DEFAULT_TASK