mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-08 06:02:05 +00:00
Sweep up some missed trunk formatting
This commit is contained in:
parent
e85a2e827b
commit
7740b4bccd
@ -811,12 +811,9 @@ void GPS::setPowerState(GPSPowerState newState, uint32_t sleepTime)
|
||||
LOG_INFO("GPS power state moving from %s to %s\n", getGPSPowerStateString(oldState), getGPSPowerStateString(newState));
|
||||
|
||||
#ifdef HELTEC_MESH_NODE_T114
|
||||
if( (oldState==GPS_OFF || oldState==GPS_HARDSLEEP) && (newState!=GPS_OFF && newState!=GPS_HARDSLEEP) )
|
||||
{
|
||||
if ((oldState == GPS_OFF || oldState == GPS_HARDSLEEP) && (newState != GPS_OFF && newState != GPS_HARDSLEEP)) {
|
||||
_serial_gps->begin(serialSpeeds[speedSelect]);
|
||||
}
|
||||
else if( (newState==GPS_OFF || newState==GPS_HARDSLEEP) && (oldState!=GPS_OFF && oldState!=GPS_HARDSLEEP) )
|
||||
{
|
||||
} else if ((newState == GPS_OFF || newState == GPS_HARDSLEEP) && (oldState != GPS_OFF && oldState != GPS_HARDSLEEP)) {
|
||||
_serial_gps->end();
|
||||
}
|
||||
#endif
|
||||
|
@ -1592,7 +1592,7 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver)
|
||||
dispdev->displayOn();
|
||||
#ifdef USE_ST7789
|
||||
pinMode(VTFT_CTRL, OUTPUT);
|
||||
digitalWrite(VTFT_CTRL,LOW);
|
||||
digitalWrite(VTFT_CTRL, LOW);
|
||||
ui->init();
|
||||
#ifdef ESP_PLATFORM
|
||||
analogWrite(VTFT_LEDA, BRIGHTNESS_DEFAULT);
|
||||
@ -1617,9 +1617,9 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver)
|
||||
#if defined(ARCH_ESP32)
|
||||
pinMode(VTFT_LEDA, ANALOG);
|
||||
pinMode(VTFT_CTRL, ANALOG);
|
||||
pinMode(ST7789_RESET,ANALOG);
|
||||
pinMode(ST7789_RS,ANALOG);
|
||||
pinMode(ST7789_NSS,ANALOG);
|
||||
pinMode(ST7789_RESET, ANALOG);
|
||||
pinMode(ST7789_RS, ANALOG);
|
||||
pinMode(ST7789_NSS, ANALOG);
|
||||
#else
|
||||
nrf_gpio_cfg_default(VTFT_LEDA);
|
||||
nrf_gpio_cfg_default(VTFT_CTRL);
|
||||
|
29
src/main.cpp
29
src/main.cpp
@ -320,12 +320,12 @@ void setup()
|
||||
#endif
|
||||
|
||||
#ifdef SENSOR_POWER_CTRL_PIN
|
||||
pinMode(SENSOR_POWER_CTRL_PIN,OUTPUT);
|
||||
digitalWrite(SENSOR_POWER_CTRL_PIN,SENSOR_POWER_ON);
|
||||
pinMode(SENSOR_POWER_CTRL_PIN, OUTPUT);
|
||||
digitalWrite(SENSOR_POWER_CTRL_PIN, SENSOR_POWER_ON);
|
||||
#endif
|
||||
|
||||
#ifdef SENSOR_GPS_CONFLICT
|
||||
bool sensor_detected=false;
|
||||
bool sensor_detected = false;
|
||||
#endif
|
||||
#ifdef PERIPHERAL_WARMUP_MS
|
||||
// Some peripherals may require additional time to stabilize after power is connected
|
||||
@ -467,7 +467,7 @@ void setup()
|
||||
} else {
|
||||
LOG_INFO("%i I2C devices found\n", i2cCount);
|
||||
#ifdef SENSOR_GPS_CONFLICT
|
||||
sensor_detected=true;
|
||||
sensor_detected = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -715,20 +715,19 @@ void setup()
|
||||
#if !MESHTASTIC_EXCLUDE_GPS
|
||||
// If we're taking on the repeater role, ignore GPS
|
||||
#ifdef SENSOR_GPS_CONFLICT
|
||||
if(sensor_detected==false)
|
||||
{
|
||||
if (sensor_detected == false) {
|
||||
#endif
|
||||
if (HAS_GPS) {
|
||||
if (config.device.role != meshtastic_Config_DeviceConfig_Role_REPEATER &&
|
||||
config.position.gps_mode != meshtastic_Config_PositionConfig_GpsMode_NOT_PRESENT) {
|
||||
gps = GPS::createGps();
|
||||
if (gps) {
|
||||
gpsStatus->observe(&gps->newStatus);
|
||||
} else {
|
||||
LOG_DEBUG("Running without GPS.\n");
|
||||
if (HAS_GPS) {
|
||||
if (config.device.role != meshtastic_Config_DeviceConfig_Role_REPEATER &&
|
||||
config.position.gps_mode != meshtastic_Config_PositionConfig_GpsMode_NOT_PRESENT) {
|
||||
gps = GPS::createGps();
|
||||
if (gps) {
|
||||
gpsStatus->observe(&gps->newStatus);
|
||||
} else {
|
||||
LOG_DEBUG("Running without GPS.\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef SENSOR_GPS_CONFLICT
|
||||
}
|
||||
#endif
|
||||
|
@ -229,7 +229,7 @@ void cpuDeepSleep(uint32_t msecToWake)
|
||||
// of just the first) gpio_pullup_en((gpio_num_t)BUTTON_PIN);
|
||||
|
||||
#ifdef ESP32S3_WAKE_TYPE
|
||||
esp_sleep_enable_ext1_wakeup(gpioMask, ESP32S3_WAKE_TYPE);
|
||||
esp_sleep_enable_ext1_wakeup(gpioMask, ESP32S3_WAKE_TYPE);
|
||||
#else
|
||||
#if SOC_PM_SUPPORT_EXT_WAKEUP
|
||||
#ifdef CONFIG_IDF_TARGET_ESP32
|
||||
@ -240,7 +240,7 @@ void cpuDeepSleep(uint32_t msecToWake)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif //#end ESP32S3_WAKE_TYPE
|
||||
#endif // #end ESP32S3_WAKE_TYPE
|
||||
#endif
|
||||
|
||||
// We want RTC peripherals to stay on
|
||||
|
@ -198,15 +198,13 @@ void NRF52Bluetooth::shutdown()
|
||||
{
|
||||
// Shutdown bluetooth for minimum power draw
|
||||
LOG_INFO("Disable NRF52 bluetooth\n");
|
||||
uint8_t connection_num=Bluefruit.connected();
|
||||
if(connection_num)
|
||||
{
|
||||
for(uint8_t i=0;i<connection_num;i++)
|
||||
{
|
||||
LOG_INFO("NRF52 bluetooth disconnecting handle %d\n",i);
|
||||
uint8_t connection_num = Bluefruit.connected();
|
||||
if (connection_num) {
|
||||
for (uint8_t i = 0; i < connection_num; i++) {
|
||||
LOG_INFO("NRF52 bluetooth disconnecting handle %d\n", i);
|
||||
Bluefruit.disconnect(i);
|
||||
}
|
||||
delay(100);//wait for ondisconnect;
|
||||
delay(100); // wait for ondisconnect;
|
||||
}
|
||||
Bluefruit.Advertising.stop();
|
||||
}
|
||||
|
@ -280,9 +280,9 @@ void doDeepSleep(uint32_t msecToWake, bool skipPreflight = false)
|
||||
}
|
||||
|
||||
#if defined(I2C_SDA)
|
||||
Wire.end();
|
||||
pinMode(I2C_SDA,ANALOG);
|
||||
pinMode(I2C_SCL,ANALOG);
|
||||
Wire.end();
|
||||
pinMode(I2C_SDA, ANALOG);
|
||||
pinMode(I2C_SCL, ANALOG);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -45,7 +45,7 @@
|
||||
#define I2C_SCL 2
|
||||
#define HAS_SCREEN 0
|
||||
#define SENSOR_POWER_CTRL_PIN 21
|
||||
#define SENSOR_POWER_ON 1
|
||||
#define SENSOR_POWER_ON 1
|
||||
|
||||
#define SENSOR_GPS_CONFLICT
|
||||
|
||||
|
@ -146,7 +146,7 @@ No longer populated on PCB
|
||||
|
||||
#define GPS_L76K
|
||||
|
||||
//#define PIN_GPS_RESET (32 + 6) // An output to reset L76K GPS. As per datasheet, low for > 100ms will reset the L76K
|
||||
// #define PIN_GPS_RESET (32 + 6) // An output to reset L76K GPS. As per datasheet, low for > 100ms will reset the L76K
|
||||
#define GPS_RESET_MODE LOW
|
||||
#define PIN_GPS_EN (21)
|
||||
#define GPS_EN_ACTIVE HIGH
|
||||
|
Loading…
Reference in New Issue
Block a user