Skip to content

Commit

Permalink
firmware: Do not indicate USB switch state
Browse files Browse the repository at this point in the history
If we want to use LED(s) to indicate the switch state, we should do it
in a way that the existing LED usage does not override.
  • Loading branch information
mossmann committed Oct 6, 2023
1 parent 7c7fdbe commit 338e921
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
7 changes: 1 addition & 6 deletions firmware/src/boards/cynthion_d11/usb_switch.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,16 @@

#include "usb_switch.h"
#include "apollo_board.h"
#include "led.h"
#include <hal/include/hal_gpio.h>

/**
* Hand off shared USB port to FPGA.
*/
void hand_off_usb(void)
{
#if ((_BOARD_REVISION_MAJOR_ == 0) && (_BOARD_REVISION_MINOR_ < 6))
led_on(LED_D);
#else
#if (((_BOARD_REVISION_MAJOR_ == 0) && (_BOARD_REVISION_MINOR_ >= 6)) || (_BOARD_REVISION_MAJOR_ == 1))
gpio_set_pin_level(USB_SWITCH, false);
gpio_set_pin_direction(USB_SWITCH, GPIO_DIRECTION_OUT);
led_off(LED_D);
#endif
}

Expand All @@ -35,7 +31,6 @@ void take_over_usb(void)
gpio_set_pin_level(USB_SWITCH, true);
gpio_set_pin_direction(USB_SWITCH, GPIO_DIRECTION_OUT);
#endif
led_on(LED_D);
}

/**
Expand Down
3 changes: 0 additions & 3 deletions firmware/src/boards/cynthion_d21/usb_switch.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,20 @@
* SPDX-License-Identifier: BSD-3-Clause
*/

#include "led.h"
#include "usb_switch.h"

/**
* Hand off shared USB port to FPGA.
*/
void hand_off_usb(void)
{
led_on(LED_D);
}

/**
* Take control of USB port from FPGA.
*/
void take_over_usb(void)
{
led_on(LED_D);
}

/**
Expand Down

0 comments on commit 338e921

Please sign in to comment.