Исправление выявленных ошибок

- исправление выявленных ошибок
- если используется не-void функция без return, появляется ошибка вместо предупреждения
Co-authored-by: KLASSENTS <klassen@elron.tech>
Co-committed-by: KLASSENTS <klassen@elron.tech>
This commit is contained in:
KLASSENTS 2025-05-28 12:55:19 +03:00 committed by klassents
parent ae811a9847
commit 2cb29ab673
3 changed files with 17 additions and 19 deletions

View File

@ -56,12 +56,11 @@ enum BitOrder
#define NOT_AN_INTERRUPT -1
// Math
#ifdef __cplusplus
#include <algorithm>
using std::min;
using std::max;
#else // C
#include <stdlib.h>
// undefine stdlib's abs if encountered
#ifdef abs
#undef abs
#endif
#ifndef abs
#define abs(x) ((x)>0?(x):-(x))
#endif // abs
@ -74,7 +73,6 @@ enum BitOrder
#define max(a,b) ((a)>(b)?(a):(b))
#endif // max
#endif // __cplusplus
#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
#define radians(deg) ((deg)*DEG_TO_RAD)
#define degrees(rad) ((rad)*RAD_TO_DEG)

View File

@ -94,7 +94,7 @@ struct EEPROMClass{
uint16_t length() { return (uint16_t)EEPROM_LENGHT; }
template< typename T >
T &put(int idx, T &data)
const T &put(int idx, const T &data)
{
void* dataPointer = (void*)&data;
// check if idx is valid

View File

@ -34,8 +34,8 @@ compiler.optimization_flags.debug=-Og -g3
compiler.extra_flags = -march=rv32imc_zicsr_zifencei -mabi=ilp32 -mcmodel=medlow -Wall -fsigned-char -ffunction-sections
compiler.S.flags = {compiler.extra_flags} -x assembler-with-cpp {compiler.define} -I"{runtime.platform.path}/libraries/FreeRTOS/src" {compiler.optimization_flags} {compiler.warning_flags} {compiler.MIK32_Amur.extra_include}
compiler.c.flags = -c -std=gnu11 {compiler.extra_flags} {compiler.define} {compiler.warning_flags} {compiler.optimization_flags} {compiler.MIK32_Amur.extra_include}
compiler.cpp.flags = -c -std=gnu++17 -fabi-version=0 -fno-exceptions -fno-rtti -fno-use-cxa-atexit -fno-threadsafe-statics {compiler.extra_flags} {compiler.define} {compiler.warning_flags} {compiler.optimization_flags} {compiler.MIK32_Amur.extra_include}
compiler.c.flags = -c -std=gnu11 -Werror=return-type {compiler.extra_flags} {compiler.define} {compiler.warning_flags} {compiler.optimization_flags} {compiler.MIK32_Amur.extra_include}
compiler.cpp.flags = -c -std=gnu++17 -fabi-version=0 -fno-exceptions -fno-rtti -fno-use-cxa-atexit -fno-threadsafe-statics -Werror=return-type {compiler.extra_flags} {compiler.define} {compiler.warning_flags} {compiler.optimization_flags} {compiler.MIK32_Amur.extra_include}
compiler.c.elf.flags = -march=rv32imc_zicsr_zifencei -mabi=ilp32 -mcmodel=medlow -nostartfiles -Xlinker
compiler.ar.flags=rc
compiler.elf2bin.flags=-O binary