mirror of
https://github.com/candle-usb/candleLight_fw.git
synced 2025-01-14 05:42:53 +08:00
Help the compiler optimize out the terminating resistor
Use get_term to make sure the compiler can identify that the branch will always fail. Signed-off-by: Daniel Trevitz <daniel.trevitz@wika.com>
This commit is contained in:
parent
0a1d6dc920
commit
d991308d63
@ -394,9 +394,11 @@ static uint8_t USBD_GS_CAN_EP0_RxReady(USBD_HandleTypeDef *pdev) {
|
||||
break;
|
||||
|
||||
case GS_USB_BREQ_SET_TERMINATION:
|
||||
memcpy(¶m_u32, hcan->ep0_buf, sizeof(param_u32));
|
||||
if (set_term(req->wValue, param_u32) == GS_CAN_TERMINATION_UNSUPPORTED) {
|
||||
USBD_CtlError(pdev, req);
|
||||
if (get_term(req->wValue) != GS_CAN_TERMINATION_UNSUPPORTED) {
|
||||
memcpy(¶m_u32, hcan->ep0_buf, sizeof(param_u32));
|
||||
if (set_term(req->wValue, param_u32) == GS_CAN_TERMINATION_UNSUPPORTED) {
|
||||
USBD_CtlError(pdev, req);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user