Commit f7a01f92 authored by Maciej Lipinski's avatar Maciej Lipinski Committed by Grzegorz Daniluk

[HAL] turn calibration LED off when starting calibration

In the rx calib FSM, this is needed to over the case when the
calibration is re-started (INIT state entered) during execution
of the FSM (e.g. due to link unplugging, or timeout).

In the tx calib FSM, in theory this is not needed, yet it seems
clean and it might be needed in the future if some sort of
reset is implemented.
parent c724d30a
......@@ -123,6 +123,12 @@ static inline void updatePllState(struct hal_port_state * ps) {
static int _hal_port_rx_setup_state_init(fsm_t *fsm, int eventMsk, int isNewState) {
struct hal_port_state * ps = (struct hal_port_state*) fsm->priv;
/* Turn off LED, this is needed mainly when INIT state is entered
* as a fall-back during the RX FSM execution (say the link was
* unplugged when the calibration was ongoing, or a timeout occured).
*/
led_set_wrmode(ps->hw_index,SFP_LED_WRMODE_OFF);
if ( ps->lpdc.globalLpdc->numberOfLpdcPorts ) {
if (ps->lpdc.isSupported) {
if ( _isHalRxSetupEventEarlyLinkUp(eventMsk) )
......
......@@ -139,6 +139,9 @@ static int port_tx_setup_fsm_state_start(fsm_t *fsm, int eventMsk, int isNewStat
/* Disable TX light on this port */
shw_sfp_gpio_set(ps->hw_index, SFP_TX_DISABLE);
/* Bring LED to a known state (i.e. OFF), just in case*/
led_set_wrmode(ps->hw_index,SFP_LED_WRMODE_OFF);
txSetupNotDone(ps);
if ( !ps->lpdc.isSupported ) {
// NO LPDC support
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment