Fix indentation oopsie

This commit is contained in:
Talie5in 2024-06-06 23:57:44 +09:30
parent a5c96a29d5
commit d09da96780

View File

@ -25,11 +25,12 @@
void setBluetoothEnable(bool enable)
{
#ifndef MESHTASTIC_EXCLUDE_WIFI
if (!isWifiAvailable() && config.bluetooth.enabled == true) {
if (!isWifiAvailable() && config.bluetooth.enabled == true)
#endif
#ifdef MESHTASTIC_EXCLUDE_WIFI
if (config.bluetooth.enabled == true) {
if (config.bluetooth.enabled == true)
#endif
{
if (!nimbleBluetooth) {
nimbleBluetooth = new NimbleBluetooth();
}
@ -40,22 +41,22 @@ void setBluetoothEnable(bool enable)
// BLE advertising automatically stops when MCU enters light-sleep(?)
// For deep-sleep, shutdown hardware with nimbleBluetooth->deinit(). Requires reboot to reverse
}
}
}
#else
void setBluetoothEnable(bool enable) {}
void updateBatteryLevel(uint8_t level) {}
#endif
void getMacAddr(uint8_t * dmac)
{
void getMacAddr(uint8_t *dmac)
{
assert(esp_efuse_mac_get_default(dmac) == ESP_OK);
}
}
#ifdef HAS_32768HZ
#define CALIBRATE_ONE(cali_clk) calibrate_one(cali_clk, #cali_clk)
static uint32_t calibrate_one(rtc_cal_sel_t cal_clk, const char *name)
{
static uint32_t calibrate_one(rtc_cal_sel_t cal_clk, const char *name)
{
const uint32_t cal_count = 1000;
// const float factor = (1 << 19) * 1000.0f; unused var?
uint32_t cali_val;
@ -63,10 +64,10 @@ void updateBatteryLevel(uint8_t level) {}
cali_val = rtc_clk_cal(cal_clk, cal_count);
}
return cali_val;
}
}
void enableSlowCLK()
{
void enableSlowCLK()
{
rtc_clk_32k_enable(true);
CALIBRATE_ONE(RTC_CAL_RTC_MUX);
@ -86,11 +87,11 @@ void updateBatteryLevel(uint8_t level) {}
LOG_WARN("Failed to switch 32K XTAL RTC source to 32.768Khz !!! \n");
return;
}
}
}
#endif
void esp32Setup()
{
void esp32Setup()
{
uint32_t seed = esp_random();
LOG_DEBUG("Setting random seed %u\n", seed);
@ -143,7 +144,7 @@ void updateBatteryLevel(uint8_t level) {}
#ifdef HAS_32768HZ
enableSlowCLK();
#endif
}
}
#if 0
// Turn off for now
@ -165,17 +166,17 @@ uint32_t axpDebugRead()
Periodic axpDebugOutput(axpDebugRead);
#endif
/// loop code specific to ESP32 targets
void esp32Loop()
{
/// loop code specific to ESP32 targets
void esp32Loop()
{
esp_task_wdt_reset(); // service our app level watchdog
// for debug printing
// radio.radioIf.canSleep();
}
}
void cpuDeepSleep(uint32_t msecToWake)
{
void cpuDeepSleep(uint32_t msecToWake)
{
/*
Some ESP32 IOs have internal pullups or pulldowns, which are enabled by default.
If an external circuit drives this pin in deep sleep mode, current consumption may
@ -237,4 +238,4 @@ Periodic axpDebugOutput(axpDebugRead);
esp_sleep_enable_timer_wakeup(msecToWake * 1000ULL); // call expects usecs
esp_deep_sleep_start(); // TBD mA sleep current (battery)
}
}