Skip to content

Commit

Permalink
Revert brownout detection logic
Browse files Browse the repository at this point in the history
This should be handled on the modem side via existing mechanisms.

Resolves: LE-11377
Change-Id: Ic95fb9f59f242e6f112700dd3a23af42403b7ff8
  • Loading branch information
kdunwoody committed Oct 16, 2018
1 parent d8da8c5 commit a51315a
Showing 1 changed file with 0 additions and 50 deletions.
50 changes: 0 additions & 50 deletions framework/daemons/linux/start/start.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,6 @@ static const char GoldenAppsPath[] = "/mnt/legato/apps/";
static const char GoldenModemService[] = "/mnt/legato/system/apps/modemService";
static const char ModemPAPath[] = "/read-only/lib/libComponent_le_pa.so";

//--------------------------------------------------------------------------------------------------
/**
* Brownout voltage limit (in mV)
*/
//--------------------------------------------------------------------------------------------------
static const uint32_t BrownoutVoltageLimit = 3525;

//--------------------------------------------------------------------------------------------------
/**
* Pointer to modem PA (assuming modem PA exists).
Expand Down Expand Up @@ -268,43 +261,6 @@ static void LoadModemPA
}


//--------------------------------------------------------------------------------------------------
/**
* Check if system is in brownout
*/
//--------------------------------------------------------------------------------------------------
static bool IsBrownout
(
void
)
{
static int (*pa_ips_GetInputVoltage)(uint32_t*) = NULL;
uint32_t inputVoltage;

if (!ModemPASoPtr)
{
// No way to get voltage; assume not a brownout
return false;
}

pa_ips_GetInputVoltage = dlsym(ModemPASoPtr, "pa_ips_GetInputVoltage");
if (!pa_ips_GetInputVoltage)
{
// No way to get voltage; assume not a brownout
LE_WARN("Could not get function pa_ips_GetInputVoltage");
LE_INFO("%s", dlerror());
return false;
}

if (pa_ips_GetInputVoltage(&inputVoltage))
{
return false;
}
LE_INFO("Checking for brownout %d", inputVoltage);

return inputVoltage < BrownoutVoltageLimit;
}

//--------------------------------------------------------------------------------------------------
/**
* Check if system reboot is due to hardware reason (under voltage, over temperature)
Expand Down Expand Up @@ -2198,12 +2154,6 @@ int main

LoadModemPA();

// Wait until not in a brownout condition.
while (IsBrownout())
{
sleep(1);
}

while(1)
{
if (!isReadOnly)
Expand Down

0 comments on commit a51315a

Please sign in to comment.