Commit 89c6c28e authored by Maciej Lipinski's avatar Maciej Lipinski

[HAL/leds] modify main status LED behavior

Make sure that the status LED does go green before the LPDC tx
calibration is finished.
parent fb730c85
......@@ -153,9 +153,12 @@ static int hal_init(void)
/* Initialize IPC/RPC - see hal_ports.c */
assert_init(hal_port_wripc_init(logfilename));
//everything is fine up to here, we can blink green LED
shw_io_write(shw_io_led_state_o, 0);
shw_io_write(shw_io_led_state_g, 1);
/* While we are leaving initialization function, there might be
still LPDC tx calibation ongoing - this is still initialization.
The status LED is set to green once the LPDC tx calibration is
completed. This is done in hal_port_fms_tx.c, whenit is detected
that all the ports have been calibrated (i.e. in the
port_tx_setup_fsm_state_done state.*/
if (daemon_mode)
hal_daemonize();
......
......@@ -22,6 +22,7 @@
#include "hal_ports.h"
#include "hal_port_fsm_txP.h"
#include "hal_port_fsm.h"
#include <libwr/shw_io.h>
/**
* State machine
......@@ -339,6 +340,14 @@ static int port_tx_setup_fsm_state_wait_other_ports(fsm_t *fsm, int eventMsk, in
* Return final state machine reached
*/
static int port_tx_setup_fsm_state_done(fsm_t *fsm, int eventMsk, int isNewState) {
/* Set status led to green when the tx LPDC is completed (the DONE
state is entered by EACH port when ALL the ports are done,
virtually at the same moment).
This is Suboptimal: should be done only ONCE for ALL the ports
are done, yet it does not harm to do it 18 times...and it simplifies
the code. */
shw_io_write(shw_io_led_state_o, 0);
shw_io_write(shw_io_led_state_g, 1);
return 1; /* Final state reached */
}
......
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