Subversion Repositories Code-Repo

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
312 Kevin 1
#include "defines.h"
2
#include "STEPPER.h"
3
 
4
void STEPPER_Set_Microstep(STEPPER_MICROSTEP step) {
5
#ifdef DVR8825
6
    if (step == STEP_1_1) {
7
        M0_LAT = 0;
8
        M1_LAT = 0;
9
        M2_LAT = 0;
10
    } else if (step == STEP_1_2) {
11
        M0_LAT = 1;
12
        M1_LAT = 0;
13
        M2_LAT = 0;
14
    } else if (step == STEP_1_4) {
15
        M0_LAT = 0;
16
        M1_LAT = 1;
17
        M2_LAT = 0;
18
    } else if (step == STEP_1_8) {
19
        M0_LAT = 1;
20
        M1_LAT = 1;
21
        M2_LAT = 0;
22
    } else if (step == STEP_1_16) {
23
        M0_LAT = 0;
24
        M1_LAT = 0;
25
        M2_LAT = 1;
26
    } else if (step == STEP_1_32) {
27
        M0_LAT = 1;
28
        M1_LAT = 0;
29
        M2_LAT = 1;
30
    }
31
#endif
32
}
33
 
34
void STEPPER_Set_Direction(char dir) {
35
    if (dir) {
36
        DIR_LAT = 1;
37
    } else {
38
        DIR_LAT = 0;
39
    }
40
}