Files
ESP32Marauder/esp32_marauder/TemperatureInterface.cpp
tracedgod f3349766ed Add XIAO-ESP32-S3 Board Support (WIP)
looking to cleanup certain things with config to allow easier customization of the build when used with the flipper zero
2023-06-10 00:22:19 -04:00

37 lines
777 B
C++

#include "TemperatureInterface.h"
#ifdef __cplusplus
extern "C" {
#endif
uint8_t temprature_sens_read();
#ifdef __cplusplus
}
#endif
uint8_t temprature_sens_read();
TemperatureInterface::TemperatureInterface() {
}
void TemperatureInterface::RunSetup() {
this->initTime = millis();
this->current_temp = this->getCurrentTemp();
}
uint8_t TemperatureInterface::getCurrentTemp() {
#ifndef MARAUDER_FLIPPER || XIAO_ESP32_S3
return ((temprature_sens_read() - 32) / 1.8);
#endif
return 0;
}
void TemperatureInterface::main(uint32_t currentTime) {
if (currentTime != 0) {
if (currentTime - initTime >= 100) {
//Serial.println("Checking Battery Level");
this->initTime = millis();
this->current_temp = this->getCurrentTemp();
}
}
}