mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-30 19:33:45 +08:00
panda_state_thread: replace stoi with atoi (#21981)
old-commit-hash: 3b0b20ba4bab2a32d28145000a4f260ad38ea402
This commit is contained in:
@@ -352,8 +352,8 @@ void panda_state_thread(bool spoofing_started) {
|
|||||||
|
|
||||||
if (Hardware::TICI()) {
|
if (Hardware::TICI()) {
|
||||||
double read_time = millis_since_boot();
|
double read_time = millis_since_boot();
|
||||||
ps.setVoltage(std::stoi(util::read_file("/sys/class/hwmon/hwmon1/in1_input")));
|
ps.setVoltage(std::atoi(util::read_file("/sys/class/hwmon/hwmon1/in1_input").c_str()));
|
||||||
ps.setCurrent(std::stoi(util::read_file("/sys/class/hwmon/hwmon1/curr1_input")));
|
ps.setCurrent(std::atoi(util::read_file("/sys/class/hwmon/hwmon1/curr1_input").c_str()));
|
||||||
read_time = millis_since_boot() - read_time;
|
read_time = millis_since_boot() - read_time;
|
||||||
if (read_time > 50) {
|
if (read_time > 50) {
|
||||||
LOGW("reading hwmon took %lfms", read_time);
|
LOGW("reading hwmon took %lfms", read_time);
|
||||||
|
|||||||
Reference in New Issue
Block a user