mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-16 07:42:37 +00:00
Log levels refactoring
This commit is contained in:
@@ -60,7 +60,7 @@ void setCPUFast(bool on)
|
||||
* all WiFi use cases.
|
||||
* (Added: Dec 23, 2021 by Jm Casler)
|
||||
*/
|
||||
DEBUG_MSG("Setting CPU to 240mhz because WiFi is in use.\n");
|
||||
LOG_DEBUG("Setting CPU to 240mhz because WiFi is in use.\n");
|
||||
setCpuFrequencyMhz(240);
|
||||
return;
|
||||
}
|
||||
@@ -90,7 +90,7 @@ void setLed(bool ledOn)
|
||||
|
||||
void setGPSPower(bool on)
|
||||
{
|
||||
DEBUG_MSG("Setting GPS power=%d\n", on);
|
||||
LOG_DEBUG("Setting GPS power=%d\n", on);
|
||||
|
||||
#ifdef HAS_PMU
|
||||
if (pmu_found && PMU){
|
||||
@@ -136,7 +136,7 @@ void initDeepSleep()
|
||||
if (wakeCause == ESP_SLEEP_WAKEUP_TIMER)
|
||||
reason = "timeout";
|
||||
|
||||
DEBUG_MSG("booted, wake cause %d (boot count %d), reset_reason=%s\n", wakeCause, bootCount, reason);
|
||||
LOG_DEBUG("booted, wake cause %d (boot count %d), reset_reason=%s\n", wakeCause, bootCount, reason);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -174,13 +174,13 @@ void doGPSpowersave(bool on)
|
||||
#ifdef HAS_PMU
|
||||
if (on)
|
||||
{
|
||||
DEBUG_MSG("Turning GPS back on\n");
|
||||
LOG_DEBUG("Turning GPS back on\n");
|
||||
gps->forceWake(1);
|
||||
setGPSPower(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_MSG("Turning off GPS chip\n");
|
||||
LOG_DEBUG("Turning off GPS chip\n");
|
||||
notifyGPSSleep.notifyObservers(NULL);
|
||||
setGPSPower(0);
|
||||
}
|
||||
@@ -188,12 +188,12 @@ void doGPSpowersave(bool on)
|
||||
#ifdef PIN_GPS_WAKE
|
||||
if (on)
|
||||
{
|
||||
DEBUG_MSG("Waking GPS");
|
||||
LOG_DEBUG("Waking GPS");
|
||||
gps->forceWake(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_MSG("GPS entering sleep");
|
||||
LOG_DEBUG("GPS entering sleep");
|
||||
notifyGPSSleep.notifyObservers(NULL);
|
||||
}
|
||||
#endif
|
||||
@@ -201,7 +201,7 @@ void doGPSpowersave(bool on)
|
||||
|
||||
void doDeepSleep(uint64_t msecToWake)
|
||||
{
|
||||
DEBUG_MSG("Entering deep sleep for %lu seconds\n", msecToWake / 1000);
|
||||
LOG_DEBUG("Entering deep sleep for %lu seconds\n", msecToWake / 1000);
|
||||
|
||||
// not using wifi yet, but once we are this is needed to shutoff the radio hw
|
||||
// esp_wifi_stop();
|
||||
@@ -258,7 +258,7 @@ void doDeepSleep(uint64_t msecToWake)
|
||||
*/
|
||||
esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more reasonable default
|
||||
{
|
||||
// DEBUG_MSG("Enter light sleep\n");
|
||||
// LOG_DEBUG("Enter light sleep\n");
|
||||
|
||||
waitEnterSleep();
|
||||
|
||||
@@ -310,7 +310,7 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r
|
||||
esp_sleep_wakeup_cause_t cause = esp_sleep_get_wakeup_cause();
|
||||
#ifdef BUTTON_PIN
|
||||
if (cause == ESP_SLEEP_WAKEUP_GPIO)
|
||||
DEBUG_MSG("Exit light sleep gpio: btn=%d\n", !digitalRead(BUTTON_PIN));
|
||||
LOG_DEBUG("Exit light sleep gpio: btn=%d\n", !digitalRead(BUTTON_PIN));
|
||||
#endif
|
||||
|
||||
return cause;
|
||||
@@ -340,6 +340,6 @@ void enableModemSleep()
|
||||
esp32_config.min_freq_mhz = 20; // 10Mhz is minimum recommended
|
||||
esp32_config.light_sleep_enable = false;
|
||||
int rv = esp_pm_configure(&esp32_config);
|
||||
DEBUG_MSG("Sleep request result %x\n", rv);
|
||||
LOG_DEBUG("Sleep request result %x\n", rv);
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user