C:/usr/src/avr/plotter/line.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <avr/pgmspace.h>
#include "motori.h"
#include "shvars.h"

Go to the source code of this file.


#define SWAP(a, b)   {(a)^=(b);(b)^=(a);(a)^=(b);}


void move_reset ()
uint8_t motors_ready ()
uint8_t move_is_steep ()
int16_t movestep (int16_t x1, int16_t y1)

Define Documentation

#define SWAP ( a,
 )     {(a)^=(b);(b)^=(a);(a)^=(b);}

Definition at line 24 of file line.c.

Function Documentation

uint8_t motors_ready (  ) 

true if motors are not moving

Definition at line 16 of file line.c.

uint8_t move_is_steep (  ) 

true if X and Y coordinates are swapped

Definition at line 20 of file line.c.

void move_reset (  ) 

Definition at line 12 of file line.c.

int16_t movestep ( int16_t  x1,
int16_t  y1 

Initialize a line, or perform a subsequent line step.

If motors_ready(), initiate a new line from the current location (stepper_loc) to specified (x1,y1). Subsequent steps should make calls with (-1,-1) arguments. Each line step will will call back external function step(x,y), until movement is done.

The movement is calculated using adopted Bresenham's algorithm.

amount of steps after the first call

ordinal number of the current step during movement

See also:
step(x,y) (motori.h)

Definition at line 26 of file line.c.

Generated on Sat Jul 4 05:27:39 2009 for motori by  doxygen 1.5.9