Skip to content

Commit 7447c5d

Browse files
committed
Removing error console and restoring assert functionality
1 parent fa8a2ea commit 7447c5d

File tree

6 files changed

+6
-30
lines changed

6 files changed

+6
-30
lines changed

Fw/Port/PortBase.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ namespace Fw {
8585
FW_ASSERT(size > 0);
8686
// Get the port-custom format string
8787
const char* formatString = this->getToStringFormatString();
88-
// Determine this port object name (or use "UNKOWN")
88+
// Determine this port object name (or use "UNKNOWN")
8989
const char* object_name =
9090
#if FW_OBJECT_NAMES == 1
9191
this->m_objName.toChar();
@@ -95,7 +95,7 @@ namespace Fw {
9595
// Get the C/NC for connected or not
9696
const char* this_is_connected = this->isConnected() ? "C" : "NC";
9797

98-
// Get the name of the connectioned object, "UNKNNOWN" or "NONE"
98+
// Get the name of the connection object, "UNKNOWN" or "NONE"
9999
const char* connected_to = this->isConnected() ?
100100
#if FW_OBJECT_NAMES == 1
101101
this->m_connObj->getObjName()

Fw/Types/Assert.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#include <FpConfig.hpp>
22
#include <Fw/Types/Assert.hpp>
33
#include <Fw/Types/ExternalString.hpp>
4-
#include <Fw/Logger/Logger.hpp>
4+
#include <Fw/Types/StringUtils.hpp>
55
#include <cassert>
6+
#include <cstdio>
67

78
#if FW_ASSERT_LEVEL == FW_FILEID_ASSERT
89
#define fileIdFs "Assert: 0x%08" PRIx32 ":%" PRI_PlatformUIntType
@@ -13,7 +14,7 @@
1314
namespace Fw {
1415

1516
void defaultPrintAssert(const CHAR* msg) {
16-
Fw::Logger::log("%s", msg);
17+
(void) fwrite(msg, sizeof(CHAR), static_cast<size_t>(Fw::StringUtils::string_length(msg, FW_ASSERT_TEXT_SIZE)), stderr);
1718
}
1819

1920
void defaultReportAssert(FILE_NAME_ARG file,

Os/Posix/CMakeLists.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,6 @@ register_fprime_module(Os_Posix_Shared)
2525
register_os_implementation("File;FileSystem;Directory" Posix Os_Posix_Shared)
2626
register_os_implementation("Console" Posix)
2727

28-
# Special error console
29-
set(MOD_DEPS "Os_Console_Common")
30-
add_library("Os_Console_PosixError" INTERFACE)
31-
add_dependencies("Os_Console_PosixError" "Os_Console_Common" "Os_Console_Posix")
32-
target_link_libraries("Os_Console_PosixError" INTERFACE "Os_Console_Common" "Os_Console_Posix")
33-
register_fprime_implementation("Os_Console" "Os_Console_PosixError" "${CMAKE_CURRENT_LIST_DIR}/DefaultErrorConsole.cpp")
34-
3528
register_os_implementation("Task" Posix Os_Posix_Shared Fw_Time)
3629
register_os_implementation("Mutex;ConditionVariable" Posix Os_Posix_Shared)
3730
register_os_implementation("RawTime" Posix Os_Posix_Shared)

Os/Posix/DefaultErrorConsole.cpp

Lines changed: 0 additions & 16 deletions
This file was deleted.

Os/Stub/test/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ register_os_implementation(Memory Test_Stub)
1919
register_os_implementation(Queue Test_Stub)
2020
register_os_implementation(RawTime Test_Stub) # add Fw_Buffer here?
2121

22-
# Use the error console for this
23-
choose_fprime_implementation(Os_Console Os_Console_PosixError)
2422
#### File Stub Testing ####
2523
set(UT_SOURCE_FILES
2624
"${CMAKE_CURRENT_LIST_DIR}/ut/StubFileTests.cpp"

cmake/API.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ endfunction()
669669
# Designates that the given implementor is the selected implementor for the needed implementation. Platforms must call
670670
# this function once for each defined IMPLEMENTATION. An executable/deployment/unit-test may call this function to set
671671
# a specific implementor for any needed implementation. FRAMEWORK_DEFAULT may be supplied to indicate a default choice
672-
# set by the framework, which can be overriden by the platform and module selections.
672+
# set by the framework, which can be overridden by the platform and module selections.
673673
#
674674
# **IMPLEMENTATION:** implementation module name that is implemented by IMPLEMENTOR
675675
# **IMPLEMENTOR:** implementor of IMPLEMENTATION

0 commit comments

Comments
 (0)