Commit Graph

6 Commits (f6a943812f9c6e8673323a57bda0b4b148a63afe)

Author SHA1 Message Date
Yuri D'Elia b6a676e093 AVR: Do not use __builtin_abs() for long types
In AVR __builtin_abs() breaks for non-base types.

Provide a generic function and use an overload when it is safe to use
instead.

This fixes the underlying step count calculation in PlanMove, thus
removing the need for the PlanLongMove work-around.
2021-11-11 07:41:48 +01:00
D.R.racer 0fbcb9dac2 Tag all source files with @file for doxygen 2021-10-18 17:59:46 +02:00
Yuri D'Elia d23ed53f3c Also fix min/max outside of AVR by using the standard std::min/max 2021-08-30 07:07:19 +02:00
Yuri D'Elia b55c13dec2 Use operators for min/max
Turns out AVR doesn't have __builtin_min/max
2021-08-30 07:07:19 +02:00
Yuri D'Elia fcb1b0c85d cmath.h: convert AVR min/max/abs into templates
At least for min/max this will ensure types for both arguments are the
same.

This should be a little bit closer to the <cmath> definition that
simply overloads these functions instead.
2021-07-13 01:08:33 +02:00
Yuri D'Elia 7d2329cf85 Add src/cmath.h for <math.h> portability between platforms 2021-07-07 16:59:04 +02:00