mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-27 10:21:40 +00:00
Fix nagging bool linter warnings (#1491)
This commit is contained in:
parent
3df5ec0b11
commit
4ab831c103
@ -45,9 +45,8 @@ SerialConsole::SerialConsole() : StreamAPI(&Port), RedirectablePrint(&Port)
|
|||||||
bool SerialConsole::checkIsConnected()
|
bool SerialConsole::checkIsConnected()
|
||||||
{
|
{
|
||||||
uint32_t now = millis();
|
uint32_t now = millis();
|
||||||
return (now - lastContactMsec) < config.power.phone_timeout_secs
|
uint32_t timeout = (config.power.phone_timeout_secs > 0 ? config.power.phone_timeout_secs : default_phone_timeout_secs )* 1000UL;
|
||||||
? config.power.phone_timeout_secs
|
return (now - lastContactMsec) < timeout;
|
||||||
: default_phone_timeout_secs * 1000UL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -17,14 +17,6 @@ AdminModule *adminModule;
|
|||||||
/// a change.
|
/// a change.
|
||||||
static const char *secretReserved = "sekrit";
|
static const char *secretReserved = "sekrit";
|
||||||
|
|
||||||
/// If buf is !empty, change it to secret
|
|
||||||
static void hideSecret(char *buf)
|
|
||||||
{
|
|
||||||
if (*buf) {
|
|
||||||
strcpy(buf, secretReserved);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// If buf is the reserved secret word, replace the buffer with currentVal
|
/// If buf is the reserved secret word, replace the buffer with currentVal
|
||||||
static void writeSecret(char *buf, const char *currentVal)
|
static void writeSecret(char *buf, const char *currentVal)
|
||||||
{
|
{
|
||||||
|
@ -9,7 +9,8 @@ DHTSensor::DHTSensor() : TelemetrySensor{} {}
|
|||||||
|
|
||||||
int32_t DHTSensor::runOnce()
|
int32_t DHTSensor::runOnce()
|
||||||
{
|
{
|
||||||
if (TelemetrySensorType_DHT11 || TelemetrySensorType_DHT12) {
|
if (moduleConfig.telemetry.environment_sensor_type == TelemetrySensorType_DHT11 ||
|
||||||
|
moduleConfig.telemetry.environment_sensor_type == TelemetrySensorType_DHT12) {
|
||||||
dht = new DHT(moduleConfig.telemetry.environment_sensor_pin, DHT11);
|
dht = new DHT(moduleConfig.telemetry.environment_sensor_pin, DHT11);
|
||||||
} else {
|
} else {
|
||||||
dht = new DHT(moduleConfig.telemetry.environment_sensor_pin, DHT22);
|
dht = new DHT(moduleConfig.telemetry.environment_sensor_pin, DHT22);
|
||||||
|
Loading…
Reference in New Issue
Block a user