Quantcast
Channel: Objective Development Forums
Viewing all articles
Browse latest Browse all 4524

Re: Send Integer to PC with usbMsgPtr

$
0
0
For example you could do this. Remember: "setupData" needs to be at least 8 bytes.
On the host side you again could decode the single bytes together to an int.

    usbMsgPtr = (usbMsgPtr_t)setupData;
    switch (rq->bRequest) {
    [...]
    case PSCMD_CALL_GETBUFFERSIZE: {
    setupData[0] = rq->bRequest;
    setupData[1] = PSCMD_RETN_OKAY;
    setupData[2] = (singlebuffersize)&0xff;
    setupData[3] = (singlebuffersize)>>8;
    cli();
    [...]

Best regards

Viewing all articles
Browse latest Browse all 4524

Trending Articles