diff --git a/libraries/AP_Logger/AP_Logger.cpp b/libraries/AP_Logger/AP_Logger.cpp index cf70cfac32..72a32cf58a 100644 --- a/libraries/AP_Logger/AP_Logger.cpp +++ b/libraries/AP_Logger/AP_Logger.cpp @@ -834,7 +834,7 @@ void AP_Logger::WriteV(const char *name, const char *labels, const char *units, if (f == nullptr) { // unable to map name to a messagetype; could be out of // msgtypes, could be out of slots, ... - AP::internalerror().error(AP_InternalError::error_t::logger_mapfailure); + INTERNAL_ERROR(AP_InternalError::error_t::logger_mapfailure); return; } diff --git a/libraries/AP_Logger/AP_Logger_Backend.cpp b/libraries/AP_Logger/AP_Logger_Backend.cpp index 187e825540..66b798a9a4 100644 --- a/libraries/AP_Logger/AP_Logger_Backend.cpp +++ b/libraries/AP_Logger/AP_Logger_Backend.cpp @@ -159,7 +159,7 @@ bool AP_Logger_Backend::Write_Emit_FMT(uint8_t msg_type) // this is a bug; we've been asked to write out the FMT // message for a msg_type, but the frontend can't supply the // required information - AP::internalerror().error(AP_InternalError::error_t::logger_missing_logstructure); + INTERNAL_ERROR(AP_InternalError::error_t::logger_missing_logstructure); return false; } @@ -189,7 +189,7 @@ bool AP_Logger_Backend::Write(const uint8_t msg_type, va_list arg_list, bool is_ } } if (fmt == nullptr) { - AP::internalerror().error(AP_InternalError::error_t::logger_logwrite_missingfmt); + INTERNAL_ERROR(AP_InternalError::error_t::logger_logwrite_missingfmt); return false; } if (bufferspace_available() < msg_len) { diff --git a/libraries/AP_Logger/AP_Logger_File.cpp b/libraries/AP_Logger/AP_Logger_File.cpp index 531b2c247f..69b8ef0431 100644 --- a/libraries/AP_Logger/AP_Logger_File.cpp +++ b/libraries/AP_Logger/AP_Logger_File.cpp @@ -301,12 +301,12 @@ void AP_Logger_File::Prep_MinSpace() } if (count++ > MAX_LOG_FILES+10) { // *way* too many deletions going on here. Possible internal error. - AP::internalerror().error(AP_InternalError::error_t::logger_too_many_deletions); + INTERNAL_ERROR(AP_InternalError::error_t::logger_too_many_deletions); break; } char *filename_to_remove = _log_file_name(log_to_remove); if (filename_to_remove == nullptr) { - AP::internalerror().error(AP_InternalError::error_t::logger_bad_getfilename); + INTERNAL_ERROR(AP_InternalError::error_t::logger_bad_getfilename); break; } if (file_exists(filename_to_remove)) { @@ -895,7 +895,7 @@ void AP_Logger_File::flush(void) } write_fd_semaphore.give(); } else { - AP::internalerror().error(AP_InternalError::error_t::logger_flushing_without_sem); + INTERNAL_ERROR(AP_InternalError::error_t::logger_flushing_without_sem); } } #else diff --git a/libraries/AP_Logger/AP_Logger_MAVLink.cpp b/libraries/AP_Logger/AP_Logger_MAVLink.cpp index ac1758abda..9134785d22 100644 --- a/libraries/AP_Logger/AP_Logger_MAVLink.cpp +++ b/libraries/AP_Logger/AP_Logger_MAVLink.cpp @@ -149,7 +149,7 @@ bool AP_Logger_MAVLink::_WritePrioritisedBlock(const void *pBuffer, uint16_t siz _current_block = next_block(); if (_current_block == nullptr) { // should not happen - there's a sanity check above - AP::internalerror().error(AP_InternalError::error_t::logger_bad_current_block); + INTERNAL_ERROR(AP_InternalError::error_t::logger_bad_current_block); semaphore.give(); return false; } @@ -401,7 +401,7 @@ void AP_Logger_MAVLink::stats_collect() uint8_t sfree = stack_size(_blocks_free); if (sfree != _blockcount_free) { - AP::internalerror().error(AP_InternalError::error_t::logger_blockcount_mismatch); + INTERNAL_ERROR(AP_InternalError::error_t::logger_blockcount_mismatch); } semaphore.give(); @@ -456,7 +456,7 @@ bool AP_Logger_MAVLink::send_log_blocks_from_queue(dm_block_queue_t &queue) if (tmp != nullptr) { // should never be nullptr enqueue_block(_blocks_sent, tmp); } else { - AP::internalerror().error(AP_InternalError::error_t::logger_dequeue_failure); + INTERNAL_ERROR(AP_InternalError::error_t::logger_dequeue_failure); } } return true; diff --git a/libraries/AP_Logger/LogStructure.h b/libraries/AP_Logger/LogStructure.h index 38b6dbded8..3b5fb70256 100644 --- a/libraries/AP_Logger/LogStructure.h +++ b/libraries/AP_Logger/LogStructure.h @@ -1684,6 +1684,7 @@ struct PACKED log_Arm_Disarm { // @Field: Task: Current scheduler task number // @Field: IErr: Internal error mask; which internal errors have been detected // @Field: IErrCnt: Internal error count; how many internal errors have been detected +// @Field: IErrLn: Line on which internal error ocurred // @Field: MavMsg: Id of the last mavlink message processed // @Field: MavCmd: Id of the last mavlink command processed // @Field: SemLine: Line number of semaphore most recently taken