Skip to content

Commit a717ccf

Browse files
committed
Fixed factory programming
1 parent 4bf12cf commit a717ccf

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

examples/Inkplate4TEMPERA/Diagnostics/Inkplate4TEMPERA_Factory_Programming_VCOM/Inkplate4TEMPERA_Factory_Programming_VCOM.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ void setup()
8282
if (result == 5)
8383
{
8484
Serial.println("I2C Bus Error!");
85-
failHandler();
85+
failHandler(true);
8686
}
8787
}
8888

examples/Inkplate4TEMPERA/Diagnostics/Inkplate4TEMPERA_Factory_Programming_VCOM/test.cpp

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ void testPeripheral()
221221
display.println("FAIL");
222222
failHandler();
223223
}
224-
224+
225225
// Check BME sensor
226226
float bmeTemp, bmeHumidity, bmePres;
227227
ADD_PRINT_MARGIN
@@ -254,7 +254,7 @@ void testPeripheral()
254254
}
255255
// Put it back to sleep to save power
256256
display.sleepPeripheral(INKPLATE_BME688);
257-
257+
258258
// Check the fuel gauge
259259
int fuelGaugeSOC, fuelGaugeVolts;
260260
ADD_PRINT_MARGIN
@@ -281,7 +281,7 @@ void testPeripheral()
281281
}
282282
// Put it back to sleep
283283
display.sleepPeripheral(INKPLATE_FUEL_GAUGE);
284-
284+
285285

286286
// Test the gyroscope
287287
float gyroAccX, gyroAccY, gyroAccZ;
@@ -313,7 +313,7 @@ void testPeripheral()
313313
}
314314
// Put it back to sleep
315315
display.sleepPeripheral(INKPLATE_ACCELEROMETER);
316-
316+
317317
// Check the gesture sensor
318318
ADD_PRINT_MARGIN
319319
display.print("- Check gesture sensor (swipe, 30s): ");
@@ -730,11 +730,18 @@ int checkGyroscope(float *acX, float *acY, float *acZ)
730730
}
731731

732732
// Show a message and stop the code from executing.
733-
void failHandler()
733+
void failHandler(bool printErrorOnSerial)
734734
{
735-
ADD_PRINT_MARGIN
736-
display.print(" -> Test stopped!");
737-
display.partialUpdate(0, 1);
735+
if (printErrorOnSerial)
736+
{
737+
Serial.println(" -> Test stopped!");
738+
}
739+
else
740+
{
741+
ADD_PRINT_MARGIN
742+
display.print(" -> Test stopped!");
743+
display.partialUpdate(0, 1);
744+
}
738745

739746
// Inf. loop... halt the program!
740747
while (true)

examples/Inkplate4TEMPERA/Diagnostics/Inkplate4TEMPERA_Factory_Programming_VCOM/test.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ int checkFuelGauge(int *_soc, int *_volts);
2828
int checkGestureSensor(int _gestTimeout, String * gesture);
2929
int checkGyroscope(float * acX, float * acY, float * acZ);
3030
void checkBuzzer();
31-
void failHandler();
31+
void failHandler(bool printErrorOnSerial = false);
3232
void IRAM_ATTR ISR();
3333

3434
#endif

0 commit comments

Comments
 (0)