Skip to content

Commit 0f45f25

Browse files
committed
improve reliability at boot
1 parent edb3e51 commit 0f45f25

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

examples/utility/Provisioning_2.0/OptaFactoryTest.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,12 @@ void OptaFactoryTestClass::begin() {
5959

6060
/* Set ADC resolution to 12 bits */
6161
analogReadResolution(12);
62-
SCB_DisableDCache();
62+
do{
63+
_info = boardInfo();
64+
} while (_info == nullptr);
6365

6466
}
6567
void OptaFactoryTestClass::optaIDTest() {
66-
_info = boardInfo();
6768
if(_info->magic == 0xB5)
6869
{
6970
if(_info->vid == VID_FINDER)
@@ -299,6 +300,9 @@ void OptaFactoryTestClass::inputManage(void)
299300
digitalWrite(LEDG, LOW);
300301
digitalWrite(LEDB, LOW);
301302
_all_on = false;
303+
if(_info->_board_functionalities.rs485 == 0) {
304+
_test_running = false;
305+
}
302306
}
303307
}
304308

examples/utility/Provisioning_2.0/OptaFactoryTest.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class OptaFactoryTestClass {
2424
bool _all_on = false;
2525
bool _rs485_test_done = false;
2626
bool _test_running = false;
27-
OptaBoardInfo *_info;
27+
OptaBoardInfo *_info = nullptr;
2828
uint32_t _ms10 = 0;
2929
uint32_t _ms100 = 0;
3030
uint32_t _nextBoardInfoPrint = 0;

0 commit comments

Comments
 (0)