From 5c5d18fb97ff95e9912822c945c6fbc9bda9dd9f Mon Sep 17 00:00:00 2001 From: lpbeliveau-silabs Date: Tue, 19 Nov 2024 17:11:36 -0500 Subject: [PATCH] reverted unintentional changes --- src/platform/silabs/silabs_utils.cpp | 38 --------------- src/platform/silabs/silabs_utils.h | 43 ----------------- src/platform/silabs/tracing/SilabsTracing.cpp | 48 +++++++++---------- 3 files changed, 24 insertions(+), 105 deletions(-) delete mode 100644 src/platform/silabs/silabs_utils.cpp delete mode 100644 src/platform/silabs/silabs_utils.h diff --git a/src/platform/silabs/silabs_utils.cpp b/src/platform/silabs/silabs_utils.cpp deleted file mode 100644 index c8a068a328..0000000000 --- a/src/platform/silabs/silabs_utils.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2022 Silabs. - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "silabs_utils.h" -#include "SoftwareFaultReports.h" -#include - -void appError(int err) -{ - char faultMessage[30] = { 0 }; // App Critical Error: + 10 digit + null character - snprintf(faultMessage, sizeof faultMessage, "App Critical Error:%d", err); - SILABS_LOG("!!!!!!!!!!!! %s !!!!!!!!!!!", faultMessage); - chip::DeviceLayer::Silabs::OnSoftwareFaultEventHandler(faultMessage); - vTaskSuspendAll(); - /* Force an assert. */ - chipAbort(); -} - -void appError(CHIP_ERROR error) -{ - appError(static_cast(error.AsInteger())); -} diff --git a/src/platform/silabs/silabs_utils.h b/src/platform/silabs/silabs_utils.h deleted file mode 100644 index 93941fbf9c..0000000000 --- a/src/platform/silabs/silabs_utils.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2022 Silabs. - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -// EFR Logging -#ifdef __cplusplus -extern "C" { -#endif - -void silabsInitLog(void); - -void silabsLog(const char * aFormat, ...); -#define SILABS_LOG(...) silabsLog(__VA_ARGS__); -void appError(int err); - -#ifdef __cplusplus -} - -// Output logs to RTT by defaults -#ifndef SILABS_LOG_OUT_UART -#define SILABS_LOG_OUT_UART 0 -#endif - -#include -void appError(CHIP_ERROR error); -#endif diff --git a/src/platform/silabs/tracing/SilabsTracing.cpp b/src/platform/silabs/tracing/SilabsTracing.cpp index 5a6f0e6976..0716b603b5 100644 --- a/src/platform/silabs/tracing/SilabsTracing.cpp +++ b/src/platform/silabs/tracing/SilabsTracing.cpp @@ -35,30 +35,30 @@ namespace Tracing { namespace Silabs { const char * TimeTraceOperationString[] = { - [static_cast(TimeTraceOperation::kSpake2p)] = "Spake2p", - [static_cast(TimeTraceOperation::kPake1)] = "Pake1", - [static_cast(TimeTraceOperation::kPake2)] = "Pake2", - [static_cast(TimeTraceOperation::kPake3)] = "Pake3", - [static_cast(TimeTraceOperation::kOperationalCredentials)] = "OperationalCredentials", - [static_cast(TimeTraceOperation::kAttestationVerification)] = "AttestationVerification", - [static_cast(TimeTraceOperation::kCSR)] = "CSR", - [static_cast(TimeTraceOperation::kNOC)] = "NOC", - [static_cast(TimeTraceOperation::kTransportLayer)] = "TransportLayer", - [static_cast(TimeTraceOperation::kTransportSetup)] = "TransportSetup", - [static_cast(TimeTraceOperation::kFindOperational)] = "FindOperational", - [static_cast(TimeTraceOperation::kCaseSession)] = "CaseSession", - [static_cast(TimeTraceOperation::kSigma1)] = "Sigma1", - [static_cast(TimeTraceOperation::kSigma2)] = "Sigma2", - [static_cast(TimeTraceOperation::kSigma3)] = "Sigma3", - [static_cast(TimeTraceOperation::kOTA)] = "OTA", - [static_cast(TimeTraceOperation::kImageUpload)] = "ImageUpload", - [static_cast(TimeTraceOperation::kImageVerification)] = "ImageVerification", - [static_cast(TimeTraceOperation::kAppApplyTime)] = "AppApplyTime", - [static_cast(TimeTraceOperation::kBootup)] = "Bootup", - [static_cast(TimeTraceOperation::kSilabsInit)] = "SilabsInit", - [static_cast(TimeTraceOperation::kMatterInit)] = "MatterInit", - [static_cast(TimeTraceOperation::kBufferFull)] = "BufferFull", - [static_cast(TimeTraceOperation::kNumTraces)] = "NumTraces", + [to_underlying(TimeTraceOperation::kSpake2p)] = "Spake2p", + [to_underlying(TimeTraceOperation::kPake1)] = "Pake1", + [to_underlying(TimeTraceOperation::kPake2)] = "Pake2", + [to_underlying(TimeTraceOperation::kPake3)] = "Pake3", + [to_underlying(TimeTraceOperation::kOperationalCredentials)] = "OperationalCredentials", + [to_underlying(TimeTraceOperation::kAttestationVerification)] = "AttestationVerification", + [to_underlying(TimeTraceOperation::kCSR)] = "CSR", + [to_underlying(TimeTraceOperation::kNOC)] = "NOC", + [to_underlying(TimeTraceOperation::kTransportLayer)] = "TransportLayer", + [to_underlying(TimeTraceOperation::kTransportSetup)] = "TransportSetup", + [to_underlying(TimeTraceOperation::kFindOperational)] = "FindOperational", + [to_underlying(TimeTraceOperation::kCaseSession)] = "CaseSession", + [to_underlying(TimeTraceOperation::kSigma1)] = "Sigma1", + [to_underlying(TimeTraceOperation::kSigma2)] = "Sigma2", + [to_underlying(TimeTraceOperation::kSigma3)] = "Sigma3", + [to_underlying(TimeTraceOperation::kOTA)] = "OTA", + [to_underlying(TimeTraceOperation::kImageUpload)] = "ImageUpload", + [to_underlying(TimeTraceOperation::kImageVerification)] = "ImageVerification", + [to_underlying(TimeTraceOperation::kAppApplyTime)] = "AppApplyTime", + [to_underlying(TimeTraceOperation::kBootup)] = "Bootup", + [to_underlying(TimeTraceOperation::kSilabsInit)] = "SilabsInit", + [to_underlying(TimeTraceOperation::kMatterInit)] = "MatterInit", + [to_underlying(TimeTraceOperation::kBufferFull)] = "BufferFull", + [to_underlying(TimeTraceOperation::kNumTraces)] = "NumTraces", }; const char * OperationTypeToString(OperationType type)