Skip to content

Commit 8b6bf9f

Browse files
committed
Make beeper follow settings at power on.
Settings must be loaded before beeper is used.
1 parent 53ec2c7 commit 8b6bf9f

File tree

3 files changed

+18
-15
lines changed

3 files changed

+18
-15
lines changed

Firmware/RTK_Everywhere/Begin.ino

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -249,13 +249,6 @@ void beginBoard()
249249
batteryStatusLedOn();
250250

251251
pinMode(pin_beeper, OUTPUT);
252-
253-
// Beep at power on if we are not locally compiled or a release candidate
254-
if (ENABLE_DEVELOPER == false)
255-
{
256-
beepOn();
257-
delay(250);
258-
}
259252
beepOff();
260253

261254
pinMode(pin_powerButton, INPUT);
@@ -282,7 +275,7 @@ void beginBoard()
282275
loraPowerOff(); // Keep LoRa powered down for now
283276

284277
pinMode(pin_loraRadio_boot, OUTPUT);
285-
digitalWrite(pin_loraRadio_boot, LOW); //Exit bootloader, run program
278+
digitalWrite(pin_loraRadio_boot, LOW); // Exit bootloader, run program
286279

287280
pinMode(pin_loraRadio_reset, OUTPUT);
288281
digitalWrite(pin_loraRadio_reset, LOW); // Reset STM32/radio
@@ -924,6 +917,14 @@ void tickerBegin()
924917
beepTask.detach(); // Turn off any previous task
925918
beepTask.attach(1.0 / beepTaskUpdatesHz, tickerBeepUpdate); // Rate in seconds, callback
926919
}
920+
921+
// Beep at power on if we are not locally compiled or a release candidate
922+
// if (ENABLE_DEVELOPER == false)
923+
{
924+
beepOn();
925+
delay(250);
926+
}
927+
beepOff();
927928
}
928929

929930
// Stop any ticker tasks and PWM control

Firmware/RTK_Everywhere/RTK_Everywhere.ino

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,6 +1032,13 @@ void setup()
10321032
DMW_b("beginFS");
10331033
beginFS(); // Start the LittleFS file system in the spiffs partition
10341034

1035+
// At this point product variants are known, except early RTK products that lacked ID resistors
1036+
DMW_b("loadSettingsPartial");
1037+
loadSettingsPartial(); // Must be after the product variant is known so the correct setting file name is loaded.
1038+
1039+
DMW_b("tickerBegin");
1040+
tickerBegin(); // Start ticker tasks for LEDs and beeper
1041+
10351042
DMW_b("checkUpdateLoraFirmware");
10361043
if (checkUpdateLoraFirmware() == true) // Check if updateLoraFirmware.txt exists
10371044
beginLoraFirmwareUpdate();
@@ -1044,10 +1051,6 @@ void setup()
10441051
configureViaEthernet =
10451052
checkConfigureViaEthernet(); // Check if going into dedicated configureViaEthernet (STATE_CONFIG_VIA_ETH) mode
10461053

1047-
// At this point product variants are known, except early RTK products that lacked ID resistors
1048-
DMW_b("loadSettingsPartial");
1049-
loadSettingsPartial(); // Must be after the product variant is known so the correct setting file name is loaded.
1050-
10511054
DMW_b("beginPsram");
10521055
beginPsram(); // Inialize PSRAM (if available). Needs to occur before beginGnssUart and other malloc users.
10531056

@@ -1076,9 +1079,6 @@ void setup()
10761079
DMW_b("displaySplash");
10771080
displaySplash(); // Display the RTK product name and firmware version
10781081

1079-
DMW_b("tickerBegin");
1080-
tickerBegin(); // Start ticker tasks for LEDs and beeper
1081-
10821082
DMW_b("beginSD");
10831083
beginSD(); // Requires settings. Test if SD is present
10841084

Firmware/RTK_Everywhere/support.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,7 @@ const double WGS84_A = 6378137; // https://geographiclib.sourceforge.i
477477
const double WGS84_E = 0.081819190842622; // http://docs.ros.org/en/hydro/api/gps_common/html/namespacegps__common.html
478478
// and https://gist.github.com/uhho/63750c4b54c7f90f37f958cc8af0c718
479479

480+
// Convert LLH (geodetic) to ECEF
480481
// From: https://stackoverflow.com/questions/19478200/convert-latitude-and-longitude-to-ecef-coordinates-system
481482
void geodeticToEcef(double lat, double lon, double alt, double *x, double *y, double *z)
482483
{
@@ -492,6 +493,7 @@ void geodeticToEcef(double lat, double lon, double alt, double *x, double *y, do
492493
*z = (N * (1.0 - WGS84_E * WGS84_E) + alt) * slat;
493494
}
494495

496+
// Convert ECEF to LLH (geodetic)
495497
// From: https://danceswithcode.net/engineeringnotes/geodetic_to_ecef/geodetic_to_ecef.html
496498
void ecefToGeodetic(double x, double y, double z, double *lat, double *lon, double *alt)
497499
{

0 commit comments

Comments
 (0)