Skip to content

Zlp request2 #149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 34 commits into from
Nov 4, 2019
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
340dcb8
For control transfers, compare the transmitted length against the req…
pigrew Sep 12, 2019
8cca287
Add verification that there is enough buffer space for HID OUT contro…
pigrew Sep 12, 2019
1e17e2e
Add details on dcd_edpt_xfer in the porting document.
pigrew Sep 12, 2019
705b8be
Merge branch 'master' into ZLP_Request2
pigrew Sep 13, 2019
91fa24d
Merge branch 'master' into ZLP_Request2
pigrew Sep 27, 2019
0078be9
Merge branch 'master' into ZLP_Request2
pigrew Sep 29, 2019
4ea2a4e
Github's web interface changed line endings without asking me. Oops.
pigrew Sep 29, 2019
cef388b
Merge branch 'master' into ZLP_Request2
pigrew Oct 2, 2019
a29eb87
Merge branch 'ZLP_Request2' of https://github.com/pigrew/tinyusb into…
hathach Oct 29, 2019
8a57997
Merge branch 'master' into pigrew-ZLP_Request2
hathach Oct 31, 2019
e6857d8
clean up
hathach Oct 31, 2019
0029b58
rename
hathach Oct 31, 2019
d9ba4d9
move function around, more rename
hathach Oct 31, 2019
6de9eb4
add more tests, fix an issue with tud_descriptor_configuration_cb() r…
hathach Oct 31, 2019
6067adc
adeded tests for zlp
hathach Oct 31, 2019
cacbb80
zlp should work with control in, tested with Unity framework
hathach Oct 31, 2019
f587268
update doc, hid set report
hathach Oct 31, 2019
bd8b4e4
rename zlp test
hathach Oct 31, 2019
d35f869
Merge remote-tracking branch 'origin/master' into ZLP_Request2
pigrew Oct 31, 2019
981e64d
implement pigrew review
hathach Nov 1, 2019
ac0203b
update doc
hathach Nov 1, 2019
164d0db
Merge branch 'ZLP_Request2' into pigrew-ZLP_Request2
hathach Nov 1, 2019
7bf01e2
make control buf static
hathach Nov 3, 2019
585aebe
add uart support for stm32f072disco
hathach Nov 3, 2019
5ca75eb
seperate DEBUG from LOG
hathach Nov 3, 2019
62f8c14
add a bit of log1 for debugging
hathach Nov 3, 2019
5839159
Enable UART debugging on F070.
pigrew Nov 3, 2019
cebc066
Add UART HAL source file to stm32f070 makefile.
pigrew Nov 3, 2019
68a53e0
Merge pull request #2 from hathach/pigrew-ZLP_Request2
pigrew Nov 3, 2019
44ad683
fix tud_control_status() didn't update request
hathach Nov 4, 2019
0d856b7
Merge pull request #3 from hathach/pigrew-ZLP_Request2
pigrew Nov 4, 2019
c98acd3
Use control transfer function to send control data (in usbtmc)
pigrew Nov 4, 2019
a94fe05
usbd: Change TU_ASSERT to TU_VERIFY as the assertion can be hit when …
pigrew Nov 4, 2019
8d0fa15
Change one more TU_ASSERT to TU_VERIFY in usbd.
pigrew Nov 4, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
clean up
  • Loading branch information
hathach committed Oct 31, 2019
commit e6857d8ee087c8185dda2901646fbec1352e2292
11 changes: 2 additions & 9 deletions src/device/usbd_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ typedef struct
void* buffer;
uint16_t len;
uint16_t total_transferred;
uint16_t requested_len;

bool (*complete_cb) (uint8_t, tusb_control_request_t const *);
} usbd_control_xfer_t;
Expand Down Expand Up @@ -90,16 +89,10 @@ void usbd_control_set_complete_callback( bool (*fp) (uint8_t, tusb_control_reque

bool tud_control_xfer(uint8_t rhport, tusb_control_request_t const * request, void* buffer, uint16_t len)
{
// transmitted length must be <= requested length (USB 2.0 spec: 8.5.3.1 )
// FIXME: Should logic be here or in place that calls this function?
if(len > request->wLength)
len = request->wLength;

_control_state.request = (*request);
_control_state.buffer = buffer;
_control_state.total_transferred = 0;
_control_state.requested_len = request->wLength;
_control_state.len = len;
_control_state.len = tu_min16(len, request->wLength);

if ( len )
{
Expand Down Expand Up @@ -131,7 +124,7 @@ bool usbd_control_xfer_cb (uint8_t rhport, uint8_t ep_addr, xfer_result_t result
_control_state.total_transferred += xferred_bytes;
_control_state.buffer = ((uint8_t*)_control_state.buffer) + xferred_bytes;

if ( (_control_state.requested_len == _control_state.total_transferred) || xferred_bytes < CFG_TUD_ENDPOINT0_SIZE )
if ( (_control_state.request.wLength == _control_state.total_transferred) || xferred_bytes < CFG_TUD_ENDPOINT0_SIZE )

{
// DATA stage is complete
Expand Down