Skip to content
Open
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: 0 additions & 2 deletions libs/bsp/bspInputManager/include/inputManager/DigitalInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

#include <etl/uncopyable.h>

#include <cassert>

namespace bios
{
class DigitalInput : public ::etl::uncopyable
Expand Down
6 changes: 3 additions & 3 deletions libs/bsw/io/include/io/VariantQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

#pragma once

#include <etl/error_handler.h>
#include <etl/memory.h>
#include <etl/span.h>
#include <etl/type_list.h>
#include <etl/type_traits.h>
#include <etl/variant.h>
#include <io/MemoryQueue.h>

#include <cassert>
#include <type_traits>

/**
Expand Down Expand Up @@ -192,15 +192,15 @@ struct variant_q
template<typename Visitor>
static void read(Visitor& visitor, ::etl::span<uint8_t const> const data)
{
assert(data.size() != 0);
ETL_ASSERT(data.size() != 0, ETL_ERROR_GENERIC("Buffer empty"));
return variant_T_do<TypeList>::template call<Visitor, void>(
data[0], data.subspan(1).data(), visitor);
}

template<typename Visitor>
static void read_with_payload(Visitor& visitor, ::etl::span<uint8_t const> const data)
{
assert(data.size() != 0);
ETL_ASSERT(data.size() != 0, ETL_ERROR_GENERIC("Buffer empty"));
return variant_do<TypeList>::template call<Visitor, void>(
data[0], data.subspan(1), visitor);
}
Expand Down
1 change: 0 additions & 1 deletion platforms/posix/bsp/bspUart/src/bsp/Uart.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <bsp/Uart.h>
#include <bsp/uart/UartConfig.h>

#include <cassert>
#include <errno.h>
#include <fcntl.h> // For fcntl and O_NONBLOCK
#include <stdio.h>
Expand Down
19 changes: 11 additions & 8 deletions platforms/s32k1xx/bsp/bspFlexCan/src/can/FlexCANDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
#include <bsp/timer/SystemTimer.h>
#include <bsp/timer/isEqualAfterTimeout.h>
#include <etl/byte_stream.h>
#include <etl/error_handler.h>
#include <etl/span.h>
#include <etl/unaligned_type.h>

#include <cassert>

using namespace can;

namespace bios
Expand Down Expand Up @@ -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(
Expand All @@ -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()
Expand Down