Marlin.h

Thu, 07 Jul 2016 12:23:34 +0200

author
mbayer
date
Thu, 07 Jul 2016 12:23:34 +0200
changeset 2
b373b0288715
parent 0
2c8ba1964db7
permissions
-rw-r--r--

added missing sanguino files

0
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
1 // Tonokip RepRap firmware rewrite based off of Hydra-mmm firmware.
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
2 // Licence: GPL
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
3
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
4 #ifndef MARLIN_H
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
5 #define MARLIN_H
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
6
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
7 #define FORCE_INLINE __attribute__((always_inline)) inline
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
8
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
9 #include <math.h>
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
10 #include <stdio.h>
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
11 #include <stdlib.h>
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
12 #include <string.h>
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
13 #include <inttypes.h>
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
14
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
15 #include <util/delay.h>
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
16 #include <avr/pgmspace.h>
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
17 #include <avr/eeprom.h>
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
18 #include <avr/wdt.h>
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
19 #include <avr/interrupt.h>
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
20
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
21
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
22 #include "fastio.h"
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
23
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
24 #include "Configuration.h"
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
25
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
26 #ifndef REPRAPPRO_MULTIMATERIALS
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
27 #define HardwareSerial_h // trick to disable the standard HWserial
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
28 #endif
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
29 #include "pins.h"
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
30
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
31 #if ARDUINO >= 100
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
32 #include "Arduino.h"
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
33 #else
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
34 #include "WProgram.h"
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
35 #endif
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
36
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
37 #include "MarlinSerial.h"
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
38
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
39 #ifndef cbi
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
40 #define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
41 #endif
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
42 #ifndef sbi
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
43 #define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
44 #endif
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
45
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
46 #include "WString.h"
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
47
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
48 #ifdef REPRAPPRO_MULTIMATERIALS
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
49 #define MYSERIAL Serial
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
50 #define MYSERIAL1 Serial1
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
51 #else
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
52
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
53 #if MOTHERBOARD == 8 // Teensylu
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
54 #define MYSERIAL Serial
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
55 #define MYSERIAL1 Serial1
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
56 #else
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
57 #define MYSERIAL MSerial
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
58 #endif
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
59
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
60 #endif
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
61
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
62 //this is a unfinsihed attemp to removes a lot of warning messages, see:
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
63 // http://www.avrfreaks.net/index.php?name=PNphpBB2&file=printview&t=57011
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
64 //typedef char prog_char PROGMEM;
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
65 // //#define PSTR (s ) ((const PROGMEM char *)(s))
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
66 // //# define MYPGM(s) (__extension__({static prog_char __c[] = (s); &__c[0];}))
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
67 // //#define MYPGM(s) ((const prog_char *g PROGMEM=s))
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
68 #define MYPGM(s) PSTR(s)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
69 //#define MYPGM(s) (__extension__({static char __c[] __attribute__((__progmem__)) = (s); &__c[0];})) //This is the normal behaviour
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
70 //#define MYPGM(s) (__extension__({static prog_char __c[] = (s); &__c[0];})) //this does not work but hides the warnings
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
71
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
72
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
73 #define SERIAL_PROTOCOL(x) MYSERIAL.print(x);
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
74 #define SERIAL_PROTOCOL_F(x,y) MYSERIAL.print(x,y);
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
75 #define SERIAL_PROTOCOLPGM(x) serialprintPGM(MYPGM(x));
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
76 #define SERIAL_PROTOCOLLN(x) {MYSERIAL.print(x);MYSERIAL.write('\n');}
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
77 #define SERIAL_PROTOCOLLNPGM(x) {serialprintPGM(MYPGM(x));MYSERIAL.write('\n');}
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
78
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
79
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
80 const char errormagic[] PROGMEM ="Error:";
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
81 const char echomagic[] PROGMEM ="echo:";
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
82 #define SERIAL_ERROR_START serialprintPGM(errormagic);
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
83 #define SERIAL_ERROR(x) SERIAL_PROTOCOL(x)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
84 #define SERIAL_ERRORPGM(x) SERIAL_PROTOCOLPGM(x)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
85 #define SERIAL_ERRORLN(x) SERIAL_PROTOCOLLN(x)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
86 #define SERIAL_ERRORLNPGM(x) SERIAL_PROTOCOLLNPGM(x)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
87
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
88 #define SERIAL_ECHO_START serialprintPGM(echomagic);
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
89 #define SERIAL_ECHO(x) SERIAL_PROTOCOL(x)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
90 #define SERIAL_ECHOPGM(x) SERIAL_PROTOCOLPGM(x)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
91 #define SERIAL_ECHOLN(x) SERIAL_PROTOCOLLN(x)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
92 #define SERIAL_ECHOLNPGM(x) SERIAL_PROTOCOLLNPGM(x)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
93
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
94 #define SERIAL_ECHOPAIR(name,value) {SERIAL_ECHOPGM(name);SERIAL_ECHO(value);}
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
95
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
96
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
97 //things to write to serial from Programmemory. saves 400 to 2k of RAM.
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
98 #define SerialprintPGM(x) serialprintPGM(MYPGM(x))
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
99 FORCE_INLINE void serialprintPGM(const char *str)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
100 {
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
101 char ch=pgm_read_byte(str);
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
102 while(ch)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
103 {
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
104 MYSERIAL.write(ch);
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
105 ch=pgm_read_byte(++str);
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
106 }
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
107 }
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
108
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
109 // printing floats to 3DP
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
110 FORCE_INLINE void serialPrintFloat( float f){
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
111 SERIAL_ECHO((int)f);
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
112 SERIAL_ECHOPGM(".");
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
113 int mantissa = (f - (int)f) * 1000;
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
114 SERIAL_ECHO( abs(mantissa) );
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
115 }
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
116
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
117 void get_command();
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
118 void process_commands();
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
119
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
120 void manage_inactivity(byte debug);
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
121
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
122 #if X_ENABLE_PIN > -1
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
123 #define enable_x() WRITE(X_ENABLE_PIN, X_ENABLE_ON)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
124 #define disable_x() WRITE(X_ENABLE_PIN,!X_ENABLE_ON)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
125 #else
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
126 #define enable_x() ;
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
127 #define disable_x() ;
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
128 #endif
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
129
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
130 #if Y_ENABLE_PIN > -1
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
131 #define enable_y() WRITE(Y_ENABLE_PIN, Y_ENABLE_ON)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
132 #define disable_y() WRITE(Y_ENABLE_PIN,!Y_ENABLE_ON)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
133 #else
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
134 #define enable_y() ;
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
135 #define disable_y() ;
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
136 #endif
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
137
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
138 #if Z_ENABLE_PIN > -1
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
139 #define enable_z() WRITE(Z_ENABLE_PIN, Z_ENABLE_ON)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
140 #define disable_z() WRITE(Z_ENABLE_PIN,!Z_ENABLE_ON)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
141 #else
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
142 #define enable_z() ;
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
143 #define disable_z() ;
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
144 #endif
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
145
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
146 #if defined(E0_ENABLE_PIN) && (E0_ENABLE_PIN > -1)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
147 #define enable_e0() WRITE(E0_ENABLE_PIN, E_ENABLE_ON)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
148 #define disable_e0() WRITE(E0_ENABLE_PIN,!E_ENABLE_ON)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
149 #else
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
150 #define enable_e0() /* nothing */
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
151 #define disable_e0() /* nothing */
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
152 #endif
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
153
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
154 #if (EXTRUDERS > 1) && defined(E1_ENABLE_PIN) && (E1_ENABLE_PIN > -1)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
155 #define enable_e1() WRITE(E1_ENABLE_PIN, E_ENABLE_ON)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
156 #define disable_e1() WRITE(E1_ENABLE_PIN,!E_ENABLE_ON)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
157 #else
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
158 #define enable_e1() /* nothing */
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
159 #define disable_e1() /* nothing */
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
160 #endif
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
161
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
162 #if (EXTRUDERS > 2) && defined(E2_ENABLE_PIN) && (E2_ENABLE_PIN > -1)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
163 #define enable_e2() WRITE(E2_ENABLE_PIN, E_ENABLE_ON)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
164 #define disable_e2() WRITE(E2_ENABLE_PIN,!E_ENABLE_ON)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
165 #else
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
166 #define enable_e2() /* nothing */
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
167 #define disable_e2() /* nothing */
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
168 #endif
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
169
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
170
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
171 enum AxisEnum {X_AXIS=0, Y_AXIS=1, Z_AXIS=2, E_AXIS=3};
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
172
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
173
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
174 void FlushSerialRequestResend();
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
175 void ClearToSend();
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
176
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
177 void get_coordinates();
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
178 void prepare_move();
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
179 void kill();
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
180 void Stop();
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
181
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
182 bool IsStopped();
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
183
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
184 void enquecommand(const char *cmd); //put an ascii command at the end of the current buffer.
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
185 void prepare_arc_move(char isclockwise);
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
186
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
187 #ifndef CRITICAL_SECTION_START
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
188 #define CRITICAL_SECTION_START unsigned char _sreg = SREG; cli();
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
189 #define CRITICAL_SECTION_END SREG = _sreg;
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
190 #endif //CRITICAL_SECTION_START
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
191
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
192 extern float homing_feedrate[];
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
193 extern float fast_home_feedrate[];
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
194 extern bool axis_relative_modes[];
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
195 extern volatile int feedmultiply;
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
196 extern int saved_feedmultiply;
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
197 extern float current_position[NUM_AXIS] ;
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
198 extern float add_homeing[3];
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
199 extern float max_length[3];
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
200 #ifdef ADVANCE
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
201 extern float advance_k;
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
202 #endif
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
203 extern unsigned char FanSpeed;
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
204 extern bool m571_enabled;
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
205 extern bool n571_enabled;
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
206
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
207 extern float destination[NUM_AXIS];
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
208 extern float modified_destination[NUM_AXIS];
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
209 extern float offset[3];
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
210 extern float feedrate, next_feedrate, saved_feedrate;
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
211
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
212
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
213 // Handling multiple extruders pins
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
214 extern uint8_t active_extruder;
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
215
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
216 #endif

mercurial