Commit Graph

72 Commits

Author SHA1 Message Date
hathach c3c0648456
add class driver deinit 2024-04-08 22:07:56 +07:00
hathach 979bf32266
default class driver log level to CFG_TUH/TUD_LOG_LEVEL allow application to selectively disable usbd/usbh or driver log 2023-08-02 15:34:18 +07:00
hathach ef49b93532
rename CFG_TUSB_MEM_SECTION to CFG_TUD_MEM_SECTION in device stack
CFG_TUD_MEM_SECTION is default to CFG_TUSB_MEM_SECTION
2023-07-24 15:46:21 +07:00
Ha Thach 65ac519715
Merge pull request #1852 from silvergasp/mem_s
fix: Replace device calls to memcpy with tu_memcpy_s
2023-02-27 10:22:53 +07:00
hathach 498989ee00
use tu_static instead of static _fuzz_thread 2023-02-22 16:23:40 +07:00
hathach 03ec49450d
rename maros from FUZZ to _FUZZ, change TU_STATIC to static _fuzz_thread 2023-02-22 11:47:09 +07:00
Nathaniel Brough 18c3095346 fix: Change all static variables to thread when fuzzing 2023-01-20 15:45:31 -08:00
Nathaniel Brough 2e47210c1a fix: Replace device calls to memcpy with tu_memcpy_s
Introduces a new function tu_memcpy_s, which is effectively
a backport of memcpy_s. The change also refactors calls
to memcpy over to the more secure tu_memcpy_s.
2023-01-13 15:20:32 -08:00
Jerzy Kasenberg c7469ce986 dfu: Allow DFU coexistence with other interfaces
dfu_moded_open() only works correct when its called on DFU interface
descriptor. It means that DFU is the only one interface in configuration
or driver is called after all others interface drivers were tried and
gave up.

If other interface is supported and but driver for DFU is called first
(this is the case for BTH and RNDIS).
Code after while loop (that was not entered) has an TU_ASSERT that will
make set_configuration to fail.

Now TU_VERIFY is called first to make sure open code is called for DFU
only and not other interface descriptors like in other drivers.
2022-08-09 10:42:30 +02:00
hathach d10326cb4e rename TUSB_OPT_DEVICE_ENABLED to CFG_TUD_ENABLED
TUSB_OPT_DEVICE_ENABLED still usable for backward compatible
2022-02-25 18:35:21 +07:00
hathach 0b249618b0 fix -Wcast-qual 2021-10-15 23:54:31 +07:00
MasterPhi 0ba4315ae5 Fix IAR warning 2021-07-27 18:08:52 +02:00
hathach 9542fcdbcd rename CFG_TUD_DFU_TRANSFER_BUFSIZE to CFG_TUD_DFU_XFER_BUFSIZE 2021-07-22 01:00:06 +07:00
hathach 3960beece0 rename CFG_TUD_DFU_MODE to simply CFG_TUD_DFU 2021-07-15 20:52:58 +07:00
hathach daca9e520b wrap up DFU update 2021-07-15 20:47:50 +07:00
hathach b4fde90b55 update clear status and get state 2021-07-14 17:03:20 +07:00
hathach 6a68fc6997 update dfu abort 2021-07-14 16:51:28 +07:00
hathach 95ded08e3b simplify upload request 2021-07-14 16:42:12 +07:00
hathach 5b965a3888 more rename and update 2021-07-14 15:52:38 +07:00
hathach 27676f738d rename tud_dfu_reboot_cb() to tud_dfu_detach_cb() 2021-07-14 15:31:20 +07:00
hathach 57d9f696a2 clean up 2021-07-14 15:24:09 +07:00
hathach ac8d0abecf rename dfu API
- tud_dfu_dnload_complete() -> tud_dfu_download_complete()
- tud_dfu_req_dnload_data_cb() -> tud_dfu_download_cb()
- tud_dfu_req_upload_data_cb() -> tud_dfu_upload_cb()
2021-07-14 15:04:38 +07:00
hathach 86d511f244 rename tud_dfu_set_timeout_cb() to tud_dfu_get_status_cb()
also add state as argument
2021-07-12 21:08:13 +07:00
hathach 8c48a4a288 clean up 2021-07-12 20:23:19 +07:00
hathach 389d340678 clean up 2021-07-12 20:17:44 +07:00
hathach 2916cd4575 rename TUD_DFU_MODE_DESCRIPTOR to TUD_DFU_DESCRIPTOR 2021-07-12 18:51:57 +07:00
hathach 134ed995c8 add alt to tud_dfu_abort_cb() 2021-07-12 18:50:19 +07:00
hathach a0691a4fd4 update dfu_moded_open 2021-07-12 18:48:33 +07:00
Mengsk 2147a31f25 Fix wrong blocknum and length 2021-07-08 01:10:02 +02:00
Mengsk 5b4b5ca533 Add bwPollTimeout set callback, postpone download callback after GETSTATUS 2021-07-08 00:25:12 +02:00
HiFiPhile 7e883e0f41 Refactor with one DFU functionnal descriptor 2021-07-07 19:01:00 +02:00
Mengsk 941b02c6a9 Reactor to one functional descriptor. 2021-07-07 18:02:04 +02:00
Mengsk 71c0043261 TU_ASSERT return 0. 2021-07-07 12:18:25 +02:00
Mengsk 3949fb9e8c Add DFU_DETACH support 2021-07-07 12:12:52 +02:00
Mengsk 88478594bc Update comment 2021-07-07 12:06:41 +02:00
Mengsk bc49ee7f2f Better alt settings support 2021-07-07 11:55:36 +02:00
MasterPhi cf4220a9fb Update 2021-07-06 18:04:24 +02:00
Mengsk c2b9ac9dd4 Fix ATTR_MANIFESTATION_TOLERANT logic. 2021-07-05 17:57:23 +02:00
Mengsk c2d8ed3fd1 Add alt settings support in DFU class. 2021-07-05 17:56:21 +02:00
hathach dfe410ea8b fix ci build, address review comment 2021-07-05 12:38:15 +07:00
Jeremiah McCarthy f5f087b2f8 Add dfu function memory access protection
Adds TU_VERIFY to dfu internal buffer access from host.

Adds TU_ASSERT to dfu internal buffer access by application.
2021-06-23 10:58:18 -04:00
hathach 9736e54734
include clean up 2021-05-27 17:40:39 +07:00
hathach f9c542aa52
fix dfu example build 2021-05-26 18:16:56 +07:00
Jeremiah McCarthy dab1ed6b32 Add example to be tested
Update API description.
2021-05-05 17:42:38 -04:00
Jeremiah McCarthy f830800d00 Fix typo and clean up reset 2021-04-29 16:04:18 -04:00
Jeremiah McCarthy b8e5885c2b Removes polltimeout behaviour and restructures
Moves dfu_req_dnload_reply to ACK stage of a DNREQUEST.

Removes unneeded variables due to other simplifications.
2021-04-22 17:45:33 -04:00
Jeremiah McCarthy 8c80ddeb54 Fix statte check on DATA stage 2021-04-22 17:00:57 -04:00
Jeremiah McCarthy cc440ade81 Remove custom status description table 2021-04-22 16:47:05 -04:00
Jeremiah McCarthy e54d9d10af Add const 2021-04-22 16:39:43 -04:00
Jeremiah McCarthy 289af581bb Remove uunused code 2021-04-22 16:06:06 -04:00