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

Add non-blocking write function for USBCDC #7090

Merged
merged 1 commit into from Jun 14, 2018

Conversation

Projects
None yet
5 participants
@jorisa
Contributor

jorisa commented Jun 1, 2018

Description

For certain applications it is desirable to do a non-blocking write when sending larger blocks of data over USBSerial. I am proposing to add a second function to USBCDC to support this. Does anyone have suggestions on how to implement this in the API?

bool USBSerial::writeBlock(uint8_t * buf, uint16_t size) {
    if(size > MAX_PACKET_SIZE_EPBULK) {
        return false;
    }
    if(!send(buf, size)) {
        return false;
    }
    return true;
}

There could be an optional argument bool blocking=true, or a second function writeBlockNB, or make it always non-blocking?

Pull request type

[ ] Fix
[ ] Refactor
[ ] New target
[x] Feature
[ ] Breaking change

@0xc0170 0xc0170 requested a review from c1728p9 Jun 4, 2018

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Jun 4, 2018

@jorisa There's feature usb branch that might address this (@c1728p9 can confirm and review this). This should be the branch https://github.com/ARMmbed/mbed-os/tree/feature-hal-spec-usb-device

@c1728p9

c1728p9 approved these changes Jun 7, 2018

@0xc0170 0xc0170 added needs: CI and removed needs: review labels Jun 11, 2018

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Jun 11, 2018

/morph build

@mbed-ci

This comment has been minimized.

mbed-ci commented Jun 11, 2018

Build : SUCCESS

Build number : 2316
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7090/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci

This comment has been minimized.

@cmonr

This comment has been minimized.

Contributor

cmonr commented Jun 12, 2018

/morph mbed2-build

@mbed-ci

This comment has been minimized.

@cmonr

This comment has been minimized.

Contributor

cmonr commented Jun 12, 2018

Updated comment since this PR feels like it's more of a feature addition than a fix.

Rerunning test since failures appear to be focused around a device that had to be restarted today.
/morph test

@cmonr

This comment has been minimized.

Contributor

cmonr commented Jun 12, 2018

/morph mbed2-build

@cmonr

This comment has been minimized.

Contributor

cmonr commented Jun 12, 2018

We're looking into some CI issues at the moment. The test will be restarted when the dust has settled.

@mbed-ci

This comment has been minimized.

@cmonr

This comment has been minimized.

Contributor

cmonr commented Jun 13, 2018

Re-queued since failure was due to a newly discovered htrun bug.

/morph test

@mbed-ci

This comment has been minimized.

@cmonr cmonr added ready for merge and removed needs: CI labels Jun 14, 2018

@cmonr cmonr merged commit baf5637 into ARMmbed:master Jun 14, 2018

13 checks passed

AWS-CI uVisor Build & Test Success
Details
ci-morph-build build completed
Details
ci-morph-exporter build completed
Details
ci-morph-mbed2-build build completed
Details
ci-morph-test test completed
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
travis-ci/astyle Passed, 919 files
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/events Passed, runtime is 10239 cycles (+662 cycles)
Details
travis-ci/gitattributestest Local gitattributestest testing has passed
Details
travis-ci/littlefs Passed, code size is 9964B (+0.00%)
Details
travis-ci/tools-py2.7 Local tools-py2.7 testing has passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment