Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Libs/Dronecan
2 changes: 1 addition & 1 deletion Libs/libparams
8 changes: 6 additions & 2 deletions Src/modules/application/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,14 @@ static int8_t init_board_periphery() {
if (paramsLoad() != 0) {
return -1;
}
if (!paramsIsCrcValid()) {
(void)paramsSave();
bool is_erased = false;
(void)paramsIsErased(&is_erased);

if (!paramsIsCrcValid() && is_erased) {
(void)paramsResetToDefault();
}


#if defined(CAN1_TERMINATOR_Pin) && defined(CAN2_TERMINATOR_Pin)
auto teminator_param = paramsGetIntegerValue(IntParamsIndexes::PARAM_SYSTEM_CAN_TEMINATOR);

Expand Down
4 changes: 3 additions & 1 deletion Src/modules/system/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ REGISTER_MODULE(SystemModule)

void SystemModule::init() {
need_notification = paramsGetIntegerValue(IntParamsIndexes::PARAM_LOG_LEVEL) <= 1;
set_health(Status::OK);
set_health(paramsIsCrcValid()
? Status::OK
: Status::MINOR_FAILURE);
set_mode(Mode::STANDBY);
}

Expand Down
Loading