Commit d1f5fa95 authored by Henrique Silva's avatar Henrique Silva

Check the 12v sensor value directly instead of waiting the state machine

If we only check the sensor state flag, when a abrupt shutdown occurs,
we'll have to run through the sensor event state machine at least 2
times before achieving a state that causes the P12vGOOD flag to be
cleared.
Since the payload task runs at a greater frequency than the sensors',
it'll try to power-up the payload again based on the erroneous sensor
state
parent a81ee5c6
......@@ -96,7 +96,9 @@ void vTaskINA220( void *Parameters )
if( ina220_sensor->sdr == &SDR_FMC1_12V ) {
/* Check if the Payload power is in an acceptable zone */
if ((ina220_sensor->state == SENSOR_STATE_NORMAL) || (ina220_sensor->state == SENSOR_STATE_HIGH) || (ina220_sensor->state == SENSOR_STATE_LOW ) ) {
SDR_type_01h_t * ina220_sdr = ( SDR_type_01h_t * ) ina220_sensor->sdr;
if ( ( ina220_sensor->readout_value >= (ina220_sdr->lower_critical_thr ) ) &&
( ina220_sensor->readout_value <= (ina220_sdr->upper_critical_thr ) ) ) {
payload_send_message(PAYLOAD_MESSAGE_P12GOOD);
} else {
payload_send_message(PAYLOAD_MESSAGE_P12GOODn);
......
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