mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-27 10:22:08 +00:00
Unit test for ocmp_ltc4275
This commit is contained in:
@@ -71,8 +71,12 @@ static void ltc4275_handle_irq(void *context)
|
||||
*/
|
||||
void ltc4275_config(const LTC4275_Dev *dev)
|
||||
{
|
||||
OcGpio_configure(dev->cfg.pin_evt, OCGPIO_CFG_INPUT);
|
||||
OcGpio_configure(dev->cfg.pin_detect, OCGPIO_CFG_INPUT);
|
||||
if (dev == NULL) {
|
||||
LOGGER("LTC4275::ERROR: Configuration is NULL.\n");
|
||||
} else {
|
||||
OcGpio_configure(dev->cfg.pin_evt, OCGPIO_CFG_INPUT);
|
||||
OcGpio_configure(dev->cfg.pin_detect, OCGPIO_CFG_INPUT);
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
@@ -88,6 +92,10 @@ ePostCode ltc4275_probe(const LTC4275_Dev *dev, POSTData *postData)
|
||||
{
|
||||
ePostCode postCode = POST_DEV_MISSING;
|
||||
ePDPowerState pdStatus = LTC4275_POWERGOOD_NOTOK;
|
||||
if (dev == NULL) {
|
||||
LOGGER("LTC4275::ERROR: Configuration is NULL.\n");
|
||||
return postCode;
|
||||
}
|
||||
ReturnStatus ret = ltc4275_get_power_good(dev, &pdStatus);
|
||||
if (ret != RETURN_OK) {
|
||||
LOGGER("LTC4275::ERROR: Power good signal read failed.\n");
|
||||
@@ -120,12 +128,17 @@ ePostCode ltc4275_probe(const LTC4275_Dev *dev, POSTData *postData)
|
||||
*/
|
||||
ReturnStatus ltc4275_init(LTC4275_Dev *dev)
|
||||
{
|
||||
ReturnStatus ret = RETURN_OK;
|
||||
ReturnStatus ret = RETURN_NOTOK;
|
||||
|
||||
if (dev == NULL) {
|
||||
LOGGER("LTC4275::ERROR: Configuration is NULL.\n");
|
||||
return ret;
|
||||
}
|
||||
dev->obj = (LTC4275_Obj){};
|
||||
|
||||
dev->obj.mutex = GateMutex_create(NULL, NULL);
|
||||
if (!dev->obj.mutex) {
|
||||
return RETURN_NOTOK;
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = ltc4275_get_power_good(dev, &PDStatus_Info.pdStatus.powerGoodStatus);
|
||||
@@ -148,7 +161,7 @@ ReturnStatus ltc4275_init(LTC4275_Dev *dev)
|
||||
const uint32_t pin_evt_cfg =
|
||||
OCGPIO_CFG_INPUT | OCGPIO_CFG_INT_BOTH_EDGES;
|
||||
if (OcGpio_configure(dev->cfg.pin_evt, pin_evt_cfg) < OCGPIO_SUCCESS) {
|
||||
return RETURN_NOTOK;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Use a threaded interrupt to handle IRQ */
|
||||
@@ -169,6 +182,10 @@ ReturnStatus ltc4275_init(LTC4275_Dev *dev)
|
||||
void ltc4275_set_alert_handler(LTC4275_Dev *dev, LTC4275_CallbackFn alert_cb,
|
||||
void *cb_context)
|
||||
{
|
||||
if (dev == NULL) {
|
||||
LOGGER("LTC4275::ERROR: Configuration is NULL.\n");
|
||||
return;
|
||||
}
|
||||
dev->obj.alert_cb = alert_cb;
|
||||
dev->obj.cb_context = cb_context;
|
||||
}
|
||||
@@ -188,6 +205,11 @@ ReturnStatus ltc4275_get_power_good(const LTC4275_Dev *dev, ePDPowerState *val)
|
||||
/*set default to 1*/
|
||||
*val = LTC4275_POWERGOOD_NOTOK;
|
||||
|
||||
if (dev == NULL) {
|
||||
LOGGER("LTC4275::ERROR: Configuration is NULL.\n");
|
||||
return RETURN_NOTOK;
|
||||
}
|
||||
|
||||
/* Check Power Good */
|
||||
*val = (ePDPowerState)OcGpio_read(dev->cfg.pin_evt);
|
||||
if (*val == 0) {
|
||||
@@ -214,6 +236,10 @@ ReturnStatus ltc4275_get_class(const LTC4275_Dev *dev, ePDClassType *val)
|
||||
uint8_t prev_value = 1;
|
||||
uint8_t toggle = 0;
|
||||
|
||||
if (dev == NULL) {
|
||||
LOGGER("LTC4275::ERROR: Configuration is NULL.\n");
|
||||
return RETURN_NOTOK;
|
||||
}
|
||||
for (i = 0; i < 15; i++) {
|
||||
value = OcGpio_read(dev->cfg.pin_detect);
|
||||
LOGGER_DEBUG("LTC4275:INFO:: PD-nT2P activity status %d.\n", value);
|
||||
@@ -248,6 +274,10 @@ ReturnStatus ltc4275_get_class(const LTC4275_Dev *dev, ePDClassType *val)
|
||||
void ltc4275_update_status(const LTC4275_Dev *dev)
|
||||
{
|
||||
ReturnStatus ret = RETURN_NOTOK;
|
||||
if (dev == NULL) {
|
||||
LOGGER("LTC4275::ERROR: Power good configuration is NULL.\n");
|
||||
return;
|
||||
}
|
||||
ret = ltc4275_get_power_good(dev, &PDStatus_Info.pdStatus.powerGoodStatus);
|
||||
if (ret != RETURN_OK) {
|
||||
LOGGER("LTC4275::ERROR: Power good signal read failed.\n");
|
||||
|
||||
@@ -32,7 +32,7 @@ static bool _get_status(void *driver, unsigned int param_id, void *return_buf)
|
||||
default: {
|
||||
LOGGER_ERROR("LTC4275::Unknown status param %d\n", param_id);
|
||||
ret = false;
|
||||
}
|
||||
} break;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -70,6 +70,8 @@ static void _alert_handler(LTC4275_Event evt, void *context)
|
||||
|
||||
/*****************************************************************************
|
||||
*****************************************************************************/
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
static ePostCode _init(void *driver, const void *config,
|
||||
const void *alert_token)
|
||||
{
|
||||
@@ -80,6 +82,7 @@ static ePostCode _init(void *driver, const void *config,
|
||||
ltc4275_set_alert_handler(driver, _alert_handler, (void *)alert_token);
|
||||
return POST_DEV_CFG_DONE;
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
const Driver_fxnTable LTC4275_fxnTable = {
|
||||
/* Message handlers */
|
||||
|
||||
@@ -175,6 +175,9 @@ $(PATHB)Test_ocmp_ina226$(TARGET_EXTENSION): $(STD_FILES) $(TEST_OCMP_INA226_SRC
|
||||
TEST_OCMP_CAT24C04_SRC=$(OCWARE_ROOT)/src/devices/ocmp_wrappers/ocmp_cat24c04.c $(OCWARE_ROOT)/src/devices/eeprom.c $(OCWARE_ROOT)/src/drivers/GpioPCA9557.c $(OCWARE_ROOT)/src/devices/pca9557.c $(OCWARE_ROOT)/src/drivers/GpioSX1509.c $(OCWARE_ROOT)/src/devices/sx1509.c $(OCWARE_ROOT)/src/helpers/memory.c $(OCWARE_ROOT)/src/devices/i2cbus.c fake/fake_GPIO.c fake/fake_I2C.c fake/fake_ThreadedISR.c stub/stub_GateMutex.c fake/fake_SX1509_register.c fake/fake_PCA9557.c fake/fake_eeprom.c $(OCWARE_ROOT)/platform/oc-sdr/cfg/OC_CONNECT_GBC.c $(OCWARE_ROOT)/platform/oc-sdr/cfg/OC_CONNECT_SDR.c $(OCWARE_ROOT)/platform/oc-sdr/cfg/OC_CONNECT_FE.c
|
||||
$(PATHB)Test_ocmp_cat24c04$(TARGET_EXTENSION): $(STD_FILES) $(TEST_OCMP_CAT24C04_SRC) $(INC_M)
|
||||
|
||||
TEST_OCMP_LTC4275_SRC=$(OCWARE_ROOT)/src/devices/ocmp_wrappers/ocmp_ltc4275.c $(OCWARE_ROOT)/src/devices/ltc4275.c $(OCWARE_ROOT)/src/devices/i2cbus.c $(OCWARE_ROOT)/src/post/post_util.c fake/fake_GPIO.c fake/fake_I2C.c fake/fake_ThreadedISR.c fake/fake_ltc4275.c stub/stub_GateMutex.c $(OCWARE_ROOT)/platform/oc-sdr/cfg/OC_CONNECT_GBC.c
|
||||
$(PATHB)Test_ocmp_ltc4275$(TARGET_EXTENSION): $(STD_FILES) $(TEST_OCMP_LTC4275_SRC) $(INC_M)
|
||||
|
||||
$(PATHB)%$(TARGET_EXTENSION):
|
||||
$(C_COMPILER) $(CFLAGS) $(INC_DIRS) $(SYMBOLS) $^ -o $@
|
||||
$(COV_CMDS)
|
||||
|
||||
27
firmware/ec/test/fake/fake_ltc4275.c
Normal file
27
firmware/ec/test/fake/fake_ltc4275.c
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Copyright (c) 2017-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
#include "include/test_ltc4275.h"
|
||||
|
||||
uint8_t LTC4275_GpioPins[] = {
|
||||
[LTC4275_PWR_PD_NT2P] = 0x00, /* OC_EC_PWR_PD_NT2P = 64*/
|
||||
[LTC4275_PD_PWRGD_ALERT] = 0x00, /* OC_EC_PD_PWRGD_ALERT = 96 */
|
||||
};
|
||||
|
||||
uint32_t LTC4275_GpioConfig[] = {
|
||||
[LTC4275_PWR_PD_NT2P] = OCGPIO_CFG_INPUT,
|
||||
[LTC4275_PD_PWRGD_ALERT] = OCGPIO_CFG_INPUT,
|
||||
};
|
||||
|
||||
OcGpio_Port ec_io = {
|
||||
.fn_table = &FakeGpio_fnTable,
|
||||
.object_data = &(FakeGpio_Obj){},
|
||||
};
|
||||
|
||||
LTC4275_Dev *ltc4275_invalid_cfg = NULL;
|
||||
29
firmware/ec/test/include/test_ltc4275.h
Normal file
29
firmware/ec/test/include/test_ltc4275.h
Normal file
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Copyright (c) 2017-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
#ifndef _TEST_LTC4275_H
|
||||
#define _TEST_LTC4275_H
|
||||
|
||||
#include "common/inc/global/Framework.h"
|
||||
#include "common/inc/ocmp_wrappers/ocmp_ltc4275.h"
|
||||
#include "fake/fake_GPIO.h"
|
||||
#include "fake/fake_I2C.h"
|
||||
#include "fake/fake_ThreadedISR.h"
|
||||
#include "inc/devices/ltc4275.h"
|
||||
#include <string.h>
|
||||
#include <ti/sysbios/knl/Task.h>
|
||||
#include "unity.h"
|
||||
|
||||
/* ======================== Constants & variables =========================== */
|
||||
#define LTC4275_DEFAULT_EVT 8
|
||||
#define LTC4275_INVALID_PARAM_ID 2
|
||||
#define LTC4275_PD_PWRGD_ALERT 0x60
|
||||
#define LTC4275_POST_DATA 0xFF
|
||||
#define LTC4275_PWR_PD_NT2P 0x40
|
||||
#define POST_DATA_NULL 0
|
||||
#endif
|
||||
Binary file not shown.
188
firmware/ec/test/suites/Test_ocmp_ltc4275.c
Normal file
188
firmware/ec/test/suites/Test_ocmp_ltc4275.c
Normal file
@@ -0,0 +1,188 @@
|
||||
/**
|
||||
* Copyright (c) 2017-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
#include "include/test_ltc4275.h"
|
||||
|
||||
extern LTC4275_Dev gbc_pwr_pd;
|
||||
extern LTC4275_Dev *ltc4275_invalid_cfg;
|
||||
extern OcGpio_Port ec_io;
|
||||
extern tPower_PDStatus_Info PDStatus_Info;
|
||||
extern uint8_t LTC4275_GpioPins[LTC4275_PD_PWRGD_ALERT];
|
||||
extern uint32_t LTC4275_GpioConfig[LTC4275_PD_PWRGD_ALERT];
|
||||
/* ============================= Fake Functions ============================= */
|
||||
unsigned int s_task_sleep_ticks;
|
||||
|
||||
xdc_Void ti_sysbios_knl_Task_sleep__E(xdc_UInt32 nticks)
|
||||
{
|
||||
s_task_sleep_ticks += nticks;
|
||||
}
|
||||
|
||||
void test_alert(void)
|
||||
{
|
||||
}
|
||||
/* Parameters are not used as this is just used to test assigning the
|
||||
alert_handler right now.*/
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
void OCMP_GenerateAlert(const AlertData *alert_data, unsigned int alert_id,
|
||||
const void *data)
|
||||
{
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
/* ============================= Boilerplate ================================ */
|
||||
void suite_setUp(void)
|
||||
{
|
||||
FakeGpio_registerDevSimple(LTC4275_GpioPins, LTC4275_GpioConfig);
|
||||
}
|
||||
|
||||
void setUp(void)
|
||||
{
|
||||
}
|
||||
|
||||
void tearDown(void)
|
||||
{
|
||||
}
|
||||
|
||||
void suite_tearDown(void)
|
||||
{
|
||||
}
|
||||
/* ================================ Tests =================================== */
|
||||
void test_ocmp_ltc4275_init(void)
|
||||
{
|
||||
LTC4275_GpioPins[LTC4275_PD_PWRGD_ALERT] = LTC4275_POWERGOOD;
|
||||
LTC4275_GpioPins[LTC4275_PWR_PD_NT2P] = LTC4275_CLASSTYPE_1;
|
||||
LTC4275_GpioConfig[LTC4275_PD_PWRGD_ALERT] = OCGPIO_CFG_INPUT;
|
||||
AlertData alert_data = {
|
||||
.subsystem = 1,
|
||||
.componentId = 6,
|
||||
.deviceId = 0,
|
||||
};
|
||||
|
||||
TEST_ASSERT_EQUAL(POST_DEV_CFG_DONE,
|
||||
LTC4275_fxnTable.cb_init(&gbc_pwr_pd, NULL, &alert_data));
|
||||
TEST_ASSERT_EQUAL(LTC4275_POWERGOOD,
|
||||
PDStatus_Info.pdStatus.powerGoodStatus);
|
||||
TEST_ASSERT_EQUAL(LTC4275_CLASSTYPE_2, PDStatus_Info.pdStatus.classStatus);
|
||||
TEST_ASSERT_EQUAL(OCGPIO_CFG_INPUT | OCGPIO_CFG_INT_BOTH_EDGES,
|
||||
LTC4275_GpioConfig[LTC4275_PD_PWRGD_ALERT]);
|
||||
|
||||
/* Invalid config */
|
||||
TEST_ASSERT_EQUAL(
|
||||
POST_DEV_CFG_FAIL,
|
||||
LTC4275_fxnTable.cb_init(ltc4275_invalid_cfg, NULL, &alert_data));
|
||||
}
|
||||
|
||||
void test_ocmp_ltc4275_probe(void)
|
||||
{
|
||||
POSTData postData;
|
||||
LTC4275_GpioPins[LTC4275_PD_PWRGD_ALERT] = LTC4275_POWERGOOD_NOTOK;
|
||||
LTC4275_GpioConfig[LTC4275_PD_PWRGD_ALERT] = OCGPIO_CFG_OUTPUT;
|
||||
LTC4275_GpioConfig[LTC4275_PWR_PD_NT2P] = OCGPIO_CFG_OUTPUT;
|
||||
TEST_ASSERT_EQUAL(POST_DEV_MISSING,
|
||||
LTC4275_fxnTable.cb_probe(&gbc_pwr_pd, &postData));
|
||||
TEST_ASSERT_EQUAL(LTC4275_CLASSTYPE_UNKOWN,
|
||||
PDStatus_Info.pdStatus.classStatus);
|
||||
TEST_ASSERT_EQUAL(LTC4275_STATE_NOTOK, PDStatus_Info.state);
|
||||
TEST_ASSERT_EQUAL(LTC4275_DISCONNECT_ALERT, PDStatus_Info.pdalert);
|
||||
TEST_ASSERT_EQUAL(LTC4275_POWERGOOD_NOTOK,
|
||||
PDStatus_Info.pdStatus.powerGoodStatus);
|
||||
TEST_ASSERT_EQUAL(OCGPIO_CFG_INPUT,
|
||||
LTC4275_GpioConfig[LTC4275_PD_PWRGD_ALERT]);
|
||||
TEST_ASSERT_EQUAL(OCGPIO_CFG_INPUT,
|
||||
LTC4275_GpioConfig[LTC4275_PWR_PD_NT2P]);
|
||||
TEST_ASSERT_EQUAL_HEX8(LTC4275_POST_DATA, postData.i2cBus);
|
||||
TEST_ASSERT_EQUAL_HEX8(LTC4275_POST_DATA, postData.devAddr);
|
||||
TEST_ASSERT_EQUAL_HEX8(LTC4275_POST_DATA, postData.manId);
|
||||
TEST_ASSERT_EQUAL_HEX8(LTC4275_POST_DATA, postData.devId);
|
||||
|
||||
postData.i2cBus = POST_DATA_NULL;
|
||||
postData.devAddr = POST_DATA_NULL;
|
||||
postData.manId = POST_DATA_NULL;
|
||||
postData.devId = POST_DATA_NULL;
|
||||
LTC4275_GpioPins[LTC4275_PD_PWRGD_ALERT] = LTC4275_POWERGOOD;
|
||||
LTC4275_GpioConfig[LTC4275_PD_PWRGD_ALERT] = OCGPIO_CFG_OUTPUT;
|
||||
LTC4275_GpioConfig[LTC4275_PWR_PD_NT2P] = OCGPIO_CFG_OUTPUT;
|
||||
TEST_ASSERT_EQUAL(POST_DEV_FOUND,
|
||||
LTC4275_fxnTable.cb_probe(&gbc_pwr_pd, &postData));
|
||||
TEST_ASSERT_EQUAL(LTC4275_CLASSTYPE_UNKOWN,
|
||||
PDStatus_Info.pdStatus.classStatus);
|
||||
TEST_ASSERT_EQUAL(LTC4275_STATE_NOTOK, PDStatus_Info.state);
|
||||
TEST_ASSERT_EQUAL(LTC4275_DISCONNECT_ALERT, PDStatus_Info.pdalert);
|
||||
TEST_ASSERT_EQUAL(LTC4275_POWERGOOD,
|
||||
PDStatus_Info.pdStatus.powerGoodStatus);
|
||||
TEST_ASSERT_EQUAL(OCGPIO_CFG_INPUT,
|
||||
LTC4275_GpioConfig[LTC4275_PD_PWRGD_ALERT]);
|
||||
TEST_ASSERT_EQUAL(OCGPIO_CFG_INPUT,
|
||||
LTC4275_GpioConfig[LTC4275_PWR_PD_NT2P]);
|
||||
TEST_ASSERT_EQUAL_HEX8(LTC4275_POST_DATA, postData.i2cBus);
|
||||
TEST_ASSERT_EQUAL_HEX8(LTC4275_POST_DATA, postData.devAddr);
|
||||
TEST_ASSERT_EQUAL_HEX8(LTC4275_POST_DATA, postData.manId);
|
||||
TEST_ASSERT_EQUAL_HEX8(LTC4275_POST_DATA, postData.devId);
|
||||
|
||||
/* Invalid config */
|
||||
postData.i2cBus = POST_DATA_NULL;
|
||||
postData.devAddr = POST_DATA_NULL;
|
||||
postData.manId = POST_DATA_NULL;
|
||||
postData.devId = POST_DATA_NULL;
|
||||
TEST_ASSERT_EQUAL(POST_DEV_MISSING, LTC4275_fxnTable.cb_probe(
|
||||
ltc4275_invalid_cfg, &postData));
|
||||
TEST_ASSERT_EQUAL_HEX8(POST_DATA_NULL, postData.i2cBus);
|
||||
TEST_ASSERT_EQUAL_HEX8(POST_DATA_NULL, postData.devAddr);
|
||||
TEST_ASSERT_EQUAL_HEX8(POST_DATA_NULL, postData.manId);
|
||||
TEST_ASSERT_EQUAL_HEX8(POST_DATA_NULL, postData.devId);
|
||||
}
|
||||
|
||||
void test_ocmp_ltc4275_get_status(void)
|
||||
{
|
||||
ePDPowerState val = 0;
|
||||
LTC4275_GpioPins[LTC4275_PD_PWRGD_ALERT] = LTC4275_POWERGOOD;
|
||||
TEST_ASSERT_EQUAL(true, LTC4275_fxnTable.cb_get_status(
|
||||
&gbc_pwr_pd, LTC4275_STATUS_POWERGOOD, &val));
|
||||
TEST_ASSERT_EQUAL(LTC4275_POWERGOOD, val);
|
||||
|
||||
val = 0;
|
||||
LTC4275_GpioPins[LTC4275_PWR_PD_NT2P] = LTC4275_CLASSTYPE_1;
|
||||
TEST_ASSERT_EQUAL(true, LTC4275_fxnTable.cb_get_status(
|
||||
&gbc_pwr_pd, LTC4275_STATUS_CLASS, &val));
|
||||
TEST_ASSERT_EQUAL(LTC4275_CLASSTYPE_2, val);
|
||||
|
||||
/*Invalid ParamID*/
|
||||
LTC4275_GpioPins[LTC4275_PD_PWRGD_ALERT] = LTC4275_POWERGOOD;
|
||||
TEST_ASSERT_EQUAL(false, LTC4275_fxnTable.cb_get_status(
|
||||
&gbc_pwr_pd, LTC4275_INVALID_PARAM_ID, &val));
|
||||
|
||||
/* Invalid config */
|
||||
LTC4275_GpioPins[LTC4275_PWR_PD_NT2P] = LTC4275_CLASSTYPE_2;
|
||||
TEST_ASSERT_EQUAL(
|
||||
false, LTC4275_fxnTable.cb_get_status(ltc4275_invalid_cfg,
|
||||
LTC4275_STATUS_CLASS, &val));
|
||||
}
|
||||
|
||||
void test_ocmp_ltc4275_alert_handler(void)
|
||||
{
|
||||
AlertData alert_data = {
|
||||
.subsystem = 1,
|
||||
.componentId = 6,
|
||||
.deviceId = 0,
|
||||
};
|
||||
AlertData *alert_data_cp = malloc(sizeof(AlertData));
|
||||
*alert_data_cp = alert_data;
|
||||
TEST_ASSERT_EQUAL(POST_DEV_CFG_DONE, LTC4275_fxnTable.cb_init(
|
||||
&gbc_pwr_pd, NULL, alert_data_cp));
|
||||
|
||||
gbc_pwr_pd.obj.alert_cb(LTC4275_CONNECT_EVT, alert_data_cp);
|
||||
gbc_pwr_pd.obj.alert_cb(LTC4275_DISCONNECT_EVT, alert_data_cp);
|
||||
gbc_pwr_pd.obj.alert_cb(LTC4275_INCOMPATIBLE_EVT, alert_data_cp);
|
||||
|
||||
/* Test for memory check */
|
||||
gbc_pwr_pd.obj.alert_cb(LTC4275_CONNECT_EVT, NULL);
|
||||
|
||||
/* Default case test */
|
||||
gbc_pwr_pd.obj.alert_cb(LTC4275_DEFAULT_EVT, alert_data_cp);
|
||||
}
|
||||
Reference in New Issue
Block a user