mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-21 15:25:36 +03:00
Increased vbat precision
This commit is contained in:
parent
24344405fb
commit
9d5fb85474
30 changed files with 124 additions and 120 deletions
|
@ -62,7 +62,7 @@ int16_t gyroGetTemperature(void) {
|
|||
return gyroTemperature;
|
||||
}
|
||||
|
||||
static uint16_t vbat = 100;
|
||||
static uint16_t vbat = 1000;
|
||||
uint16_t getVbat(void)
|
||||
{
|
||||
return vbat;
|
||||
|
@ -128,7 +128,7 @@ typedef struct serialPortStub_s {
|
|||
} serialPortStub_t;
|
||||
|
||||
|
||||
static uint16_t testBatteryVoltage = 100;
|
||||
static uint16_t testBatteryVoltage = 1000;
|
||||
uint16_t getBatteryVoltage(void)
|
||||
{
|
||||
return testBatteryVoltage;
|
||||
|
@ -469,13 +469,13 @@ TEST_F(IbusTelemteryProtocolUnitTest, Test_IbusRespondToGetMeasurementVbattCellV
|
|||
//Given ibus command: Sensor at address 1, please send your measurement
|
||||
//then we respond with: I'm reading 0.1 volts
|
||||
testBatteryCellCount =3;
|
||||
testBatteryVoltage = 30;
|
||||
testBatteryVoltage = 300;
|
||||
checkResponseToCommand("\x04\xA1\x5a\xff", 4, "\x06\xA1\x64\x00\xf4\xFe", 6);
|
||||
|
||||
//Given ibus command: Sensor at address 1, please send your measurement
|
||||
//then we respond with: I'm reading 0.1 volts
|
||||
testBatteryCellCount =1;
|
||||
testBatteryVoltage = 10;
|
||||
testBatteryVoltage = 100;
|
||||
checkResponseToCommand("\x04\xA1\x5a\xff", 4, "\x06\xA1\x64\x00\xf4\xFe", 6);
|
||||
}
|
||||
|
||||
|
@ -486,13 +486,13 @@ TEST_F(IbusTelemteryProtocolUnitTest, Test_IbusRespondToGetMeasurementVbattPackV
|
|||
//Given ibus command: Sensor at address 1, please send your measurement
|
||||
//then we respond with: I'm reading 0.1 volts
|
||||
testBatteryCellCount =3;
|
||||
testBatteryVoltage = 10;
|
||||
testBatteryVoltage = 100;
|
||||
checkResponseToCommand("\x04\xA1\x5a\xff", 4, "\x06\xA1\x64\x00\xf4\xFe", 6);
|
||||
|
||||
//Given ibus command: Sensor at address 1, please send your measurement
|
||||
//then we respond with: I'm reading 0.1 volts
|
||||
testBatteryCellCount =1;
|
||||
testBatteryVoltage = 10;
|
||||
testBatteryVoltage = 100;
|
||||
checkResponseToCommand("\x04\xA1\x5a\xff", 4, "\x06\xA1\x64\x00\xf4\xFe", 6);
|
||||
}
|
||||
|
||||
|
@ -580,7 +580,7 @@ TEST_F(IbusTelemteryProtocolUnitTestDaisyChained, Test_IbusRespondToGetMeasureme
|
|||
//Given ibus command: Sensor at address 3, please send your measurement
|
||||
//then we respond with: I'm reading 0.1 volts
|
||||
testBatteryCellCount = 1;
|
||||
testBatteryVoltage = 10;
|
||||
testBatteryVoltage = 100;
|
||||
checkResponseToCommand("\x04\xA3\x58\xff", 4, "\x06\xA3\x64\x00\xf2\xfe", 6);
|
||||
|
||||
//Given ibus command: Sensor at address 4, please send your measurement
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue