diff --git a/dda.c b/dda.c index b39f2dd..cc06f13 100644 --- a/dda.c +++ b/dda.c @@ -14,10 +14,6 @@ #define ABS(v) (((v) >= 0)?(v):(-(v))) #endif -#ifndef ABSDELTA -#define ABSDELTA(a, b) (((a) >= (b))?((a) - (b)):((b) - (a))) -#endif - /* step timeout */ @@ -35,7 +31,7 @@ TARGET current_position __attribute__ ((__section__ (".bss"))); utility functions */ -// courtesy of http://www.oroboro.com/rafael/docserv.php/index/programming/article/distance +// courtesy of http://www.flipcode.com/archives/Fast_Approximate_Distance_Functions.shtml uint32_t approx_distance( uint32_t dx, uint32_t dy ) { uint32_t min, max, approx; @@ -92,12 +88,6 @@ uint32_t approx_distance_3( uint32_t dx, uint32_t dy, uint32_t dz ) return (( approx + 512 ) >> 10 ); } -uint32_t delta32(uint32_t v1, uint32_t v2) { - if (v1 >= v2) - return v1 - v2; - return v2 - v1; -} - // this is an ultra-crude pseudo-logarithm routine, such that: // 2 ^ msbloc(v) >= v const uint8_t msbloc (uint32_t v) { diff --git a/mendel.c b/mendel.c index 7850956..d83b641 100644 --- a/mendel.c +++ b/mendel.c @@ -1,6 +1,3 @@ -#include -#include -#include #include #include