-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.h
63 lines (58 loc) · 1.54 KB
/
config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef CONFIG_H
#define CONFIG_H
#define F_CPU 8000000UL
#define OVERFLOWS_PER_SECOND_TIMER1 256 /*Сколько раз переполняется таймер 1 за одну секунду*/
/*соответственно максимально возможная скорость -- это 3 м/мин достигается при F=6000*/
#define CPU_FREQURENCY 8000000
#define PWM_PORT PORTA
#define PWM_PIN PORTA7
#define PORT_X PORTC
#define CLEAR_X 0b00001111
#define PORT_Y PORTC
#define CLEAR_Y 0b11110000
#define PORT_Z PORTB
#define CLEAR_Z 0b00001111
#define PORT_E PORTB
#define CLEAR_E 0b11110000
#define PHASE_LENGTH 8
#define BUFFER_LENGTH 64
#define ERROR_BUFFER_OVERFOLLOW PSTR("Error: the commant buffer full!\n")
#define WARNING_NOTHING_TO_DO PSTR("Warning: nothing to do!\n")
#define WARNING_UNSUPPORTED_COMMAND PSTR("Warning: unsupported command!\n")
#define ERROR_CHECKSUM_FAILED PSTR("rs\n")
#define SUCCESS_DONE PSTR("ok\n")
#define WARNING_WAITING PSTR("_\n")
#define ABSOLUTE_POSITIONING 0b01000000
#define NEW_TASK 0b10000000
#define STEPS_PER_X 5
#define STEPS_PER_Y 5
#define STEPS_PER_Z 304
#define STEPS_PER_E 5
#define MAX_ALLOWED_SPEED_X 5000
#define MAX_ALLOWED_SPEED_Y 5000
#define MAX_ALLOWED_SPEED_Z 1000
#define MAX_ALLOWED_SPEED_E 1000
#define INITIAL_F 1000
#define INC_X 1
#define DEC_X -1
#define INC_Y 2
#define DEC_Y -2
#define INC_Z 3
#define DEC_Z -3
#define INC_E 4
#define DEC_E -4
struct vector
{
float x;
float y;
float z;
float e;
};
struct discret_vector
{
long x;
long y;
long z;
long e;
};
#endif