28 #define SOME_LARGE_VALUE 1.0E+38
39 #define A_MOTOR X_AXIS
40 #define B_MOTOR Y_AXIS
42 #define MM_PER_INCH (25.40)
44 #define INCH_PER_MM (0.0393701)
45 #define TICKS_PER_MICROSECOND (F_CPU/1000000)
47 #define DELAY_MODE_DWELL 0
48 #define DELAY_MODE_SYS_SUSPEND 1
49 #define clear_vector(a) memset(a, 0, sizeof(a))
51 #define clear_vector_float(a) memset(a, 0.0, sizeof(float)*N_AXIS)
53 #define max(a,b) (((a) > (b)) ? (a) : (b))
54 #define min(a,b) (((a) < (b)) ? (a) : (b))
55 #define isequal_position_vector(a,b) !(memcmp(a, b, sizeof(float)*N_AXIS))
56 #define bit(n) (1 << n)
58 #define bit_true(x,mask) (x) |= (mask)
59 #define bit_false(x,mask) (x) &= ~(mask)
60 #define bit_istrue(x,mask) ((x & mask) != 0)
61 #define bit_isfalse(x,mask) ((x & mask) == 0)
65 uint8_t
read_float(
char *line, uint8_t *char_counter,
float *float_ptr);
67 void delay_sec(
float seconds, uint8_t mode);
73 float hypot_f(
float x,
float y);
float limit_value_by_axis_maximum(float *max_value, float *unit_vec)
uint8_t read_float(char *line, uint8_t *char_counter, float *float_ptr)
Read a floating point value from a string. Line points to the input buffer, char_counter.
void delay_us(uint32_t us)
Delays variable-defined microseconds. Compiler compatibility fix for _delay_us(). ...
float convert_delta_vector_to_unit_vector(float *vector)
float hypot_f(float x, float y)
Computes hypotenuse, avoiding avr-gcc's bloated version and the extra error checking.
void delay_sec(float seconds, uint8_t mode)
Non-blocking delay function used for general operation and suspend features.
void delay_ms(uint16_t ms)
Delays variable-defined milliseconds. Compiler compatibility fix for _delay_ms(). ...