添加初始化失败异常处理机制
This commit is contained in:
parent
766ebb14c2
commit
73ff32ae38
12
src/main.cpp
12
src/main.cpp
|
@ -13,17 +13,23 @@ DataRecorder dataRec;
|
|||
InterSerial interSerial;
|
||||
UpperSerial upperSerial;
|
||||
|
||||
static void Halt()
|
||||
{
|
||||
while (1) {
|
||||
delay(1000);
|
||||
}
|
||||
}
|
||||
|
||||
void setup()
|
||||
{
|
||||
if (fs.Init()) {
|
||||
return;
|
||||
Halt();
|
||||
}
|
||||
if (cfg.Init(&fs)) {
|
||||
return;
|
||||
Halt();
|
||||
}
|
||||
if (dataRec.Init(&fs)) {
|
||||
return;
|
||||
Halt();
|
||||
}
|
||||
interSerial.Init(&dataRec, &cfg);
|
||||
upperSerial.Init(&dataRec, &cfg);
|
||||
|
|
Reference in New Issue