Skip to content

Commit 2d01ade

Browse files
committed
Use STL instead of redefining macro
Signed-off-by: Frederic.Pillon <[email protected]>
1 parent 447c8ad commit 2d01ade

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

cores/arduino/wiring_constants.h

+1-15
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,8 @@ enum BitOrder {
5757
#define DEFAULT 1
5858
#define EXTERNAL 0
5959

60-
// undefine stdlib's abs if encountered
61-
#ifdef abs
62-
#undef abs
63-
#endif // abs
64-
65-
#ifndef min
66-
#define min(a,b) ((a)<(b)?(a):(b))
67-
#endif // min
68-
69-
#ifndef max
70-
#define max(a,b) ((a)>(b)?(a):(b))
71-
#endif // max
72-
73-
#define abs(x) ((x)>0?(x):-(x))
7460
#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
75-
#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
61+
7662
#define radians(deg) ((deg)*DEG_TO_RAD)
7763
#define degrees(rad) ((rad)*RAD_TO_DEG)
7864
#define sq(x) ((x)*(x))

platform.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ compiler.c.elf.flags=-mthumb {build.flags.optimize} {build.flags.ldspecs} -Wl,--
2828
compiler.S.cmd=arm-none-eabi-gcc
2929
compiler.S.flags=-mthumb -c -x assembler-with-cpp {compiler.stm.extra_include}
3030
compiler.cpp.cmd=arm-none-eabi-g++
31-
compiler.cpp.flags=-mthumb -c {build.flags.optimize} {compiler.warning_flags} -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf -MMD {compiler.stm.extra_include}
31+
compiler.cpp.flags=-mthumb -c {build.flags.optimize} {compiler.warning_flags} -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD {compiler.stm.extra_include}
3232
compiler.ar.cmd=arm-none-eabi-gcc-ar
3333
compiler.ar.flags=rcs
3434
compiler.objcopy.cmd=arm-none-eabi-objcopy
@@ -85,7 +85,7 @@ recipe.S.o.pattern="{compiler.path}{compiler.S.cmd}" {compiler.S.flags} -mcpu={b
8585
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"
8686

8787
## Combine gc-sections, archives, and objects
88-
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mcpu={build.mcu} -DF_CPU={build.f_cpu} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} {compiler.ldflags} -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -Wl,--start-group {object_files} {compiler.arm.cmsis.ldflags} -Wl,--whole-archive "{archive_file_path}" -Wl,--no-whole-archive -lc -Wl,--end-group -lm -lgcc --specs=nano.specs
88+
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mcpu={build.mcu} -DF_CPU={build.f_cpu} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} {compiler.ldflags} -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -Wl,--start-group {object_files} {compiler.arm.cmsis.ldflags} -Wl,--whole-archive "{archive_file_path}" -Wl,--no-whole-archive -lc -Wl,--end-group -lm -lgcc -lstdc++ --specs=nano.specs
8989

9090

9191
## Create output (.bin file)

0 commit comments

Comments
 (0)