mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-14 09:02:14 +00:00
Fix indentation oopsie
This commit is contained in:
parent
a5c96a29d5
commit
d09da96780
@ -25,11 +25,12 @@
|
|||||||
void setBluetoothEnable(bool enable)
|
void setBluetoothEnable(bool enable)
|
||||||
{
|
{
|
||||||
#ifndef MESHTASTIC_EXCLUDE_WIFI
|
#ifndef MESHTASTIC_EXCLUDE_WIFI
|
||||||
if (!isWifiAvailable() && config.bluetooth.enabled == true) {
|
if (!isWifiAvailable() && config.bluetooth.enabled == true)
|
||||||
#endif
|
#endif
|
||||||
#ifdef MESHTASTIC_EXCLUDE_WIFI
|
#ifdef MESHTASTIC_EXCLUDE_WIFI
|
||||||
if (config.bluetooth.enabled == true) {
|
if (config.bluetooth.enabled == true)
|
||||||
#endif
|
#endif
|
||||||
|
{
|
||||||
if (!nimbleBluetooth) {
|
if (!nimbleBluetooth) {
|
||||||
nimbleBluetooth = new NimbleBluetooth();
|
nimbleBluetooth = new NimbleBluetooth();
|
||||||
}
|
}
|
||||||
@ -40,22 +41,22 @@ void setBluetoothEnable(bool enable)
|
|||||||
// BLE advertising automatically stops when MCU enters light-sleep(?)
|
// BLE advertising automatically stops when MCU enters light-sleep(?)
|
||||||
// For deep-sleep, shutdown hardware with nimbleBluetooth->deinit(). Requires reboot to reverse
|
// For deep-sleep, shutdown hardware with nimbleBluetooth->deinit(). Requires reboot to reverse
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
void setBluetoothEnable(bool enable) {}
|
void setBluetoothEnable(bool enable) {}
|
||||||
void updateBatteryLevel(uint8_t level) {}
|
void updateBatteryLevel(uint8_t level) {}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void getMacAddr(uint8_t * dmac)
|
void getMacAddr(uint8_t *dmac)
|
||||||
{
|
{
|
||||||
assert(esp_efuse_mac_get_default(dmac) == ESP_OK);
|
assert(esp_efuse_mac_get_default(dmac) == ESP_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAS_32768HZ
|
#ifdef HAS_32768HZ
|
||||||
#define CALIBRATE_ONE(cali_clk) calibrate_one(cali_clk, #cali_clk)
|
#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 uint32_t cal_count = 1000;
|
||||||
// const float factor = (1 << 19) * 1000.0f; unused var?
|
// const float factor = (1 << 19) * 1000.0f; unused var?
|
||||||
uint32_t cali_val;
|
uint32_t cali_val;
|
||||||
@ -63,10 +64,10 @@ void updateBatteryLevel(uint8_t level) {}
|
|||||||
cali_val = rtc_clk_cal(cal_clk, cal_count);
|
cali_val = rtc_clk_cal(cal_clk, cal_count);
|
||||||
}
|
}
|
||||||
return cali_val;
|
return cali_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
void enableSlowCLK()
|
void enableSlowCLK()
|
||||||
{
|
{
|
||||||
rtc_clk_32k_enable(true);
|
rtc_clk_32k_enable(true);
|
||||||
|
|
||||||
CALIBRATE_ONE(RTC_CAL_RTC_MUX);
|
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");
|
LOG_WARN("Failed to switch 32K XTAL RTC source to 32.768Khz !!! \n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void esp32Setup()
|
void esp32Setup()
|
||||||
{
|
{
|
||||||
uint32_t seed = esp_random();
|
uint32_t seed = esp_random();
|
||||||
LOG_DEBUG("Setting random seed %u\n", seed);
|
LOG_DEBUG("Setting random seed %u\n", seed);
|
||||||
|
|
||||||
@ -143,7 +144,7 @@ void updateBatteryLevel(uint8_t level) {}
|
|||||||
#ifdef HAS_32768HZ
|
#ifdef HAS_32768HZ
|
||||||
enableSlowCLK();
|
enableSlowCLK();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
// Turn off for now
|
// Turn off for now
|
||||||
@ -165,17 +166,17 @@ uint32_t axpDebugRead()
|
|||||||
Periodic axpDebugOutput(axpDebugRead);
|
Periodic axpDebugOutput(axpDebugRead);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// loop code specific to ESP32 targets
|
/// loop code specific to ESP32 targets
|
||||||
void esp32Loop()
|
void esp32Loop()
|
||||||
{
|
{
|
||||||
esp_task_wdt_reset(); // service our app level watchdog
|
esp_task_wdt_reset(); // service our app level watchdog
|
||||||
|
|
||||||
// for debug printing
|
// for debug printing
|
||||||
// radio.radioIf.canSleep();
|
// 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.
|
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
|
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_sleep_enable_timer_wakeup(msecToWake * 1000ULL); // call expects usecs
|
||||||
esp_deep_sleep_start(); // TBD mA sleep current (battery)
|
esp_deep_sleep_start(); // TBD mA sleep current (battery)
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user