From 7ebd33cb40aa50f187d7eaa7e44ce3499a6a2a3b Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 6 Feb 2013 01:17:12 +0000 Subject: cleanup git-svn-id: https://svn.spreadspace.org/avr/trunk@124 aa12f405-d877-488e-9caf-2d797e2a1cc7 --- usb-i2c-sl018/stepper.c | 33 ++++++--------------------------- 1 file changed, 6 insertions(+), 27 deletions(-) (limited to 'usb-i2c-sl018/stepper.c') diff --git a/usb-i2c-sl018/stepper.c b/usb-i2c-sl018/stepper.c index 4258da7..d6508e7 100644 --- a/usb-i2c-sl018/stepper.c +++ b/usb-i2c-sl018/stepper.c @@ -25,21 +25,7 @@ #include #include "stepper.h" -//half steps -/* -uint8_t step_table [] = -{ - 10, // 1010 - 8, // 1000 - 9, // 1001 - 1, // 0001 - 5, // 0101 - 4, // 0100 - 6, // 0110 - 2, // 0010 -}; -*/ -//Full steps + uint8_t step_table [] = { 10, // 1010 @@ -62,7 +48,6 @@ stepper_direction_t step_direction = dir_open; inline void stop_stepper(void) { - // stop timer here STEPPER_PORT &= ~(0xF << STEPPER_FIRST_BIT | 1<= STEP_CNT_OFF) { + if(step_cnt >= STEP_CNT_OFF) return 0; - } return 1; } @@ -103,22 +87,17 @@ uint8_t start_stepper(stepper_direction_t direction) step_cnt = 0; step_direction = direction; STEPPER_PORT |= 1< 2 ms @ 16 MHz - //OCR1A = 155; // (1+155)*256 = 40000 -> 2 ms @ 20 MHz - TCNT1 = 0; // reseting timer - TIMSK1 = 1< 2 ms @ 16 MHz + TCNT1 = 0; + TIMSK1 = 1<