mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-18 15:25:05 +00:00
Fixes for Test_ocmp_adt7481.c warnings.
This commit is contained in:
@@ -20,22 +20,17 @@
|
|||||||
|
|
||||||
extern const Component sys_schema[];
|
extern const Component sys_schema[];
|
||||||
|
|
||||||
static OcGpio_Port s_fake_io_port = {
|
static I2C_Dev I2C_DEV = {
|
||||||
.fn_table = &FakeGpio_fnTable,
|
|
||||||
.object_data = &(FakeGpio_Obj){},
|
|
||||||
};
|
|
||||||
|
|
||||||
static const I2C_Dev I2C_DEV = {
|
|
||||||
.bus = 7,
|
.bus = 7,
|
||||||
.slave_addr = 0x2F,
|
.slave_addr = 0x2F,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const I2C_Dev s_invalid_dev = {
|
static I2C_Dev s_invalid_dev = {
|
||||||
.bus = 7,
|
.bus = 7,
|
||||||
.slave_addr = 0x52,
|
.slave_addr = 0x52,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const I2C_Dev s_invalid_bus = {
|
static I2C_Dev s_invalid_bus = {
|
||||||
.bus = 3,
|
.bus = 3,
|
||||||
.slave_addr = 0x2F,
|
.slave_addr = 0x2F,
|
||||||
};
|
};
|
||||||
@@ -75,40 +70,24 @@ static uint8_t ADT7481_regs[] = {
|
|||||||
[0x0F] = 0x00, /* One-Shot W*/
|
[0x0F] = 0x00, /* One-Shot W*/
|
||||||
[0x10] = 0x00, /* Remote 1 Temperature Value Low Byte R*/
|
[0x10] = 0x00, /* Remote 1 Temperature Value Low Byte R*/
|
||||||
[0x11] = 0x00, /* Remote 1 Temperature Offset High Byte R*/
|
[0x11] = 0x00, /* Remote 1 Temperature Offset High Byte R*/
|
||||||
[0x11] = 0x00, /* Remote 1 Temperature Offset High Byte W*/
|
|
||||||
[0x12] = 0x00, /* Remote 1 Temperature Offset Low Byte R*/
|
[0x12] = 0x00, /* Remote 1 Temperature Offset Low Byte R*/
|
||||||
[0x12] = 0x00, /* Remote 1 Temperature Offset Low Byte W*/
|
|
||||||
[0x13] = 0x00, /* Remote 1 Temp High Limit Low Byte R*/
|
[0x13] = 0x00, /* Remote 1 Temp High Limit Low Byte R*/
|
||||||
[0x13] = 0x00, /* Remote 1 Temp High Limit Low Byte W*/
|
|
||||||
[0x14] = 0x00, /* Remote 1 Temp Low Limit Low Byte R*/
|
[0x14] = 0x00, /* Remote 1 Temp Low Limit Low Byte R*/
|
||||||
[0x14] = 0x00, /* Remote 1 Temp Low Limit Low Byte W*/
|
|
||||||
[0x19] = 0x00, /* Remote 1 THERM Limit R */
|
[0x19] = 0x00, /* Remote 1 THERM Limit R */
|
||||||
[0x19] = 0x00, /* Remote 1 THERM Limit W */
|
|
||||||
[0x20] = 0x00, /* Local THERM Limit R*/
|
[0x20] = 0x00, /* Local THERM Limit R*/
|
||||||
[0x20] = 0x00, /* Local THERM Limit W*/
|
|
||||||
[0x21] = 0x00, /* THERM Hysteresis R*/
|
[0x21] = 0x00, /* THERM Hysteresis R*/
|
||||||
[0x21] = 0x00, /* THERM Hysteresis W*/
|
|
||||||
[0x22] = 0x00, /* Consecutive ALERT R*/
|
[0x22] = 0x00, /* Consecutive ALERT R*/
|
||||||
[0x22] = 0x00, /* Consecutive ALERT W*/
|
|
||||||
[0x23] = 0x00, /* Status Register 2 R */
|
[0x23] = 0x00, /* Status Register 2 R */
|
||||||
[0x24] = 0x00, /* Configuration 2 Register R*/
|
[0x24] = 0x00, /* Configuration 2 Register R*/
|
||||||
[0x24] = 0x00, /* Configuration 2 Register W*/
|
|
||||||
[0x30] = 0x00, /* Remote 2 Temperature Value High Byte R */
|
[0x30] = 0x00, /* Remote 2 Temperature Value High Byte R */
|
||||||
[0x31] = 0x00, /* Remote 2 Temp High Limit High Byte R*/
|
[0x31] = 0x00, /* Remote 2 Temp High Limit High Byte R*/
|
||||||
[0x31] = 0x00, /* Remote 2 Temp High Limit High Byte W*/
|
|
||||||
[0x32] = 0x00, /* Remote 2 Temp Low Limit High Byte R*/
|
[0x32] = 0x00, /* Remote 2 Temp Low Limit High Byte R*/
|
||||||
[0x32] = 0x00, /* Remote 2 Temp Low Limit High Byte W*/
|
|
||||||
[0x33] = 0x00, /* Remote 2 Temperature Value Low Byte R*/
|
[0x33] = 0x00, /* Remote 2 Temperature Value Low Byte R*/
|
||||||
[0x34] = 0x00, /* Remote 2 Temperature Offset High Byte R*/
|
[0x34] = 0x00, /* Remote 2 Temperature Offset High Byte R*/
|
||||||
[0x34] = 0x00, /* Remote 2 Temperature Offset High Byte W*/
|
|
||||||
[0x35] = 0x00, /* Remote 2 Temperature Offset Low Byte R*/
|
[0x35] = 0x00, /* Remote 2 Temperature Offset Low Byte R*/
|
||||||
[0x35] = 0x00, /* Remote 2 Temperature Offset Low Byte W*/
|
|
||||||
[0x36] = 0x00, /* Remote 2 Temp High Limit Low Byte R */
|
[0x36] = 0x00, /* Remote 2 Temp High Limit Low Byte R */
|
||||||
[0x36] = 0x00, /* Remote 2 Temp High Limit Low Byte W */
|
|
||||||
[0x37] = 0x00, /* Remote 2 Temp Low Limit Low Byte R*/
|
[0x37] = 0x00, /* Remote 2 Temp Low Limit Low Byte R*/
|
||||||
[0x37] = 0x00, /* Remote 2 Temp Low Limit Low Byte W*/
|
|
||||||
[0x39] = 0x00, /* Remote 2 THERM Limit R*/
|
[0x39] = 0x00, /* Remote 2 THERM Limit R*/
|
||||||
[0x39] = 0x00, /* Remote 2 THERM Limit W*/
|
|
||||||
[0x3D] = 0x00, /* Device ID R */
|
[0x3D] = 0x00, /* Device ID R */
|
||||||
[0x3E] = 0x00, /* Manufacturer ID R */
|
[0x3E] = 0x00, /* Manufacturer ID R */
|
||||||
};
|
};
|
||||||
@@ -153,7 +132,7 @@ void suite_tearDown(void)
|
|||||||
|
|
||||||
/* ================================ Tests =================================== */
|
/* ================================ Tests =================================== */
|
||||||
|
|
||||||
void test_probe()
|
void test_probe(void)
|
||||||
{
|
{
|
||||||
POSTData postData;
|
POSTData postData;
|
||||||
|
|
||||||
@@ -177,7 +156,7 @@ void test_probe()
|
|||||||
ADT7481_fxnTable.cb_probe(&I2C_DEV, &postData));
|
ADT7481_fxnTable.cb_probe(&I2C_DEV, &postData));
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_get_status()
|
void test_get_status(void)
|
||||||
{
|
{
|
||||||
uint8_t tempvalue = 0xff;
|
uint8_t tempvalue = 0xff;
|
||||||
ADT7481_regs[0x30] = 0x73;
|
ADT7481_regs[0x30] = 0x73;
|
||||||
@@ -198,7 +177,7 @@ void test_get_status()
|
|||||||
40, &tempvalue));
|
40, &tempvalue));
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_set_config()
|
void test_set_config(void)
|
||||||
{
|
{
|
||||||
int8_t limit = 0x62;
|
int8_t limit = 0x62;
|
||||||
|
|
||||||
@@ -225,7 +204,7 @@ void test_set_config()
|
|||||||
40, &limit));
|
40, &limit));
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_get_config()
|
void test_get_config(void)
|
||||||
{
|
{
|
||||||
int8_t limit = 0xFF;
|
int8_t limit = 0xFF;
|
||||||
ADT7481_regs[0x31] = 0xA2;
|
ADT7481_regs[0x31] = 0xA2;
|
||||||
@@ -254,7 +233,7 @@ void test_get_config()
|
|||||||
40, &limit));
|
40, &limit));
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_init()
|
void test_init(void)
|
||||||
{
|
{
|
||||||
const ADT7481_Config fact_sdr_fpga_adt7481_cfg = {
|
const ADT7481_Config fact_sdr_fpga_adt7481_cfg = {
|
||||||
.lowlimit = -20,
|
.lowlimit = -20,
|
||||||
|
|||||||
Reference in New Issue
Block a user