Skip to content

Commit

Permalink
Handle CLEAR_HALT
Browse files Browse the repository at this point in the history
  • Loading branch information
kauwua committed Jan 31, 2025
1 parent 2a40bfa commit ef5b27e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions hydradancer/firmware_hydradancer/User/definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#define CHECK_HYDRADANCER_READY 57
#define DO_BUS_RESET 58
#define CONFIGURED 59
#define CLEAR_HALT 60

#define EVENT_BUS_RESET 0x0
#define EVENT_IN_BUFFER_AVAILABLE 0x1
Expand Down
16 changes: 16 additions & 0 deletions hydradancer/firmware_hydradancer/User/usb_control_handlers.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,22 @@ uint16_t usb_control_endp0_user_handled_control_request(USB_SETUP* request, uint
}
return 0;
}
else if (request->bRequest == CLEAR_HALT)
{
LOG("CLEAR_HALT ep %d dir %d \r\n", request->wValue.bw.bb1, request->wValue.bw.bb0);

uint32_t ep = 0;
if (request->wValue.bw.bb0 == 0)
{
ep = 1U << ((request->wValue.bw.bb1 - 1) * 2 + 1);
}
else
{
ep = 1U << ((request->wValue.bw.bb1 - 1) * 2);
}
usb2_setup_endpoints_in_mask(ep);
return 0;
}
else if (request->bRequest == CHECK_HYDRADANCER_READY)
{
*buf = (uint8_t*)&boards_ready;
Expand Down

0 comments on commit ef5b27e

Please sign in to comment.