Skip to content

Commit 67cab0e

Browse files
committed
Add NOT_FACET_FLEX, remove extra i2c_0 gubbins
1 parent d39fcad commit 67cab0e

File tree

2 files changed

+11
-19
lines changed

2 files changed

+11
-19
lines changed

Firmware/RTK_Everywhere/Begin.ino

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,6 @@ void identifyBoard()
124124

125125
if (productVariant == RTK_UNKNOWN)
126126
{
127-
// TODO remove once v1.1 Flex has ID resistors
128-
if (i2c_0 == nullptr)
129-
i2c_0 = new TwoWire(0);
130-
int pin_SDA = 15;
131-
int pin_SCL = 4;
132-
i2c_0->begin(pin_SDA, pin_SCL); // SDA, SCL
133-
134127
// Use ADC to check the resistor divider
135128
int pin_deviceID = 35;
136129
uint16_t idValue = analogReadMilliVolts(pin_deviceID);
@@ -163,19 +156,13 @@ void identifyBoard()
163156
else if (idWithAdc(idValue, 10.0, 20.0, 8.5))
164157
productVariant = RTK_FLEX;
165158

166-
// 0x3C - SSD1306 OLED Driver found in RTK Flex
167-
// TODO remove once v1.1 hardware has ID resistors
168-
// else if (i2cIsDevicePresent(i2c_0, 0x3C) == true || i2cIsDevicePresent(i2c_0, 0x10) == true)
169-
// productVariant = RTK_FLEX;
170-
171159
// Postcard: 3.3/10 --> 2371mV < 2481mV < 2582mV (8.5% tolerance)
172160
else if (idWithAdc(idValue, 3.3, 10, 8.5))
173161
productVariant = RTK_POSTCARD;
174-
175-
productVariant = RTK_FLEX; // TODO remove hard override
176-
177-
// TODO remove once v1.1 Flex has ID resistors
178-
i2c_0->end();
162+
163+
#ifndef NOT_FACET_FLEX
164+
productVariant = RTK_FLEX; // TODO remove once v1.1 Flex has ID resistors
165+
#endif
179166
}
180167

181168
if (ENABLE_DEVELOPER)
@@ -1445,7 +1432,7 @@ void beginButtons()
14451432
// Avoid using the button library
14461433
if (present.gpioExpanderButtons == true)
14471434
{
1448-
if (beginGpioExpanderButtons(0x20) == false)
1435+
if (beginGpioExpanderButtons(0x20) == false) // This updates online.gpioExpanderButtons
14491436
{
14501437
systemPrintln("Portability Shield not detected");
14511438

Firmware/RTK_Everywhere/RTK_Everywhere.ino

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@
7878
7979
*/
8080

81+
// While we wait for the next hardware revision, Facet Flex needs to be manually forced:
82+
#define NOT_FACET_FLEX // Comment to force support for Facet Flex
83+
8184
// To reduce compile times, various parts of the firmware can be disabled/removed if they are not
8285
// needed during development
8386
#define COMPILE_BT // Comment out to remove Bluetooth functionality
@@ -1264,7 +1267,7 @@ void setup()
12641267
beginPsram(); // Initialize PSRAM (if available). Needs to occur before beginGnssUart and other malloc users.
12651268

12661269
DMW_b("beginMux");
1267-
beginMux(); // Must come before I2C activity to avoid external devices from corrupting the bus. See issue #474:
1270+
beginMux(); // Must come before I2C activity to avoid external devices from corrupting the bus. See issue 474
12681271
// https://github.com/sparkfun/SparkFun_RTK_Firmware/issues/474
12691272

12701273
DMW_b("peripheralsOn");
@@ -1273,6 +1276,7 @@ void setup()
12731276
DMW_b("beginI2C");
12741277
beginI2C(); // Requires settings and peripheral power (if applicable).
12751278

1279+
DMW_b("beginGpioExpanderSwitches");
12761280
beginGpioExpanderSwitches(); // Start the GPIO expander for switch control
12771281

12781282
DMW_b("beginDisplay");
@@ -1323,6 +1327,7 @@ void setup()
13231327
DMW_b("beginRtcmParse");
13241328
beginRtcmParse();
13251329

1330+
DMW_b("tiltDetect");
13261331
tiltDetect(); // If we don't know if there is a tilt compensation sensor, auto-detect it. Uses settings.
13271332

13281333
// DEBUG_NEARLY_EVERYTHING // Debug nearly all the things

0 commit comments

Comments
 (0)