Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge RC changes #216

Merged
merged 138 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
2776384
Update form.h via Python
github-actions[bot] Mar 8, 2024
27065b0
Set PPS to 200ms
nseidle Mar 11, 2024
1fed04b
Don't exit PointPerfect menu if WiFi fails
nseidle Mar 11, 2024
692c220
Remove old patch
nseidle Mar 11, 2024
d240f13
Move tilt to state machine
nseidle Mar 11, 2024
6991e6d
Add missing developer functions
nseidle Mar 12, 2024
8e2a414
Update form.h via Python
github-actions[bot] Mar 12, 2024
8055c7e
Workflow: Enable PSRAM
nseidle Mar 12, 2024
09de315
Update form.h via Python
github-actions[bot] Mar 12, 2024
5bc958d
Merge branch 'main' into RC_Display_Refactoring
PaulZC Mar 15, 2024
3610942
Make display agnostic of I2C bus
PaulZC Mar 15, 2024
c16bf5a
Change pin_dac26 to pin_muxDAC, pin_adc39 to pin_muxADC
PaulZC Mar 15, 2024
4a0155f
Starting to add Facet mosaic support
PaulZC Mar 15, 2024
a847fc8
Update non-release-build.yml
PaulZC Mar 20, 2024
a0f7943
Merge branch 'main' into RC_Display_Refactoring
PaulZC Mar 20, 2024
f7ebef0
Merge pull request #193 from sparkfun/RC_Display_Refactoring
nseidle Mar 20, 2024
af7e1c0
Rename zedSurveyInStartingAccuracy
nseidle Mar 20, 2024
751c39a
Correctly check starting accuracy
nseidle Mar 20, 2024
baeb08b
Add prelim command list
nseidle Mar 20, 2024
995aff7
Add inBaseMode()
nseidle Mar 20, 2024
07ceca9
Remove unused wifiInConfigMode()
nseidle Mar 20, 2024
da359fa
Add inRoverMode()
nseidle Mar 20, 2024
49d5218
Add inNtpMode()
nseidle Mar 20, 2024
922a83e
Correctly print HPA based on mode.
nseidle Mar 20, 2024
b2506af
Merge branch 'main' into release_candidate
nseidle Mar 21, 2024
b2d8188
Pass I2C bus to battery begin
nseidle Mar 21, 2024
3b195f9
Remove compile guards
nseidle Mar 21, 2024
841eeaf
Update form.h via Python
github-actions[bot] Mar 21, 2024
dc7a4f4
Change Bluetooth to dual by default
nseidle Mar 21, 2024
249023e
Merge branch 'release_candidate' of https://github.com/sparkfun/Spark…
nseidle Mar 21, 2024
9eb5a18
Add list of all settings
nseidle Mar 21, 2024
b326f5e
Merge pull request #194 from sparkfun/ListCommands
nseidle Mar 21, 2024
d31099f
Update form.h via Python
github-actions[bot] Mar 21, 2024
977df0e
Adjust tilt online print message
nseidle Mar 21, 2024
20c0cd8
Add the bleeps and the bloops
nseidle Mar 21, 2024
26d3a05
Remove old tilt comments
nseidle Mar 21, 2024
6c6c615
Merge branch 'release_candidate' of https://github.com/sparkfun/Spark…
nseidle Mar 21, 2024
9c8238a
Update form.h via Python
github-actions[bot] Mar 21, 2024
60eb309
Allow icon positions to be changed for each display
PaulZC Mar 21, 2024
59cce55
Move cancel only on/off beeps in developer mode.
nseidle Mar 21, 2024
2a1237f
Increase setting buffer. Avoid bulk print of large array.
nseidle Mar 21, 2024
555f0f3
Update form.h via Python
github-actions[bot] Mar 21, 2024
dd450c0
Add initial blink support
PaulZC Mar 22, 2024
d878fc5
Update paintHorizontalAccuracy
PaulZC Mar 22, 2024
4514642
Change pulse to circle of doom
PaulZC Mar 22, 2024
aed3ae1
Update paintClock
PaulZC Mar 22, 2024
cc3a0f0
Add the icon iterator
PaulZC Mar 22, 2024
d3a8dd5
Make icon positions relative for paintBaseTempSurveyStarted
PaulZC Mar 22, 2024
92e108f
Update paintRTCM
PaulZC Mar 22, 2024
163fcf2
Fix compiler warnings
nseidle Mar 22, 2024
29ad755
Add icon duty - WIP (won't compile)
PaulZC Mar 22, 2024
15afb25
Add double tap entry to WiFi config
nseidle Mar 22, 2024
3ed6af8
Update comment
nseidle Mar 22, 2024
533b4c0
Update form.h via Python
github-actions[bot] Mar 23, 2024
9ce691d
Finish updating the display functions. TODO: add 128x64 radio icon su…
PaulZC Mar 25, 2024
9142c0b
Better pulse icon
PaulZC Mar 25, 2024
6c6b7cb
Fix theGNSS I2C bus
PaulZC Mar 25, 2024
3871125
Update comments
PaulZC Mar 25, 2024
cc7884a
Fix i2cLBand I2C bus
PaulZC Mar 25, 2024
c58dcfa
Move Accuracy and SIV on 128x64
PaulZC Mar 25, 2024
b3c10e0
Move SIV more to the right on 128x64
PaulZC Mar 25, 2024
04e361a
Add 128x64 radio icons
PaulZC Mar 25, 2024
cf02db1
Fix i2cLBand I2C bus
PaulZC Mar 25, 2024
6495de4
Compile everything
PaulZC Mar 25, 2024
5e1f3a5
Fix 128x64 battery icon position
PaulZC Mar 25, 2024
a2db360
Update RTK_Everywhere.ino
PaulZC Mar 25, 2024
8172a26
Trap negative battery level
PaulZC Mar 25, 2024
7576db7
Nudge battery icon to prevent column 0 corruption
PaulZC Mar 25, 2024
1c1917c
Use overload of oled->bitmap
PaulZC Mar 25, 2024
2ee06e1
Merge pull request #198 from sparkfun/RC_Display_Refactoring
PaulZC Mar 26, 2024
963458d
Fix display_type for Torch
PaulZC Mar 26, 2024
8c09941
Merge pull request #199 from sparkfun/RC_Display_Refactoring
PaulZC Mar 26, 2024
45b8821
Fix I2C port for fuel gauges
PaulZC Mar 26, 2024
5485236
Merge pull request #200 from sparkfun/RC_Display_Refactoring
PaulZC Mar 26, 2024
7ccf103
Add beginSystemState for Facet mosaic
PaulZC Mar 26, 2024
912761a
Temporary fix for column 0 on 128x64
PaulZC Mar 26, 2024
2eb1581
Merge pull request #201 from sparkfun/RC_Display_Refactoring
PaulZC Mar 26, 2024
dabc4b5
Starting to add corrections priorities
PaulZC Mar 26, 2024
2dc8ed7
Update menuCommands.ino for settings.correctionsSourcesPriority
PaulZC Mar 26, 2024
5eb3b20
Add menuCorrectionsPriorities
PaulZC Mar 26, 2024
d4e4172
Make correction priority menu easier to use
PaulZC Mar 27, 2024
d4e64bb
Update menuCommands.ino
PaulZC Mar 27, 2024
b036017
Starting to add WiFi Config support for corrections priorities
PaulZC Mar 27, 2024
6e3da28
More WiFi config changes for corrections priority - BROKEN
PaulZC Mar 27, 2024
f0cc164
Corrections priority WiFi Config almost working
PaulZC Mar 27, 2024
bae5520
Corrections Priority - working on WiFi Config - found the pesky autoI…
PaulZC Mar 28, 2024
494eac1
Merge pull request #202 from sparkfun/Corrections_Priority
PaulZC Mar 28, 2024
62a5a74
Fix prints
nseidle Mar 29, 2024
7f667af
Show shutdown only if fastShutDown is present
nseidle Mar 29, 2024
e9cd3d2
Catch timeout response to PointPerfect
nseidle Mar 29, 2024
11698d4
Update form.h via Python
github-actions[bot] Mar 29, 2024
1b1bfdd
Fix builds when disabling COMPILE_OTA_AUTO
LeeLeahy2 Mar 28, 2024
926a3e6
Fix I2C structure selection, fixes broken radio initialization
LeeLeahy2 Mar 29, 2024
8859319
Add COMPILE_MQTT_CLIENT to support disabling the MQTT client
LeeLeahy2 Mar 28, 2024
f1c569c
Properly separate WiFi state values from WiFi mode values
LeeLeahy2 Apr 1, 2024
52a9d02
Add NTRIP_SERVER_DATA structure
LeeLeahy2 Mar 27, 2024
1a38379
Switch to using ntripServerArray
LeeLeahy2 Mar 28, 2024
98aaaff
Move NTRIP server data into the data structure
LeeLeahy2 Mar 28, 2024
08946e4
Add the NTRIP Server number to the error messages
LeeLeahy2 Mar 28, 2024
3912bca
Add unique values for each of the NTRIP server settings
LeeLeahy2 Mar 28, 2024
d600fd1
Increase NTRIP_SERVER_MAX from 1 to 4
LeeLeahy2 Mar 29, 2024
1c2903f
Merge pull request #203 from LeeLeahy2/fix-ota-compile
nseidle Apr 1, 2024
99e288c
Merge pull request #204 from LeeLeahy2/i2c-fix
nseidle Apr 1, 2024
5db0d20
Merge pull request #205 from LeeLeahy2/mqtt-client-compile
nseidle Apr 1, 2024
7b1f7e0
Merge pull request #206 from LeeLeahy2/wifi-states
nseidle Apr 1, 2024
5c07f8a
Merge pull request #207 from LeeLeahy2/ntrip-struct
nseidle Apr 1, 2024
728f838
Merge pull request #208 from LeeLeahy2/ntrip-server-array
nseidle Apr 1, 2024
95dfef0
Merge pull request #209 from LeeLeahy2/ntrip-server-data
nseidle Apr 1, 2024
e121383
Merge pull request #210 from LeeLeahy2/error-messages
nseidle Apr 1, 2024
24e96cc
Merge pull request #211 from LeeLeahy2/unique-values
nseidle Apr 1, 2024
0b1ba04
Merge pull request #212 from LeeLeahy2/ntrip-server
nseidle Apr 1, 2024
411e59a
Revert creation of I2C(0)
nseidle Apr 1, 2024
7d613fb
Fix compilation errors post PR merges
nseidle Apr 1, 2024
5a32292
Text editing of corrections priorities
nseidle Apr 1, 2024
a03f608
Cleanse input of whitespace to avoid bad atoi
nseidle Apr 1, 2024
b402fcf
Whitespace changes
nseidle Apr 1, 2024
c0d1ebb
Add additional location in NVM comments
nseidle Apr 1, 2024
cea2e90
Change NTRIP Server menu display and entry
nseidle Apr 1, 2024
3f73625
Update form.h via Python
github-actions[bot] Apr 1, 2024
01fa3b4
Add Torch LoRa pins
nseidle Apr 1, 2024
71a9c64
Merge branch 'release_candidate' of https://github.com/sparkfun/Spark…
nseidle Apr 1, 2024
3a4ad32
Fix #213
PaulZC Apr 2, 2024
0279a19
Update form.h via Python
github-actions[bot] Apr 2, 2024
061f952
Refactor Setup - add double tap to select
PaulZC Apr 2, 2024
6ae1f0e
Delete setupDoubleTapRequired - not required!
PaulZC Apr 2, 2024
e562df4
Disable PointPerfect by default.
nseidle Apr 2, 2024
5d989ff
Updates:
PaulZC Apr 3, 2024
de204f5
Make getProfileNumberFromUnit return -1 on fail
PaulZC Apr 3, 2024
fed957a
Merge branch 'release_candidate' into RC_Display_Refactoring
PaulZC Apr 3, 2024
ed33370
Merge pull request #215 from sparkfun/RC_Display_Refactoring
PaulZC Apr 3, 2024
6f113d6
Update form.h via Python
github-actions[bot] Apr 3, 2024
e44e5d0
Add tickerStop()
nseidle Apr 3, 2024
b4ddbd0
Whitespace change
nseidle Apr 3, 2024
6609894
Add print if device in power down mode
nseidle Apr 3, 2024
321371a
Don't powerDown() Torch if <5% power
nseidle Apr 3, 2024
ee47078
Illuminate LEDs during power off
nseidle Apr 3, 2024
a940106
Merge branch 'release_candidate' of https://github.com/sparkfun/Spark…
nseidle Apr 3, 2024
ffd5284
Enable Mag field mode during IMU Tilt compensation
nseidle Apr 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .github/workflows/compile-rtk-everywhere.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,6 @@ jobs:
https://github.com/me-no-dev/ESPAsyncWebServer.git
https://github.com/me-no-dev/AsyncTCP.git

#Incorporate ESP-Now patch into core: https://github.com/espressif/arduino-esp32/pull/7044/files
#- name: Patch ESP32 Core
# run: |
# cd Firmware/RTK_Everywhere/Patch/
# cp WiFiGeneric.cpp /home/runner/.arduino15/packages/esp32/hardware/esp32/2.0.2/libraries/WiFi/src/WiFiGeneric.cpp

- name: Setup Python
uses: actions/setup-python@v4
with:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/non-release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,6 @@ jobs:
cd Firmware/RTK_Everywhere/build/esp32.esp32.esp32/
mkdir ${{ env.ARTIFACT }}
mv RTK_Everywhere.ino.bin ${{ env.ARTIFACT }}
mv RTK_Everywhere.ino.bootloader.bin ${{ env.ARTIFACT }}
mv RTK_Everywhere.ino.partitions.bin ${{ env.ARTIFACT }}

- name: Upload artifact directory to action - avoid double-zip
uses: actions/upload-artifact@v3
Expand Down
35 changes: 34 additions & 1 deletion Firmware/RTK_Everywhere/AP-Config/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1255,7 +1255,7 @@
</div>

<div id="wifiConfigTypeDropdown" class="mt-3">
<label for="wifiConfigType">Configure Mode: </label>
<label for="wifiConfigOverAP">Configure Mode: </label>
<select name="wifiConfigType" id="wifiConfigOverAP" class="form-dropdown">
<option value="1">AP</option>
<option value="0">WiFi</option>
Expand Down Expand Up @@ -1346,6 +1346,39 @@
</div>
</div>

<!-- --------- Corrections Priority Config --------- -->
<div class="d-grid gap-2">
<button class="btn btn-primary mt-3 toggle-btn" type="button" data-toggle="collapse"
data-target="#collapseCorrectionsPriorityConfig" aria-expanded="false" aria-controls="collapseCorrectionsPriorityConfig">
Corrections Configuration <i id="correctionsCaret" class="caret-icon bi icon-caret-down"></i>
</button>
</div>

<div class="collapse" id="collapseCorrectionsPriorityConfig">
<div class="card card-body">

<div class="form-group mt-2">
Corrections Source:
<span class="tt" data-bs-placement="right"
title="Assign a priority to each corrections source. Priorities must be contiguous, starting at zero with no repeats. Zero is the highest priority. Changes are saved when 'Save Configuration' is pressed.">
<span class="icon-info-circle text-primary ms-2"></span>
</span>
</div>
<div class="form-group row">
<p id="collapseCorrectionsPriorityConfigError" class="inlineError"></p>
</div>

<div id="correctionsPriorityList">
</div>

<div style="margin-bottom:5px;">
<button type="button" id="correctionsPriorityDefaults" class="btn btn-primary"
onClick="resetToCorrectionsPriorityDefaults()">Reset to Defaults</button>
</div>

</div>
</div>

<!-- --------- System Config --------- -->
<div class="d-grid gap-2">
<button class="btn btn-primary mt-3 toggle-btn" type="button" data-toggle="collapse"
Expand Down
214 changes: 153 additions & 61 deletions Firmware/RTK_Everywhere/AP-Config/src/main.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion Firmware/RTK_Everywhere/Base.ino
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ void DevUBLOXGNSS::processRTCM(uint8_t incoming)
rtcmLastReceived = millis();
rtcmBytesSent++;

ntripServerProcessRTCM(incoming);
for (int serverIndex = 0; serverIndex < NTRIP_SERVER_MAX; serverIndex++)
ntripServerProcessRTCM(serverIndex, incoming);

espnowProcessRTCM(incoming);
}
Expand Down
162 changes: 149 additions & 13 deletions Firmware/RTK_Everywhere/Begin.ino
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,19 @@ void identifyBoard()
else if (idWithAdc(idValue, 10, 100))
productVariant = RTK_EVK;

// Facet mosaic: 1/4.7 --> 2674mV < 2721mV < 2766mV
else if (idWithAdc(idValue, 1, 4.7))
productVariant = RTK_FACET_MOSAIC;

// ID resistors do not exist for the following:
// Torch
else
{
log_d("Out of band or nonexistent resistor IDs");

// Check if a bq40Z50 battery manager is on the I2C bus
if (i2c_0 == nullptr)
i2c_0 = new TwoWire(0);
int pin_SDA = 15;
int pin_SCL = 4;

Expand Down Expand Up @@ -161,6 +167,10 @@ void beginBoard()

pin_beeper = 33;

pin_loraRadio_power = 19; // LoRa_EN
pin_loraRadio_boot = 23; // LoRa_BOOT0
pin_loraRadio_reset = 5; // LoRa_NRST

DMW_if systemPrintf("pin_bluetoothStatusLED: %d\r\n", pin_bluetoothStatusLED);
pinMode(pin_bluetoothStatusLED, OUTPUT);

Expand All @@ -176,6 +186,13 @@ void beginBoard()
batteryStatusLedOn();

pinMode(pin_beeper, OUTPUT);

// Beep at power on if we are not locally compiled or a release candidate
if (ENABLE_DEVELOPER == false)
{
beepOn();
delay(250);
}
beepOff();

pinMode(pin_powerButton, INPUT);
Expand All @@ -191,6 +208,15 @@ void beginBoard()
digitalWrite(pin_usbSelect, HIGH); // Keep CH340 connected to USB bus

settings.dataPortBaud = 115200; // Override settings. Use UM980 at 115200bps.

pinMode(pin_loraRadio_power, OUTPUT);
digitalWrite(pin_loraRadio_power, LOW); // Keep LoRa powered down

pinMode(pin_loraRadio_boot, OUTPUT);
digitalWrite(pin_loraRadio_boot, LOW);

pinMode(pin_loraRadio_reset, OUTPUT);
digitalWrite(pin_loraRadio_reset, LOW); // Keep LoRa in reset
}

else if (productVariant == RTK_EVK)
Expand All @@ -208,7 +234,9 @@ void beginBoard()
present.antennaShortOpen = true;
present.timePulseInterrupt = true;
present.i2c0BusSpeed_400 = true; // Run bus at higher speed
present.display_128x64_i2c1 = true;
present.i2c1 = true;
present.display_i2c1 = true;
present.display_type = DISPLAY_128x64;
present.i2c1BusSpeed_400 = true; // Run display bus at higher speed

// Pin Allocations:
Expand Down Expand Up @@ -252,6 +280,10 @@ void beginBoard()
pin_microSD_CardDetect = 36;
// 5, A39 : Unused analog pin - used to generate random values for SSL

// Select the I2C 0 data structure
if (i2c_0 == nullptr)
i2c_0 = new TwoWire(0);

// Disable the Ethernet controller
DMW_if systemPrintf("pin_Ethernet_CS: %d\r\n", pin_Ethernet_CS);
pinMode(pin_Ethernet_CS, OUTPUT);
Expand All @@ -274,12 +306,14 @@ void beginBoard()
pinMode(pin_peripheralPowerControl, OUTPUT);
peripheralsOn(); // Turn on power to OLED, SD, ZED, NEO, USB Hub,
}

else if (productVariant == RTK_FACET_V2)
{
present.psram_2mb = true;
present.psram_4mb = true;
present.gnss_zedf9p = true;
present.microSd = true;
present.display_64x48_i2c0 = true;
present.display_i2c0 = true;
present.display_type = DISPLAY_64x48;
present.button_powerLow = true; // Button is pressed when low
present.battery_max17048 = true;
present.portDataMux = true;
Expand All @@ -294,6 +328,47 @@ void beginBoard()
pinMode(pin_powerFastOff, OUTPUT);
digitalWrite(pin_powerFastOff, HIGH); // Stay on
}

else if (productVariant == RTK_FACET_MOSAIC)
{
present.psram_4mb = true;
present.gnss_mosaic = true;
present.display_i2c0 = true;
present.display_type = DISPLAY_64x48;
present.i2c0BusSpeed_400 = true;
present.peripheralPowerControl = true;
present.button_powerLow = true; // Button is pressed when low
present.battery_max17048 = true;
present.portDataMux = true;
present.fastPowerOff = true;

pin_batteryStatusLED = 34;
pin_muxA = 18;
pin_muxB = 19;
pin_powerSenseAndControl = 32;
pin_powerFastOff = 33;
pin_muxDAC = 26;
pin_muxADC = 39;
pin_peripheralPowerControl = 27;
pin_I2C0_SDA = 21;
pin_I2C0_SCL = 22;
pin_GnssUart_RX = 13;
pin_GnssUart_TX = 14;
pin_GnssLBandUart_RX = 4;
pin_GnssLBandUart_TX = 25;

pinMode(pin_muxA, OUTPUT);
pinMode(pin_muxB, OUTPUT);

// pinMode(pin_powerFastOff, OUTPUT);
// digitalWrite(pin_powerFastOff, HIGH); // Stay on
pinMode(pin_powerFastOff, INPUT);

// Turn on power to the mosaic and OLED
DMW_if systemPrintf("pin_peripheralPowerControl: %d\r\n", pin_peripheralPowerControl);
pinMode(pin_peripheralPowerControl, OUTPUT);
peripheralsOn(); // Turn on power to OLED, SD, ZED, NEO, USB Hub,
}
}

void beginVersion()
Expand Down Expand Up @@ -744,13 +819,25 @@ void tickerBegin()
}
}

//Stop any ticker tasks and PWM control
void tickerStop()
{
bluetoothLedTask.detach();
gnssLedTask.detach();
batteryLedTask.detach();

ledcDetachPin(pin_bluetoothStatusLED);
ledcDetachPin(pin_gnssStatusLED);
ledcDetachPin(pin_batteryStatusLED);
}

// Configure the battery fuel gauge
void beginFuelGauge()
{
if (present.battery_max17048 == true)
{
// Set up the MAX17048 LiPo fuel gauge
if (lipo.begin() == false)
if (lipo.begin(*i2c_0) == false)
{
systemPrintln("Fuel gauge not detected");
return;
Expand Down Expand Up @@ -793,7 +880,7 @@ void beginFuelGauge()
return;
}

if (bq40z50Battery->begin() == false)
if (bq40z50Battery->begin(*i2c_0) == false)
{
systemPrintln("BQ40Z50 not detected");
delete bq40z50Battery;
Expand All @@ -810,14 +897,21 @@ void beginFuelGauge()
// Check to see if we are dangerously low
if ((batteryLevelPercent < 5) && (isCharging() == false)) // 5% and not charging
{
systemPrintln("Battery too low. Please charge. Shutting down...");
// Currently only the Torch uses the BQ40Z50 and it does not have software shutdown
// So throw a warning, but don't do anything else.
systemPrintln("Battery too low. Please charge.");

if (online.display == true)
displayMessage("Charge Battery", 0);
// If future platforms use the BQ40Z50 and have software shutdown, allow it
// but avoid blocking Torch with the infinite loop of powerDown().

delay(2000);
// systemPrintln("Battery too low. Please charge. Shutting down...");

powerDown(false); // Don't display 'Shutting Down'
// if (online.display == true)
// displayMessage("Charge Battery", 0);

// delay(2000);

// powerDown(false); // Don't display 'Shutting Down'
}
}
#endif // COMPILE_BQ40Z50
Expand Down Expand Up @@ -898,9 +992,19 @@ void beginSystemState()
firstRoverStart = false;
}
else if (productVariant == RTK_EVK)
{
firstRoverStart = false; // Screen should have been tested when it was made ;-)
// Return to either NTP, Base or Rover Not Started. The last state previous to power down.
systemState = settings.lastState;
}
else if (productVariant == RTK_FACET_MOSAIC)
{
// Return to either NTP, Base or Rover Not Started. The last state previous to power down.
systemState = settings.lastState;

firstRoverStart = true; // Allow user to enter test screen during first rover start
if (systemState == STATE_BASE_NOT_STARTED)
firstRoverStart = false;
}
else if (productVariant == RTK_TORCH)
{
Expand Down Expand Up @@ -944,10 +1048,30 @@ void beginI2C()
{
TaskHandle_t taskHandle;

if (present.display_128x64_i2c1 == true)
if (i2c_0 == nullptr) // i2c_0 could have been instantiated by identifyBoard
i2c_0 = new TwoWire(0);

if (present.i2c1 == true)
{
if (i2c_1 == nullptr)
i2c_1 = new TwoWire(1);
}

if ((present.display_i2c0 == true) && (present.display_i2c1 == true))
reportFatalError("Displays on both i2c_0 and i2c_1");

if (present.display_i2c0 == true)
{
// Display is on standard Wire bus
i2cDisplay = i2c_0;
}

if (present.display_i2c1 == true)
{
if (present.i2c1 == false)
reportFatalError("No i2c1 for display_i2c1");

// Display is on I2C bus 1
i2c_1 = new TwoWire(1);
i2cDisplay = i2c_1;

// Display splash screen for at least 1 second
Expand Down Expand Up @@ -994,7 +1118,7 @@ void pinI2CTask(void *pvParameters)
online.i2c = true;

// Initialize I2C bus 1
if (i2c_1)
if (present.i2c1)
{
int bus1speed = 100;
if (present.i2c1BusSpeed_400 == true)
Expand Down Expand Up @@ -1157,6 +1281,18 @@ void deleteSDSizeCheckTask()
}
}

// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

// Check and initialize any arrays that won't be initialized by gnssConfigure (checkGNSSArrayDefaults)
// TODO: find a better home for this
void checkArrayDefaults()
{
if (!validateCorrectionPriorities())
initializeCorrectionPriorities();
if (!validateCorrectionPriorities())
reportFatalError("initializeCorrectionPriorities failed.");
}

// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// Time Pulse ISR
// Triggered by the rising edge of the time pulse signal, indicates the top-of-second.
Expand Down
9 changes: 7 additions & 2 deletions Firmware/RTK_Everywhere/Bluetooth.ino
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,14 @@ int bluetoothRead(uint8_t *buffer, int length)
return (bytesRead);

bytesRead = bluetoothSerialSpp->readBytes(buffer, length);

return (bytesRead);
}
else
return bluetoothSerial->readBytes(buffer, length);

return 0;

#else // COMPILE_BT
return 0;
#endif // COMPILE_BT
Expand Down Expand Up @@ -222,9 +227,9 @@ void bluetoothStart()
{
bluetoothState = BT_OFF;
char stateName[11] = {0};
if (systemState >= STATE_ROVER_NOT_STARTED && systemState <= STATE_ROVER_RTK_FIX)
if (inRoverMode() == true)
strncpy(stateName, "Rover-", sizeof(stateName) - 1);
else if (systemState >= STATE_BASE_NOT_STARTED && systemState <= STATE_BASE_FIXED_TRANSMITTING)
else if (inBaseMode() == true)
strncpy(stateName, "Base-", sizeof(stateName) - 1);
else
{
Expand Down
Loading
Loading