File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -81,19 +81,36 @@ void identifyBoard()
81
81
if (productVariant == RTK_UNKNOWN)
82
82
{
83
83
// Torch
84
- // Check if a bq40Z50 battery manager is on the I2C bus
84
+ // Check if unique ICs are on the I2C bus
85
85
if (i2c_0 == nullptr )
86
86
i2c_0 = new TwoWire (0 );
87
87
int pin_SDA = 15 ;
88
88
int pin_SCL = 4 ;
89
89
90
90
i2c_0->begin (pin_SDA, pin_SCL); // SDA, SCL
91
+
91
92
// 0x0B - BQ40Z50 Li-Ion Battery Pack Manager / Fuel gauge
92
93
bool bq40z50Present = i2cIsDevicePresent (i2c_0, 0x0B );
94
+
95
+ // 0x5C - MP2762A Charger
96
+ bool mp2762aPresent = i2cIsDevicePresent (i2c_0, 0x5C );
97
+
98
+ // 0x08 - HUSB238 - USB C PD Sink Controller
99
+ bool husb238Present = i2cIsDevicePresent (i2c_0, 0x08 );
100
+
93
101
i2c_0->end ();
94
102
95
- if (bq40z50Present)
103
+ if (bq40z50Present || mp2762aPresent || husb238Present )
96
104
productVariant = RTK_TORCH;
105
+
106
+ if (productVariant == RTK_TORCH && bq40z50Present == false )
107
+ systemPrintln (" Error: Torch ID'd with no BQ40Z50 present" );
108
+
109
+ if (productVariant == RTK_TORCH && mp2762aPresent == false )
110
+ systemPrintln (" Error: Torch ID'd with no MP2762A present" );
111
+
112
+ if (productVariant == RTK_TORCH && husb238Present == false )
113
+ systemPrintln (" Error: Torch ID'd with no HUSB238 present" );
97
114
}
98
115
99
116
if (productVariant == RTK_UNKNOWN)
You can’t perform that action at this time.
0 commit comments