Исправление выявленных ошибок
- исправление выявленных ошибок - если используется не-void функция без return, появляется ошибка вместо предупреждения Co-authored-by: KLASSENTS <klassen@elron.tech> Co-committed-by: KLASSENTS <klassen@elron.tech>
This commit is contained in:
parent
ae811a9847
commit
2cb29ab673
@ -56,25 +56,23 @@ enum BitOrder
|
|||||||
#define NOT_AN_INTERRUPT -1
|
#define NOT_AN_INTERRUPT -1
|
||||||
|
|
||||||
// Math
|
// Math
|
||||||
#ifdef __cplusplus
|
#include <stdlib.h>
|
||||||
#include <algorithm>
|
// undefine stdlib's abs if encountered
|
||||||
using std::min;
|
#ifdef abs
|
||||||
using std::max;
|
#undef abs
|
||||||
#else // C
|
#endif
|
||||||
#include <stdlib.h>
|
#ifndef abs
|
||||||
#ifndef abs
|
#define abs(x) ((x)>0?(x):-(x))
|
||||||
#define abs(x) ((x)>0?(x):-(x))
|
#endif // abs
|
||||||
#endif // abs
|
|
||||||
|
|
||||||
#ifndef min
|
#ifndef min
|
||||||
#define min(a,b) ((a)<(b)?(a):(b))
|
#define min(a,b) ((a)<(b)?(a):(b))
|
||||||
#endif // min
|
#endif // min
|
||||||
|
|
||||||
#ifndef max
|
#ifndef max
|
||||||
#define max(a,b) ((a)>(b)?(a):(b))
|
#define max(a,b) ((a)>(b)?(a):(b))
|
||||||
#endif // max
|
#endif // max
|
||||||
|
|
||||||
#endif // __cplusplus
|
|
||||||
#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
|
#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
|
||||||
#define radians(deg) ((deg)*DEG_TO_RAD)
|
#define radians(deg) ((deg)*DEG_TO_RAD)
|
||||||
#define degrees(rad) ((rad)*RAD_TO_DEG)
|
#define degrees(rad) ((rad)*RAD_TO_DEG)
|
||||||
|
|||||||
@ -94,7 +94,7 @@ struct EEPROMClass{
|
|||||||
uint16_t length() { return (uint16_t)EEPROM_LENGHT; }
|
uint16_t length() { return (uint16_t)EEPROM_LENGHT; }
|
||||||
|
|
||||||
template< typename T >
|
template< typename T >
|
||||||
T &put(int idx, T &data)
|
const T &put(int idx, const T &data)
|
||||||
{
|
{
|
||||||
void* dataPointer = (void*)&data;
|
void* dataPointer = (void*)&data;
|
||||||
// check if idx is valid
|
// check if idx is valid
|
||||||
|
|||||||
@ -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.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.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.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 {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.c.elf.flags = -march=rv32imc_zicsr_zifencei -mabi=ilp32 -mcmodel=medlow -nostartfiles -Xlinker
|
||||||
compiler.ar.flags=rc
|
compiler.ar.flags=rc
|
||||||
compiler.elf2bin.flags=-O binary
|
compiler.elf2bin.flags=-O binary
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user