Skip to content
Merged
Changes from all commits
Commits
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
12 changes: 8 additions & 4 deletions firmware/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -630,11 +630,12 @@ void handle_pending_usb_setup() {
SETUP_EP0_IN_BUF(2);
}
} else {
SETUP_EP0_IN_BUF(2);
SETUP_EP0_OUT_BUF();
while(EP0CS & _BUSY);
if(!iobuf_set_voltage(arg_mask, (__xdata uint16_t *)EP0BUF)) {
latch_status_bit(ST_ERROR);
}
ACK_EP0();
}

return;
Expand Down Expand Up @@ -685,7 +686,7 @@ void handle_pending_usb_setup() {
SETUP_EP0_IN_BUF(4);
}
} else {
SETUP_EP0_IN_BUF(4);
SETUP_EP0_OUT_BUF();
while(EP0CS & _BUSY);

if(glasgow_config.revision >= GLASGOW_REV_C2)
Expand All @@ -696,6 +697,7 @@ void handle_pending_usb_setup() {
if(!result) {
latch_status_bit(ST_ERROR);
}
ACK_EP0();
}

return;
Expand Down Expand Up @@ -754,7 +756,7 @@ void handle_pending_usb_setup() {
SETUP_EP0_IN_BUF(2);
}
} else {
SETUP_EP0_IN_BUF(2);
SETUP_EP0_OUT_BUF();
while(EP0CS & _BUSY);
if(!iobuf_set_voltage_limit(arg_mask, (__xdata uint16_t *)EP0BUF)) {
latch_status_bit(ST_ERROR);
Expand All @@ -767,6 +769,7 @@ void handle_pending_usb_setup() {
latch_status_bit(ST_ERROR);
}
}
ACK_EP0();
}

return;
Expand All @@ -789,14 +792,15 @@ void handle_pending_usb_setup() {
SETUP_EP0_IN_BUF(2);
}
} else {
SETUP_EP0_IN_BUF(2);
SETUP_EP0_OUT_BUF();
while(EP0CS & _BUSY);
if(glasgow_config.revision < GLASGOW_REV_C0 ||
!iobuf_set_pull(arg_selector,
*((__xdata uint8_t *)EP0BUF + 0),
*((__xdata uint8_t *)EP0BUF + 1))) {
latch_status_bit(ST_ERROR);
}
ACK_EP0();
}

return;
Expand Down
Loading