Merge branch 'master' of github.com:triffid/FiveD_on_Arduino

This commit is contained in:
Michael Moon 2010-09-16 17:15:30 +10:00
commit 6ce5895819
2 changed files with 1 additions and 14 deletions

12
dda.c
View File

@ -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) {

View File

@ -1,6 +1,3 @@
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <avr/io.h>
#include <avr/interrupt.h>