diff --git a/libs/bsp/bspInputManager/include/inputManager/DigitalInput.h b/libs/bsp/bspInputManager/include/inputManager/DigitalInput.h index 9c2fe005d8e..ade442e5602 100644 --- a/libs/bsp/bspInputManager/include/inputManager/DigitalInput.h +++ b/libs/bsp/bspInputManager/include/inputManager/DigitalInput.h @@ -8,8 +8,6 @@ #include -#include - namespace bios { class DigitalInput : public ::etl::uncopyable diff --git a/libs/bsw/io/include/io/VariantQueue.h b/libs/bsw/io/include/io/VariantQueue.h index eac6151e97a..060122b7a2c 100644 --- a/libs/bsw/io/include/io/VariantQueue.h +++ b/libs/bsw/io/include/io/VariantQueue.h @@ -2,6 +2,7 @@ #pragma once +#include #include #include #include @@ -9,7 +10,6 @@ #include #include -#include #include /** @@ -192,7 +192,7 @@ struct variant_q template static void read(Visitor& visitor, ::etl::span const data) { - assert(data.size() != 0); + ETL_ASSERT(data.size() != 0, ETL_ERROR_GENERIC("Buffer empty")); return variant_T_do::template call( data[0], data.subspan(1).data(), visitor); } @@ -200,7 +200,7 @@ struct variant_q template static void read_with_payload(Visitor& visitor, ::etl::span const data) { - assert(data.size() != 0); + ETL_ASSERT(data.size() != 0, ETL_ERROR_GENERIC("Buffer empty")); return variant_do::template call( data[0], data.subspan(1), visitor); } diff --git a/platforms/posix/bsp/bspUart/src/bsp/Uart.cpp b/platforms/posix/bsp/bspUart/src/bsp/Uart.cpp index 1f7a4e3c787..ee9fe25fd29 100644 --- a/platforms/posix/bsp/bspUart/src/bsp/Uart.cpp +++ b/platforms/posix/bsp/bspUart/src/bsp/Uart.cpp @@ -1,7 +1,6 @@ #include #include -#include #include #include // For fcntl and O_NONBLOCK #include diff --git a/platforms/s32k1xx/bsp/bspFlexCan/src/can/FlexCANDevice.cpp b/platforms/s32k1xx/bsp/bspFlexCan/src/can/FlexCANDevice.cpp index fd803622721..030c2aca74d 100644 --- a/platforms/s32k1xx/bsp/bspFlexCan/src/can/FlexCANDevice.cpp +++ b/platforms/s32k1xx/bsp/bspFlexCan/src/can/FlexCANDevice.cpp @@ -9,11 +9,10 @@ #include #include #include +#include #include #include -#include - using namespace can; namespace bios @@ -44,15 +43,17 @@ FlexCANDevice::FlexCANDevice( case 0x40025000UL: fIndex = 1; break; case 0x4002B000UL: fIndex = 2; break; - default: assert(1); + default: ETL_ASSERT_FAIL(ETL_ERROR_GENERIC("Unsupported baseAddress")); } // Buffers 0..16 are used for reception - assert(fConfig.numRxBufsExt + fConfig.numRxBufsStd <= FIRST_TRANSMIT_BUFFER); + ETL_ASSERT( + fConfig.numRxBufsExt + fConfig.numRxBufsStd <= FIRST_TRANSMIT_BUFFER, + ETL_ERROR_GENERIC("Bad reception buffer")); // Buffers 16..31 are used for transmission (application), // buffer CALLBACK_TRANSMIT_BUFFER for transport transmission - assert(fConfig.numTxBufsApp <= 31); + ETL_ASSERT(fConfig.numTxBufsApp <= 31, ETL_ERROR_GENERIC("Bad transmission buffer")); } FlexCANDevice::FlexCANDevice( @@ -77,14 +78,16 @@ FlexCANDevice::FlexCANDevice( case 0x40025000UL: fIndex = 1; break; case 0x4002B000UL: fIndex = 2; break; - default: assert(1); + default: ETL_ASSERT_FAIL(ETL_ERROR_GENERIC("Unsupported baseAddress")); } // Buffers 0..16 are used for reception - assert(fConfig.numRxBufsExt + fConfig.numRxBufsStd <= FIRST_TRANSMIT_BUFFER); + ETL_ASSERT( + fConfig.numRxBufsExt + fConfig.numRxBufsStd <= FIRST_TRANSMIT_BUFFER, + ETL_ERROR_GENERIC("Bad reception buffer")); // Buffers 16..31 are used for transmission (application), // buffer CALLBACK_TRANSMIT_BUFFER for transport transmission - assert(fConfig.numTxBufsApp <= 31); + ETL_ASSERT(fConfig.numTxBufsApp <= 31, ETL_ERROR_GENERIC("Bad transmission buffer")); } ICanTransceiver::ErrorCode FlexCANDevice::init()