Skip to content

Commit f0167b6

Browse files
committed
Fix major bug : configure Mux when changing settings of NAU7802, SCD30 or u-blox GNSS
1 parent e988942 commit f0167b6

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

Firmware/OpenLog_Artemis/menuAttachedDevices.ino

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -925,6 +925,8 @@ void menuConfigure_NAU7802(void *configPtr)
925925
NAU7802 *sensor = (NAU7802 *)temp->classPtr;
926926
struct_NAU7802 *sensorConfig = (struct_NAU7802*)configPtr;
927927

928+
openConnection(temp->muxAddress, temp->portNumber); //Connect to this device through muxes as needed
929+
928930
while (1)
929931
{
930932
SerialPrintln(F(""));
@@ -1024,11 +1026,11 @@ void menuConfigure_NAU7802(void *configPtr)
10241026
}
10251027
olaftoa(LDO, tempStr, 1, sizeof(tempStr) / sizeof(char));
10261028
SerialPrintf2("9) LDO voltage: %s\r\n", tempStr);
1029+
SerialPrint(F("10) Calibration mode: "));
1030+
if (sensorConfig->calibrationMode == 0) SerialPrintln(F("None"));
1031+
else if (sensorConfig->calibrationMode == 1) SerialPrintln(F("Internal"));
1032+
else SerialPrintln(F("External"));
10271033
}
1028-
SerialPrint(F("10) Calibration mode: "));
1029-
if (sensorConfig->calibrationMode == 0) SerialPrintln(F("None"));
1030-
else if (sensorConfig->calibrationMode == 1) SerialPrintln(F("Internal"));
1031-
else SerialPrintln(F("External"));
10321034

10331035
SerialPrintln(F("x) Exit"));
10341036

@@ -1426,6 +1428,8 @@ void getUbloxDateTime(int &year, int &month, int &day, int &hour, int &minute, i
14261428
{
14271429
case DEVICE_GPS_UBLOX:
14281430
{
1431+
openConnection(temp->muxAddress, temp->portNumber); //Connect to this device through muxes as needed
1432+
14291433
setQwiicPullups(0); //Disable pullups to minimize CRC issues
14301434

14311435
SFE_UBLOX_GNSS *nodeDevice = (SFE_UBLOX_GNSS *)temp->classPtr;
@@ -1464,6 +1468,8 @@ void gnssFactoryDefault(void)
14641468
{
14651469
case DEVICE_GPS_UBLOX:
14661470
{
1471+
openConnection(temp->muxAddress, temp->portNumber); //Connect to this device through muxes as needed
1472+
14671473
setQwiicPullups(0); //Disable pullups to minimize CRC issues
14681474

14691475
SFE_UBLOX_GNSS *nodeDevice = (SFE_UBLOX_GNSS *)temp->classPtr;
@@ -1890,6 +1896,8 @@ void menuConfigure_SCD30(void *configPtr)
18901896
SCD30 *sensor = (SCD30 *)temp->classPtr;
18911897
struct_SCD30 *sensorSetting = (struct_SCD30*)configPtr;
18921898

1899+
openConnection(temp->muxAddress, temp->portNumber); //Connect to this device through muxes as needed
1900+
18931901
while (1)
18941902
{
18951903
SerialPrintln(F(""));

0 commit comments

Comments
 (0)