Skip to content

Commit

Permalink
firmware: respond to FPGA vendor requests
Browse files Browse the repository at this point in the history
instead of letting them time out
  • Loading branch information
mossmann committed Oct 9, 2023
1 parent dd8a4a3 commit 52c2ee3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
10 changes: 2 additions & 8 deletions apollo_fpga/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,18 +228,12 @@ def set_led_pattern(self, number):

def soft_reset(self):
""" Resets the target (FPGA/etc) connected to the debug controller. """
try:
self.out_request(self.REQUEST_RECONFIGURE)
except usb.core.USBError:
pass
self.out_request(self.REQUEST_RECONFIGURE)


def force_fpga_offline(self):
""" Resets the target (FPGA/etc) connected to the debug controller. """
try:
self.out_request(self.REQUEST_FORCE_FPGA_OFFLINE)
except usb.core.USBError:
pass
self.out_request(self.REQUEST_FORCE_FPGA_OFFLINE)

def close(self):
""" Closes the USB device so it can be reused, possibly by another ApolloDebugger """
Expand Down
4 changes: 2 additions & 2 deletions firmware/src/vendor.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ bool handle_set_led_pattern(uint8_t rhport, tusb_control_request_t const* reques
bool handle_trigger_fpga_reconfiguration(uint8_t rhport, tusb_control_request_t const* request)
{
trigger_fpga_reconfiguration();
return true;
return tud_control_xfer(rhport, request, NULL, 0);
}


Expand All @@ -99,7 +99,7 @@ bool handle_trigger_fpga_reconfiguration(uint8_t rhport, tusb_control_request_t
bool handle_force_fpga_offline(uint8_t rhport, tusb_control_request_t const* request)
{
force_fpga_offline();
return true;
return tud_control_xfer(rhport, request, NULL, 0);
}


Expand Down

0 comments on commit 52c2ee3

Please sign in to comment.