This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/CC2650MODA: Wake up when battCriticalLevel

Part Number: CC2650MODA

Tool/software: Code Composer Studio

Hi, 

Is that possible, when device in sleep mode, battery goes critical level and gives automatically warning ? 

//*************************************************************************

bStatus_t Batt_SetParameter(uint8_t param, uint8_t len, void *value)

{
bStatus_t ret = SUCCESS;

switch (param)
{
case BATT_PARAM_CRITICAL_LEVEL:
battCriticalLevel = *((uint8*)value);

// If below the critical level and critical state not set, notify it
if (battLevel < battCriticalLevel)
{
battNotifyLevel();
}
break;

default:
ret = INVALIDPARAMETER;
break;
}

return (ret);
}

//****************************************************************************

static void battNotifyLevel(void)
{
uint8_t i;
for (i = 0; i < linkDBNumConns; i++)
{
uint16_t connHandle = battLevelClientCharCfg[i].connHandle;

if (connHandle != INVALID_CONNHANDLE)
{
// Send notification to connected device.
battNotify(connHandle);
}
}
}

//****************************************************************************

when battCriticalLevel>battLevel i want to wake device up and sends low battery message automatically. Is that possible ?

Thanks a lot 

  • Hi Mert,

    There is no interrupt capability in the battery monitor. You could however potentially do something with the comparator and Sensor Controller. We do not have any examples readily available for this though.

    Cheers,
    Fredrik