Skip to content
Merged
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: 1 addition & 1 deletion lib/inc/datalogging/scrutiny_datalogger_raw_encoder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ namespace scrutiny
inline void set_timebase(Timebase const *const timebase) { m_timebase = timebase; }
inline datalogging::buffer_size_t get_entry_write_counter(void) const { return m_entry_write_counter; }
inline datalogging::buffer_size_t get_data_write_counter(void) const { return m_entry_write_counter * m_entry_size; }
inline datalogging::EncodingType::eEncodingType get_encoding(void) const { return ENCODING; }
static inline datalogging::EncodingType::eEncodingType get_encoding(void) { return ENCODING; }
inline datalogging::buffer_size_t get_read_cursor(void) const { return m_first_valid_entry_index * m_entry_size; }
inline datalogging::buffer_size_t get_write_cursor(void) const { return m_next_entry_write_index * m_entry_size; }
inline bool error(void) const { return m_error; }
Expand Down
4 changes: 2 additions & 2 deletions lib/inc/protocol/scrutiny_comm_handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace scrutiny
/// @brief Tells if the Request object has a CRC that matches its payload content.
/// @param req The request to check
/// @return True if the CRC is valid. False otherwise
bool check_crc(Request const *const req) const;
static bool check_crc(Request const *const req);

// Writes the CRC property of the response based on the payload content.
void add_crc(Response *const response) const;
Expand Down Expand Up @@ -137,7 +137,7 @@ namespace scrutiny
protected:
void process_active_request(void);
bool received_discover_request(void);
bool received_connect_request(void);
bool received_connect_request(void) const;

class RxFSMState
{
Expand Down
4 changes: 2 additions & 2 deletions lib/src/protocol/scrutiny_comm_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ namespace scrutiny
}

// Check if the last request received is a valid "Comm Discover request".
bool CommHandler::received_connect_request(void)
bool CommHandler::received_connect_request(void) const
{
if (m_active_request.command_id != static_cast<uint8_t>(CommandId::CommControl))
{
Expand Down Expand Up @@ -471,7 +471,7 @@ namespace scrutiny
return m_nbytes_to_send - m_nbytes_sent;
}

bool CommHandler::check_crc(Request const *const req) const
bool CommHandler::check_crc(Request const *const req)
{
uint32_t crc = 0;
uint8_t header_data[4];
Expand Down
14 changes: 7 additions & 7 deletions lib/src/scrutiny_tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,29 @@ namespace scrutiny
{
namespace tools
{
VariableTypeSize::eVariableTypeSize get_required_type_size(uint_fast8_t const newsize)
VariableTypeSize::eVariableTypeSize get_required_type_size(uint_fast8_t const size)
{
if (newsize <= 1)
if (size <= 1)
{
return VariableTypeSize::_8;
}
else if (newsize <= 2)
else if (size <= 2)
{
return VariableTypeSize::_16;
}
else if (newsize <= 4)
else if (size <= 4)
{
return VariableTypeSize::_32;
}
else if (newsize <= 8)
else if (size <= 8)
{
return VariableTypeSize::_64;
}
else if (newsize <= 16)
else if (size <= 16)
{
return VariableTypeSize::_128;
}
else if (newsize <= 32)
else if (size <= 32)
{
return VariableTypeSize::_256;
}
Expand Down
1 change: 1 addition & 0 deletions scripts/static_analysis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ CPPCHECK_ARGS="-I $LIB_ROOT/inc $LIB_ROOT \
--suppress=preprocessorErrorDirective
--suppress=unmatchedSuppression
--inline-suppr
--inconclusive
-DSCRUTINY_STATIC_ANALYSIS"

PLATFORMS="unix32 unix64 win32A win32W win64 avr8 elbrus-e1cp pic8 pic8-enhanced pic16 mips32 native"
Expand Down