Fork of Tangara with customizations
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
tangara-fw/src/drivers/test/test_battery.cpp

18 lines
393 B

#include <cstdint>
#include "battery.hpp"
#include "catch2/catch.hpp"
namespace drivers {
TEST_CASE("battery measurement", "[integration]") {
REQUIRE(drivers::init_adc() == ESP_OK);
SECTION("voltage is within range") {
uint32_t voltage = read_battery_voltage();
REQUIRE(voltage <= 2200); // Plugged in, no battery.
REQUIRE(voltage >= 1000);
}
}
} // namespace drivers