<p><b>@bergzand</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/12267#discussion_r325584193">sys/usb/usbus/usbus_control.c</a>:</p>
<pre style='color:#555'>> @@ -213,21 +212,19 @@ static int _recv_dev_setup(usbus_t *usbus, usb_setup_t *pkt)
             case USB_SETUP_REQ_SET_ADDRESS:
                 DEBUG("usbus_control: Setting address\n");
                 usbus->addr = (uint8_t)pkt->value;
-                res = 0;
+                res = 1;
</pre>
<p>This must follow the same return codes from the <code>control_handler</code> function:</p>
<ul>
<li>Negative on error, results in USB stall</li>
<li>Zero when it is not handled, results in an USB nack if nothing handles the request</li>
<li>Positive for the length, which is useful for USB IN transactions, but doesn't really mean anything for OUT transactions where the host decides the amount of data.</li>
</ul>
<p>This last case could be documented a bit better for OUT transactions</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/12267?email_source=notifications&email_token=ABE7WYHDJFJB3LGWUMZVWKTQKH23NA5CNFSM4IXUWNC2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCFC7XVQ#discussion_r325584193">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYDDJENZK5FHGXUZLULQKH23NANCNFSM4IXUWNCQ">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABE7WYDWY7PKMV7EQFK5PWTQKH23NA5CNFSM4IXUWNC2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCFC7XVQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/12267?email_source=notifications\u0026email_token=ABE7WYHDJFJB3LGWUMZVWKTQKH23NA5CNFSM4IXUWNC2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCFC7XVQ#discussion_r325584193",
"url": "https://github.com/RIOT-OS/RIOT/pull/12267?email_source=notifications\u0026email_token=ABE7WYHDJFJB3LGWUMZVWKTQKH23NA5CNFSM4IXUWNC2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCFC7XVQ#discussion_r325584193",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>