Ver código fonte

Merge remote-tracking branch 'remotes/upstream/Development' into Development

domonoky 9 anos atrás
pai
commit
4a7aca2736

+ 1
- 1
ArduinoAddons/Arduino_1.5.x/hardware/marlin/avr/boards.txt Ver arquivo

@@ -33,7 +33,7 @@ rambo.build.variant=rambo
33 33
 ########################################
34 34
 sanguino.name=Sanguino
35 35
 
36
-sanguino.upload.tool=ardunio:avrdude
36
+sanguino.upload.tool=arduino:avrdude
37 37
 sanguino.upload.protocol=stk500
38 38
 sanguino.upload.maximum_size=131072
39 39
 sanguino.upload.speed=57600

+ 1
- 8
Marlin/BlinkM.cpp Ver arquivo

@@ -5,16 +5,9 @@
5 5
 #include "Marlin.h"
6 6
 #ifdef BLINKM
7 7
 
8
-#if (ARDUINO >= 100)
9
-  # include "Arduino.h"
10
-#else
11
-  # include "WProgram.h"
12
-#endif
13
-
14 8
 #include "BlinkM.h"
15 9
 
16
-void SendColors(byte red, byte grn, byte blu)
17
-{
10
+void SendColors(byte red, byte grn, byte blu) {
18 11
   Wire.begin(); 
19 12
   Wire.beginTransmission(0x09);
20 13
   Wire.write('o');                    //to disable ongoing script, only needs to be used once

+ 3
- 4
Marlin/BlinkM.h Ver arquivo

@@ -2,13 +2,12 @@
2 2
   BlinkM.h
3 3
   Library header file for BlinkM library
4 4
  */
5
-#if (ARDUINO >= 100)
6
-  # include "Arduino.h"
5
+#if ARDUINO >= 100
6
+  #include "Arduino.h"
7 7
 #else
8
-  # include "WProgram.h"
8
+  #include "WProgram.h"
9 9
 #endif
10 10
 
11 11
 #include "Wire.h"
12 12
 
13 13
 void SendColors(byte red, byte grn, byte blu);
14
-

+ 12
- 1
Marlin/Configuration.h Ver arquivo

@@ -118,7 +118,10 @@ Here are some standard links for getting your machine calibrated:
118 118
 // 1010 is Pt1000 with 1k pullup (non standard)
119 119
 // 147 is Pt100 with 4k7 pullup
120 120
 // 110 is Pt100 with 1k pullup (non standard)
121
-// 999 is a Dummy Table. It will ALWAYS read 25C.. Use it for Testing or Development purposes. NEVER for production machine.
121
+// 998 and 999 are Dummy Tables. They will ALWAYS read 25°C or the temperature defined below. 
122
+//     Use it for Testing or Development purposes. NEVER for production machine.
123
+//     #define DUMMY_THERMISTOR_998_VALUE 25
124
+//     #define DUMMY_THERMISTOR_999_VALUE 100
122 125
 
123 126
 #define TEMP_SENSOR_0 -1
124 127
 #define TEMP_SENSOR_1 -1
@@ -582,6 +585,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
582 585
 //#define LCD_FEEDBACK_FREQUENCY_HZ 1000	// this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
583 586
 //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
584 587
 
588
+// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
589
+// http://reprap.org/wiki/PanelOne
590
+//#define PANEL_ONE
591
+
585 592
 // The MaKr3d Makr-Panel with graphic controller and SD support
586 593
 // http://reprap.org/wiki/MaKr3d_MaKrPanel
587 594
 //#define MAKRPANEL
@@ -640,6 +647,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
640 647
  #define ENCODER_STEPS_PER_MENU_ITEM 1
641 648
 #endif
642 649
 
650
+#if defined (PANEL_ONE)
651
+ #define SDSUPPORT
652
+ #define ULTIMAKERCONTROLLER
653
+#endif
643 654
 
644 655
 #if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
645 656
  #define DOGLCD

+ 3
- 3
Marlin/ConfigurationStore.h Ver arquivo

@@ -1,5 +1,5 @@
1
-#ifndef CONFIG_STORE_H
2
-#define CONFIG_STORE_H
1
+#ifndef CONFIGURATIONSTORE_H
2
+#define CONFIGURATIONSTORE_H
3 3
 
4 4
 #include "Configuration.h"
5 5
 
@@ -19,4 +19,4 @@ void Config_ResetDefault();
19 19
   FORCE_INLINE void Config_RetrieveSettings() { Config_ResetDefault(); Config_PrintSettings(); }
20 20
 #endif
21 21
 
22
-#endif // __CONFIG_STORE_H
22
+#endif //CONFIGURATIONSTORE_H

+ 2
- 2
Marlin/Marlin.h Ver arquivo

@@ -180,8 +180,8 @@ void manage_inactivity(bool ignore_stepper_queue=false);
180 180
   #define disable_e3() /* nothing */
181 181
 #endif
182 182
 
183
-enum AxisEnum {X_AXIS=0, Y_AXIS=1, Z_AXIS=2, E_AXIS=3, X_HEAD=4, Y_HEAD=5};
184
-
183
+enum AxisEnum {X_AXIS=0, Y_AXIS=1, Z_AXIS=2, E_AXIS=3, X_HEAD=4, Y_HEAD=5}; 
184
+//X_HEAD and Y_HEAD is used for systems that don't have a 1:1 relationship between X_AXIS and X Head movement, like CoreXY bots.
185 185
 
186 186
 void FlushSerialRequestResend();
187 187
 void ClearToSend();

+ 32
- 27
Marlin/Marlin_main.cpp Ver arquivo

@@ -1720,6 +1720,7 @@ void process_commands()
1720 1720
 
1721 1721
 #ifdef ENABLE_AUTO_BED_LEVELING
1722 1722
     case 29: // G29 Detailed Z-Probe, probes the bed at 3 or more points.
1723
+    	     // Override probing area by providing [F]ront [B]ack [L]eft [R]ight Grid[P]oints values
1723 1724
         {
1724 1725
             #if Z_MIN_PIN == -1
1725 1726
             #error "You must have a Z_MIN endstop in order to enable Auto Bed Leveling feature!!! Z_MIN_PIN must point to a valid hardware pin."
@@ -1753,9 +1754,19 @@ void process_commands()
1753 1754
             feedrate = homing_feedrate[Z_AXIS];
1754 1755
 #ifdef AUTO_BED_LEVELING_GRID
1755 1756
             // probe at the points of a lattice grid
1757
+            int left_probe_bed_position=LEFT_PROBE_BED_POSITION;
1758
+            int right_probe_bed_position=RIGHT_PROBE_BED_POSITION;
1759
+            int back_probe_bed_position=BACK_PROBE_BED_POSITION;
1760
+            int front_probe_bed_position=FRONT_PROBE_BED_POSITION;
1761
+            int auto_bed_leveling_grid_points=AUTO_BED_LEVELING_GRID_POINTS;
1762
+            if (code_seen('L')) left_probe_bed_position=(int)code_value();
1763
+            if (code_seen('R')) right_probe_bed_position=(int)code_value();
1764
+            if (code_seen('B')) back_probe_bed_position=(int)code_value();
1765
+            if (code_seen('F')) front_probe_bed_position=(int)code_value();
1766
+            if (code_seen('P')) auto_bed_leveling_grid_points=(int)code_value();
1756 1767
 
1757
-            int xGridSpacing = (RIGHT_PROBE_BED_POSITION - LEFT_PROBE_BED_POSITION) / (AUTO_BED_LEVELING_GRID_POINTS-1);
1758
-            int yGridSpacing = (BACK_PROBE_BED_POSITION - FRONT_PROBE_BED_POSITION) / (AUTO_BED_LEVELING_GRID_POINTS-1);
1768
+            int xGridSpacing = (right_probe_bed_position - left_probe_bed_position) / (auto_bed_leveling_grid_points-1);
1769
+            int yGridSpacing = (back_probe_bed_position - front_probe_bed_position) / (auto_bed_leveling_grid_points-1);
1759 1770
 
1760 1771
 
1761 1772
             // solve the plane equation ax + by + d = z
@@ -1765,32 +1776,35 @@ void process_commands()
1765 1776
             // so Vx = -a Vy = -b Vz = 1 (we want the vector facing towards positive Z
1766 1777
 
1767 1778
             // "A" matrix of the linear system of equations
1768
-            double eqnAMatrix[AUTO_BED_LEVELING_GRID_POINTS*AUTO_BED_LEVELING_GRID_POINTS*3];
1779
+            double eqnAMatrix[auto_bed_leveling_grid_points*auto_bed_leveling_grid_points*3];
1780
+
1769 1781
             // "B" vector of Z points
1770
-            double eqnBVector[AUTO_BED_LEVELING_GRID_POINTS*AUTO_BED_LEVELING_GRID_POINTS];
1782
+            double eqnBVector[auto_bed_leveling_grid_points*auto_bed_leveling_grid_points];
1783
+
1771 1784
 
1772 1785
 
1773 1786
             int probePointCounter = 0;
1774 1787
             bool zig = true;
1775 1788
 
1776
-            for (int yProbe=FRONT_PROBE_BED_POSITION; yProbe <= BACK_PROBE_BED_POSITION; yProbe += yGridSpacing)
1789
+            for (int yProbe=front_probe_bed_position; yProbe <= back_probe_bed_position; yProbe += yGridSpacing)
1790
+
1777 1791
             {
1778 1792
               int xProbe, xInc;
1779 1793
               if (zig)
1780 1794
               {
1781
-                xProbe = LEFT_PROBE_BED_POSITION;
1782
-                //xEnd = RIGHT_PROBE_BED_POSITION;
1795
+                xProbe = left_probe_bed_position;
1796
+                //xEnd = right_probe_bed_position;
1783 1797
                 xInc = xGridSpacing;
1784 1798
                 zig = false;
1785 1799
               } else // zag
1786 1800
               {
1787
-                xProbe = RIGHT_PROBE_BED_POSITION;
1788
-                //xEnd = LEFT_PROBE_BED_POSITION;
1801
+                xProbe = right_probe_bed_position;
1802
+                //xEnd = left_probe_bed_position;
1789 1803
                 xInc = -xGridSpacing;
1790 1804
                 zig = true;
1791 1805
               }
1792 1806
 
1793
-              for (int xCount=0; xCount < AUTO_BED_LEVELING_GRID_POINTS; xCount++)
1807
+              for (int xCount=0; xCount < auto_bed_leveling_grid_points; xCount++)
1794 1808
               {
1795 1809
                 float z_before;
1796 1810
                 if (probePointCounter == 0)
@@ -1822,9 +1836,9 @@ void process_commands()
1822 1836
 
1823 1837
                 eqnBVector[probePointCounter] = measured_z;
1824 1838
 
1825
-                eqnAMatrix[probePointCounter + 0*AUTO_BED_LEVELING_GRID_POINTS*AUTO_BED_LEVELING_GRID_POINTS] = xProbe;
1826
-                eqnAMatrix[probePointCounter + 1*AUTO_BED_LEVELING_GRID_POINTS*AUTO_BED_LEVELING_GRID_POINTS] = yProbe;
1827
-                eqnAMatrix[probePointCounter + 2*AUTO_BED_LEVELING_GRID_POINTS*AUTO_BED_LEVELING_GRID_POINTS] = 1;
1839
+                eqnAMatrix[probePointCounter + 0*auto_bed_leveling_grid_points*auto_bed_leveling_grid_points] = xProbe;
1840
+                eqnAMatrix[probePointCounter + 1*auto_bed_leveling_grid_points*auto_bed_leveling_grid_points] = yProbe;
1841
+                eqnAMatrix[probePointCounter + 2*auto_bed_leveling_grid_points*auto_bed_leveling_grid_points] = 1;
1828 1842
                 probePointCounter++;
1829 1843
                 xProbe += xInc;
1830 1844
               }
@@ -1832,7 +1846,7 @@ void process_commands()
1832 1846
             clean_up_after_endstop_move();
1833 1847
 
1834 1848
             // solve lsq problem
1835
-            double *plane_equation_coefficients = qr_solve(AUTO_BED_LEVELING_GRID_POINTS*AUTO_BED_LEVELING_GRID_POINTS, 3, eqnAMatrix, eqnBVector);
1849
+            double *plane_equation_coefficients = qr_solve(auto_bed_leveling_grid_points*auto_bed_leveling_grid_points, 3, eqnAMatrix, eqnBVector);
1836 1850
 
1837 1851
             SERIAL_PROTOCOLPGM("Eqn coefficients: a: ");
1838 1852
             SERIAL_PROTOCOL(plane_equation_coefficients[0]);
@@ -4695,21 +4709,12 @@ bool setTargetedHotend(int code){
4695 4709
 
4696 4710
 
4697 4711
 float calculate_volumetric_multiplier(float diameter) {
4698
-	float area = .0;
4699
-	float radius = .0;
4700
-
4701
-	radius = diameter * .5;
4702
-	if (! volumetric_enabled || radius == 0) {
4703
-		area = 1;
4704
-	}
4705
-	else {
4706
-		area = M_PI * pow(radius, 2);
4707
-	}
4708
-
4709
-	return 1.0 / area;
4712
+  if (!volumetric_enabled || diameter == 0) return 1.0;
4713
+  float d2 = diameter * 0.5;
4714
+  return 1.0 / (M_PI * d2 * d2);
4710 4715
 }
4711 4716
 
4712 4717
 void calculate_volumetric_multipliers() {
4713 4718
   for (int i=0; i<EXTRUDERS; i++)
4714
-  	volumetric_multiplier[i] = calculate_volumetric_multiplier(filament_size[i]);
4719
+    volumetric_multiplier[i] = calculate_volumetric_multiplier(filament_size[i]);
4715 4720
 }

+ 252
- 378
Marlin/cardreader.cpp Ver arquivo

@@ -7,476 +7,383 @@
7 7
 
8 8
 #ifdef SDSUPPORT
9 9
 
10
+CardReader::CardReader() {
11
+  filesize = 0;
12
+  sdpos = 0;
13
+  sdprinting = false;
14
+  cardOK = false;
15
+  saving = false;
16
+  logging = false;
17
+  workDirDepth = 0;
18
+  file_subcall_ctr = 0;
19
+  memset(workDirParents, 0, sizeof(workDirParents));
10 20
 
11
-
12
-CardReader::CardReader()
13
-{
14
-   filesize = 0;
15
-   sdpos = 0;
16
-   sdprinting = false;
17
-   cardOK = false;
18
-   saving = false;
19
-   logging = false;
20
-   autostart_atmillis=0;
21
-   workDirDepth = 0;
22
-   file_subcall_ctr=0;
23
-   memset(workDirParents, 0, sizeof(workDirParents));
24
-
25
-   autostart_stilltocheck=true; //the SD start is delayed, because otherwise the serial cannot answer fast enough to make contact with the host software.
26
-   autostart_index=0;
21
+  autostart_stilltocheck = true; //the SD start is delayed, because otherwise the serial cannot answer fast enough to make contact with the host software.
22
+  autostart_index = 0;
27 23
   //power to SD reader
28 24
   #if SDPOWER > -1
29
-    SET_OUTPUT(SDPOWER); 
30
-    WRITE(SDPOWER,HIGH);
25
+    SET_OUTPUT(SDPOWER);
26
+    WRITE(SDPOWER, HIGH);
31 27
   #endif //SDPOWER
32
-  
33
-  autostart_atmillis=millis()+5000;
28
+
29
+  autostart_atmillis = millis() + 5000;
34 30
 }
35 31
 
36
-char *createFilename(char *buffer,const dir_t &p) //buffer>12characters
37
-{
38
-  char *pos=buffer;
39
-  for (uint8_t i = 0; i < 11; i++) 
40
-  {
41
-    if (p.name[i] == ' ')continue;
42
-    if (i == 8) 
43
-    {
44
-      *pos++='.';
45
-    }
46
-    *pos++=p.name[i];
32
+char *createFilename(char *buffer, const dir_t &p) { //buffer > 12characters
33
+  char *pos = buffer;
34
+  for (uint8_t i = 0; i < 11; i++) {
35
+    if (p.name[i] == ' ') continue;
36
+    if (i == 8) *pos++ = '.';
37
+    *pos++ = p.name[i];
47 38
   }
48
-  *pos++=0;
39
+  *pos++ = 0;
49 40
   return buffer;
50 41
 }
51 42
 
52
-
53
-void CardReader::lsDive(const char *prepend, SdFile parent, const char * const match/*=NULL*/)
54
-{
43
+void CardReader::lsDive(const char *prepend, SdFile parent, const char * const match/*=NULL*/) {
55 44
   dir_t p;
56
- uint8_t cnt=0;
57
- 
58
-  while (parent.readDir(p, longFilename) > 0)
59
-  {
60
-    if( DIR_IS_SUBDIR(&p) && lsAction!=LS_Count && lsAction!=LS_GetFilename) // hence LS_SerialPrint
61
-    {
45
+  uint8_t cnt = 0;
62 46
 
47
+  while (parent.readDir(p, longFilename) > 0) {
48
+    if (DIR_IS_SUBDIR(&p) && lsAction != LS_Count && lsAction != LS_GetFilename) { // hence LS_SerialPrint
63 49
       char path[FILENAME_LENGTH*2];
64 50
       char lfilename[FILENAME_LENGTH];
65
-      createFilename(lfilename,p);
66
-      
67
-      path[0]=0;
68
-      if(prepend[0]==0) //avoid leading / if already in prepend
69
-      {
70
-       strcat(path,"/");
71
-      }
72
-      strcat(path,prepend);
73
-      strcat(path,lfilename);
74
-      strcat(path,"/");
75
-      
51
+      createFilename(lfilename, p);
52
+
53
+      path[0] = 0;
54
+      if (prepend[0] == 0) strcat(path, "/"); //avoid leading / if already in prepend
55
+      strcat(path, prepend);
56
+      strcat(path, lfilename);
57
+      strcat(path, "/");
58
+
76 59
       //Serial.print(path);
77
-      
60
+
78 61
       SdFile dir;
79
-      if(!dir.open(parent,lfilename, O_READ))
80
-      {
81
-        if(lsAction==LS_SerialPrint)
82
-        {
62
+      if (!dir.open(parent, lfilename, O_READ)) {
63
+        if (lsAction == LS_SerialPrint) {
83 64
           SERIAL_ECHO_START;
84 65
           SERIAL_ECHOLN(MSG_SD_CANT_OPEN_SUBDIR);
85 66
           SERIAL_ECHOLN(lfilename);
86 67
         }
87 68
       }
88
-      lsDive(path,dir);
69
+      lsDive(path, dir);
89 70
       //close done automatically by destructor of SdFile
90
-
91
-      
92 71
     }
93
-    else
94
-    {
72
+    else {
95 73
       char pn0 = p.name[0];
96 74
       if (pn0 == DIR_NAME_FREE) break;
97
-      if (pn0 == DIR_NAME_DELETED || pn0 == '.' || pn0 == '_') continue;
75
+      if (pn0 == DIR_NAME_DELETED || pn0 == '.') continue;
98 76
       char lf0 = longFilename[0];
99
-      if (lf0 == '.' || lf0 == '_') continue;
77
+      if (lf0 == '.') continue;
100 78
 
101 79
       if (!DIR_IS_FILE_OR_SUBDIR(&p)) continue;
102
-      filenameIsDir=DIR_IS_SUBDIR(&p);
103
-      
104
-      
105
-      if(!filenameIsDir)
106
-      {
107
-        if(p.name[8]!='G') continue;
108
-        if(p.name[9]=='~') continue;
109
-      }
110
-      //if(cnt++!=nr) continue;
111
-      createFilename(filename,p);
112
-      if(lsAction==LS_SerialPrint)
113
-      {
80
+
81
+      filenameIsDir = DIR_IS_SUBDIR(&p);
82
+
83
+      if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue;
84
+
85
+      //if (cnt++ != nr) continue;
86
+      createFilename(filename, p);
87
+      if (lsAction == LS_SerialPrint) {
114 88
         SERIAL_PROTOCOL(prepend);
115 89
         SERIAL_PROTOCOLLN(filename);
116 90
       }
117
-      else if(lsAction==LS_Count)
118
-      {
91
+      else if (lsAction == LS_Count) {
119 92
         nrFiles++;
120
-      } 
121
-      else if(lsAction==LS_GetFilename)
122
-      {
93
+      }
94
+      else if (lsAction == LS_GetFilename) {
123 95
         if (match != NULL) {
124 96
           if (strcasecmp(match, filename) == 0) return;
125 97
         }
126 98
         else if (cnt == nrFiles) return;
127 99
         cnt++;
128
-        
129 100
       }
130 101
     }
131 102
   }
132 103
 }
133 104
 
134
-void CardReader::ls() 
135
-{
136
-  lsAction=LS_SerialPrint;
137
-  if(lsAction==LS_Count)
138
-  nrFiles=0;
139
-
105
+void CardReader::ls()  {
106
+  lsAction = LS_SerialPrint;
140 107
   root.rewind();
141
-  lsDive("",root);
108
+  lsDive("", root);
142 109
 }
143 110
 
144
-
145
-void CardReader::initsd()
146
-{
111
+void CardReader::initsd() {
147 112
   cardOK = false;
148
-  if(root.isOpen())
149
-    root.close();
150
-#ifdef SDSLOW
151
-  if (!card.init(SPI_HALF_SPEED,SDSS)
152
-  #if defined(LCD_SDSS) && (LCD_SDSS != SDSS)
153
-    && !card.init(SPI_HALF_SPEED,LCD_SDSS)
154
-  #endif
155
-    )
156
-#else
157
-  if (!card.init(SPI_FULL_SPEED,SDSS)
158
-  #if defined(LCD_SDSS) && (LCD_SDSS != SDSS)
159
-    && !card.init(SPI_FULL_SPEED,LCD_SDSS)
113
+  if (root.isOpen()) root.close();
114
+
115
+  #ifdef SDSLOW
116
+    #define SPI_SPEED SPI_HALF_SPEED
117
+  #else
118
+    #define SPI_SPEED SPI_FULL_SPEED
160 119
   #endif
161
-    )
162
-#endif
163
-  {
120
+
121
+  if (!card.init(SPI_SPEED,SDSS)
122
+    #if defined(LCD_SDSS) && (LCD_SDSS != SDSS)
123
+      && !card.init(SPI_SPEED, LCD_SDSS)
124
+    #endif
125
+  ) {
164 126
     //if (!card.init(SPI_HALF_SPEED,SDSS))
165 127
     SERIAL_ECHO_START;
166 128
     SERIAL_ECHOLNPGM(MSG_SD_INIT_FAIL);
167 129
   }
168
-  else if (!volume.init(&card))
169
-  {
130
+  else if (!volume.init(&card)) {
170 131
     SERIAL_ERROR_START;
171 132
     SERIAL_ERRORLNPGM(MSG_SD_VOL_INIT_FAIL);
172 133
   }
173
-  else if (!root.openRoot(&volume)) 
174
-  {
134
+  else if (!root.openRoot(&volume)) {
175 135
     SERIAL_ERROR_START;
176 136
     SERIAL_ERRORLNPGM(MSG_SD_OPENROOT_FAIL);
177 137
   }
178
-  else 
179
-  {
138
+  else {
180 139
     cardOK = true;
181 140
     SERIAL_ECHO_START;
182 141
     SERIAL_ECHOLNPGM(MSG_SD_CARD_OK);
183 142
   }
184
-  workDir=root;
185
-  curDir=&root;
143
+  workDir = root;
144
+  curDir = &root;
186 145
   /*
187
-  if(!workDir.openRoot(&volume))
188
-  {
146
+  if (!workDir.openRoot(&volume)) {
189 147
     SERIAL_ECHOLNPGM(MSG_SD_WORKDIR_FAIL);
190 148
   }
191 149
   */
192
-  
193 150
 }
194 151
 
195
-void CardReader::setroot()
196
-{
197
-  /*if(!workDir.openRoot(&volume))
198
-  {
152
+void CardReader::setroot() {
153
+  /*if (!workDir.openRoot(&volume)) {
199 154
     SERIAL_ECHOLNPGM(MSG_SD_WORKDIR_FAIL);
200 155
   }*/
201
-  workDir=root;
202
-  
203
-  curDir=&workDir;
156
+  workDir = root;
157
+  curDir = &workDir;
204 158
 }
205
-void CardReader::release()
206
-{
159
+
160
+void CardReader::release() {
207 161
   sdprinting = false;
208 162
   cardOK = false;
209 163
 }
210 164
 
211
-void CardReader::startFileprint()
212
-{
213
-  if(cardOK)
214
-  {
165
+void CardReader::startFileprint() {
166
+  if (cardOK) {
215 167
     sdprinting = true;
216 168
   }
217 169
 }
218 170
 
219
-void CardReader::pauseSDPrint()
220
-{
221
-  if(sdprinting)
222
-  {
223
-    sdprinting = false;
224
-  }
171
+void CardReader::pauseSDPrint() {
172
+  if (sdprinting) sdprinting = false;
225 173
 }
226 174
 
227
-
228
-void CardReader::openLogFile(char* name)
229
-{
175
+void CardReader::openLogFile(char* name) {
230 176
   logging = true;
231 177
   openFile(name, false);
232 178
 }
233 179
 
234
-void CardReader::getAbsFilename(char *t)
235
-{
236
-  uint8_t cnt=0;
237
-  *t='/';t++;cnt++;
238
-  for(uint8_t i=0;i<workDirDepth;i++)
239
-  {
180
+void CardReader::getAbsFilename(char *t) {
181
+  uint8_t cnt = 0;
182
+  *t = '/'; t++; cnt++;
183
+  for (uint8_t i = 0; i < workDirDepth; i++) {
240 184
     workDirParents[i].getFilename(t); //SDBaseFile.getfilename!
241
-    while(*t!=0 && cnt< MAXPATHNAMELENGTH) 
242
-    {t++;cnt++;}  //crawl counter forward.
185
+    while(*t && cnt < MAXPATHNAMELENGTH) { t++; cnt++; } //crawl counter forward.
243 186
   }
244
-  if(cnt<MAXPATHNAMELENGTH-FILENAME_LENGTH)
187
+  if (cnt < MAXPATHNAMELENGTH - FILENAME_LENGTH)
245 188
     file.getFilename(t);
246 189
   else
247
-    t[0]=0;
190
+    t[0] = 0;
248 191
 }
249 192
 
250
-void CardReader::openFile(char* name,bool read, bool replace_current/*=true*/)
251
-{
252
-  if(!cardOK)
253
-    return;
254
-  if(file.isOpen())  //replacing current file by new file, or subfile call
255
-  {
256
-    if(!replace_current)
257
-    {
258
-     if((int)file_subcall_ctr>(int)SD_PROCEDURE_DEPTH-1)
259
-     {
193
+void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/) {
194
+  if (!cardOK) return;
195
+  if (file.isOpen()) { //replacing current file by new file, or subfile call
196
+    if (!replace_current) {
197
+     if (file_subcall_ctr > SD_PROCEDURE_DEPTH - 1) {
260 198
        SERIAL_ERROR_START;
261 199
        SERIAL_ERRORPGM("trying to call sub-gcode files with too many levels. MAX level is:");
262 200
        SERIAL_ERRORLN(SD_PROCEDURE_DEPTH);
263 201
        kill();
264 202
        return;
265 203
      }
266
-     
204
+
267 205
      SERIAL_ECHO_START;
268 206
      SERIAL_ECHOPGM("SUBROUTINE CALL target:\"");
269 207
      SERIAL_ECHO(name);
270 208
      SERIAL_ECHOPGM("\" parent:\"");
271
-     
209
+
272 210
      //store current filename and position
273 211
      getAbsFilename(filenames[file_subcall_ctr]);
274
-     
212
+
275 213
      SERIAL_ECHO(filenames[file_subcall_ctr]);
276 214
      SERIAL_ECHOPGM("\" pos");
277 215
      SERIAL_ECHOLN(sdpos);
278
-     filespos[file_subcall_ctr]=sdpos;
216
+     filespos[file_subcall_ctr] = sdpos;
279 217
      file_subcall_ctr++;
280 218
     }
281
-    else
282
-    {
219
+    else {
283 220
      SERIAL_ECHO_START;
284 221
      SERIAL_ECHOPGM("Now doing file: ");
285 222
      SERIAL_ECHOLN(name);
286 223
     }
287 224
     file.close();
288 225
   }
289
-  else //opening fresh file
290
-  {
291
-    file_subcall_ctr=0; //resetting procedure depth in case user cancels print while in procedure
226
+  else { //opening fresh file
227
+    file_subcall_ctr = 0; //resetting procedure depth in case user cancels print while in procedure
292 228
     SERIAL_ECHO_START;
293 229
     SERIAL_ECHOPGM("Now fresh file: ");
294 230
     SERIAL_ECHOLN(name);
295 231
   }
296 232
   sdprinting = false;
297
-  
298
- 
233
+
299 234
   SdFile myDir;
300
-  curDir=&root;
301
-  char *fname=name;
302
-  
303
-  char *dirname_start,*dirname_end;
304
-  if(name[0]=='/')
305
-  {
306
-    dirname_start=strchr(name,'/')+1;
307
-    while(dirname_start>0)
308
-    {
309
-      dirname_end=strchr(dirname_start,'/');
310
-      //SERIAL_ECHO("start:");SERIAL_ECHOLN((int)(dirname_start-name));
311
-      //SERIAL_ECHO("end  :");SERIAL_ECHOLN((int)(dirname_end-name));
312
-      if(dirname_end>0 && dirname_end>dirname_start)
313
-      {
235
+  curDir = &root;
236
+  char *fname = name;
237
+
238
+  char *dirname_start, *dirname_end;
239
+  if (name[0] == '/') {
240
+    dirname_start = &name[1];
241
+    while(dirname_start > 0) {
242
+      dirname_end = strchr(dirname_start, '/');
243
+      //SERIAL_ECHO("start:");SERIAL_ECHOLN((int)(dirname_start - name));
244
+      //SERIAL_ECHO("end  :");SERIAL_ECHOLN((int)(dirname_end - name));
245
+      if (dirname_end > 0 && dirname_end > dirname_start) {
314 246
         char subdirname[FILENAME_LENGTH];
315
-        strncpy(subdirname, dirname_start, dirname_end-dirname_start);
316
-        subdirname[dirname_end-dirname_start]=0;
247
+        strncpy(subdirname, dirname_start, dirname_end - dirname_start);
248
+        subdirname[dirname_end - dirname_start] = 0;
317 249
         SERIAL_ECHOLN(subdirname);
318
-        if(!myDir.open(curDir,subdirname,O_READ))
319
-        {
250
+        if (!myDir.open(curDir, subdirname, O_READ)) {
320 251
           SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL);
321 252
           SERIAL_PROTOCOL(subdirname);
322 253
           SERIAL_PROTOCOLLNPGM(".");
323 254
           return;
324 255
         }
325
-        else
326
-        {
256
+        else {
327 257
           //SERIAL_ECHOLN("dive ok");
328 258
         }
329
-          
330
-        curDir=&myDir; 
331
-        dirname_start=dirname_end+1;
259
+
260
+        curDir = &myDir;
261
+        dirname_start = dirname_end + 1;
332 262
       }
333
-      else // the reminder after all /fsa/fdsa/ is the filename
334
-      {
335
-        fname=dirname_start;
336
-        //SERIAL_ECHOLN("remaider");
263
+      else { // the remainder after all /fsa/fdsa/ is the filename
264
+        fname = dirname_start;
265
+        //SERIAL_ECHOLN("remainder");
337 266
         //SERIAL_ECHOLN(fname);
338 267
         break;
339 268
       }
340
-      
341 269
     }
342 270
   }
343
-  else //relative path
344
-  {
345
-    curDir=&workDir;
271
+  else { //relative path
272
+    curDir = &workDir;
346 273
   }
347
-  if(read)
348
-  {
349
-    if (file.open(curDir, fname, O_READ)) 
350
-    {
274
+
275
+  if (read) {
276
+    if (file.open(curDir, fname, O_READ)) {
351 277
       filesize = file.fileSize();
352 278
       SERIAL_PROTOCOLPGM(MSG_SD_FILE_OPENED);
353 279
       SERIAL_PROTOCOL(fname);
354 280
       SERIAL_PROTOCOLPGM(MSG_SD_SIZE);
355 281
       SERIAL_PROTOCOLLN(filesize);
356 282
       sdpos = 0;
357
-      
283
+
358 284
       SERIAL_PROTOCOLLNPGM(MSG_SD_FILE_SELECTED);
359 285
       getfilename(0, fname);
360 286
       lcd_setstatus(longFilename[0] ? longFilename : fname);
361 287
     }
362
-    else
363
-    {
288
+    else {
364 289
       SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL);
365 290
       SERIAL_PROTOCOL(fname);
366 291
       SERIAL_PROTOCOLLNPGM(".");
367 292
     }
368 293
   }
369
-  else 
370
-  { //write
371
-    if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC))
372
-    {
294
+  else { //write
295
+    if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)) {
373 296
       SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL);
374 297
       SERIAL_PROTOCOL(fname);
375 298
       SERIAL_PROTOCOLLNPGM(".");
376 299
     }
377
-    else
378
-    {
300
+    else {
379 301
       saving = true;
380 302
       SERIAL_PROTOCOLPGM(MSG_SD_WRITE_TO_FILE);
381 303
       SERIAL_PROTOCOLLN(name);
382 304
       lcd_setstatus(fname);
383 305
     }
384 306
   }
385
-  
386 307
 }
387 308
 
388
-void CardReader::removeFile(char* name)
389
-{
390
-  if(!cardOK)
391
-    return;
309
+void CardReader::removeFile(char* name) {
310
+  if (!cardOK) return;
311
+
392 312
   file.close();
393 313
   sdprinting = false;
394
-  
395
-  
314
+
396 315
   SdFile myDir;
397
-  curDir=&root;
398
-  char *fname=name;
399
-  
400
-  char *dirname_start,*dirname_end;
401
-  if(name[0]=='/')
402
-  {
403
-    dirname_start=strchr(name,'/')+1;
404
-    while(dirname_start>0)
405
-    {
406
-      dirname_end=strchr(dirname_start,'/');
407
-      //SERIAL_ECHO("start:");SERIAL_ECHOLN((int)(dirname_start-name));
408
-      //SERIAL_ECHO("end  :");SERIAL_ECHOLN((int)(dirname_end-name));
409
-      if(dirname_end>0 && dirname_end>dirname_start)
410
-      {
316
+  curDir = &root;
317
+  char *fname = name;
318
+
319
+  char *dirname_start, *dirname_end;
320
+  if (name[0] == '/') {
321
+    dirname_start = strchr(name, '/') + 1;
322
+    while (dirname_start > 0) {
323
+      dirname_end = strchr(dirname_start, '/');
324
+      //SERIAL_ECHO("start:");SERIAL_ECHOLN((int)(dirname_start - name));
325
+      //SERIAL_ECHO("end  :");SERIAL_ECHOLN((int)(dirname_end - name));
326
+      if (dirname_end > 0 && dirname_end > dirname_start) {
411 327
         char subdirname[FILENAME_LENGTH];
412
-        strncpy(subdirname, dirname_start, dirname_end-dirname_start);
413
-        subdirname[dirname_end-dirname_start]=0;
328
+        strncpy(subdirname, dirname_start, dirname_end - dirname_start);
329
+        subdirname[dirname_end - dirname_start] = 0;
414 330
         SERIAL_ECHOLN(subdirname);
415
-        if(!myDir.open(curDir,subdirname,O_READ))
416
-        {
331
+        if (!myDir.open(curDir, subdirname, O_READ)) {
417 332
           SERIAL_PROTOCOLPGM("open failed, File: ");
418 333
           SERIAL_PROTOCOL(subdirname);
419 334
           SERIAL_PROTOCOLLNPGM(".");
420 335
           return;
421 336
         }
422
-        else
423
-        {
337
+        else {
424 338
           //SERIAL_ECHOLN("dive ok");
425 339
         }
426
-          
427
-        curDir=&myDir; 
428
-        dirname_start=dirname_end+1;
340
+
341
+        curDir = &myDir;
342
+        dirname_start = dirname_end + 1;
429 343
       }
430
-      else // the reminder after all /fsa/fdsa/ is the filename
431
-      {
432
-        fname=dirname_start;
433
-        //SERIAL_ECHOLN("remaider");
344
+      else { // the remainder after all /fsa/fdsa/ is the filename
345
+        fname = dirname_start;
346
+        //SERIAL_ECHOLN("remainder");
434 347
         //SERIAL_ECHOLN(fname);
435 348
         break;
436 349
       }
437
-      
438 350
     }
439 351
   }
440
-  else //relative path
441
-  {
442
-    curDir=&workDir;
352
+  else { // relative path
353
+    curDir = &workDir;
354
+  }
355
+
356
+  if (file.remove(curDir, fname)) {
357
+    SERIAL_PROTOCOLPGM("File deleted:");
358
+    SERIAL_PROTOCOLLN(fname);
359
+    sdpos = 0;
360
+  }
361
+  else {
362
+    SERIAL_PROTOCOLPGM("Deletion failed, File: ");
363
+    SERIAL_PROTOCOL(fname);
364
+    SERIAL_PROTOCOLLNPGM(".");
443 365
   }
444
-    if (file.remove(curDir, fname)) 
445
-    {
446
-      SERIAL_PROTOCOLPGM("File deleted:");
447
-      SERIAL_PROTOCOLLN(fname);
448
-      sdpos = 0;
449
-    }
450
-    else
451
-    {
452
-      SERIAL_PROTOCOLPGM("Deletion failed, File: ");
453
-      SERIAL_PROTOCOL(fname);
454
-      SERIAL_PROTOCOLLNPGM(".");
455
-    }
456
-  
457 366
 }
458 367
 
459
-void CardReader::getStatus()
460
-{
461
-  if(cardOK){
368
+void CardReader::getStatus() {
369
+  if (cardOK) {
462 370
     SERIAL_PROTOCOLPGM(MSG_SD_PRINTING_BYTE);
463 371
     SERIAL_PROTOCOL(sdpos);
464 372
     SERIAL_PROTOCOLPGM("/");
465 373
     SERIAL_PROTOCOLLN(filesize);
466 374
   }
467
-  else{
375
+  else {
468 376
     SERIAL_PROTOCOLLNPGM(MSG_SD_NOT_PRINTING);
469 377
   }
470 378
 }
471
-void CardReader::write_command(char *buf)
472
-{
379
+
380
+void CardReader::write_command(char *buf) {
473 381
   char* begin = buf;
474 382
   char* npos = 0;
475 383
   char* end = buf + strlen(buf) - 1;
476 384
 
477 385
   file.writeError = false;
478
-  if((npos = strchr(buf, 'N')) != NULL)
479
-  {
386
+  if ((npos = strchr(buf, 'N')) != NULL) {
480 387
     begin = strchr(npos, ' ') + 1;
481 388
     end = strchr(npos, '*') - 1;
482 389
   }
@@ -484,162 +391,129 @@ void CardReader::write_command(char *buf)
484 391
   end[2] = '\n';
485 392
   end[3] = '\0';
486 393
   file.write(begin);
487
-  if (file.writeError)
488
-  {
394
+  if (file.writeError) {
489 395
     SERIAL_ERROR_START;
490 396
     SERIAL_ERRORLNPGM(MSG_SD_ERR_WRITE_TO_FILE);
491 397
   }
492 398
 }
493 399
 
400
+void CardReader::checkautostart(bool force) {
401
+  if (!force && (!autostart_stilltocheck || autostart_atmillis < millis()))
402
+    return;
494 403
 
495
-void CardReader::checkautostart(bool force)
496
-{
497
-  if(!force)
498
-  {
499
-    if(!autostart_stilltocheck)
500
-      return;
501
-    if(autostart_atmillis<millis())
502
-      return;
503
-  }
504
-  autostart_stilltocheck=false;
505
-  if(!cardOK)
506
-  {
404
+  autostart_stilltocheck = false;
405
+
406
+  if (!cardOK) {
507 407
     initsd();
508
-    if(!cardOK) //fail
509
-      return;
408
+    if (!cardOK) return; // fail
510 409
   }
511
-  
410
+
512 411
   char autoname[30];
513 412
   sprintf_P(autoname, PSTR("auto%i.g"), autostart_index);
514
-  for(int8_t i=0;i<(int8_t)strlen(autoname);i++)
515
-    autoname[i]=tolower(autoname[i]);
413
+  for (int8_t i = 0; i < (int8_t)strlen(autoname); i++) autoname[i] = tolower(autoname[i]);
414
+
516 415
   dir_t p;
517 416
 
518 417
   root.rewind();
519
-  
520
-  bool found=false;
521
-  while (root.readDir(p, NULL) > 0) 
522
-  {
523
-    for(int8_t i=0;i<(int8_t)strlen((char*)p.name);i++)
524
-    p.name[i]=tolower(p.name[i]);
525
-    //Serial.print((char*)p.name);
526
-    //Serial.print(" ");
527
-    //Serial.println(autoname);
528
-    if(p.name[9]!='~') //skip safety copies
529
-    if(strncmp((char*)p.name,autoname,5)==0)
530
-    {
531
-      char cmd[30];
532 418
 
419
+  bool found = false;
420
+  while (root.readDir(p, NULL) > 0) {
421
+    for (int8_t i = 0; i < (int8_t)strlen((char*)p.name); i++) p.name[i] = tolower(p.name[i]);
422
+    if (p.name[9] != '~' && strncmp((char*)p.name, autoname, 5) == 0) {
423
+      char cmd[30];
533 424
       sprintf_P(cmd, PSTR("M23 %s"), autoname);
534 425
       enquecommand(cmd);
535 426
       enquecommands_P(PSTR("M24"));
536
-      found=true;
427
+      found = true;
537 428
     }
538 429
   }
539
-  if(!found)
540
-    autostart_index=-1;
430
+  if (!found)
431
+    autostart_index = -1;
541 432
   else
542 433
     autostart_index++;
543 434
 }
544 435
 
545
-void CardReader::closefile(bool store_location)
546
-{
436
+void CardReader::closefile(bool store_location) {
547 437
   file.sync();
548 438
   file.close();
549
-  saving = false; 
550
-  logging = false;
551
-  
552
-  if(store_location)
553
-  {
439
+  saving = logging = false;
440
+
441
+  if (store_location) {
554 442
     //future: store printer state, filename and position for continuing a stopped print
555 443
     // so one can unplug the printer and continue printing the next day.
556
-    
557 444
   }
558
-
559
-  
560 445
 }
561 446
 
562
-void CardReader::getfilename(uint16_t nr, const char * const match/*=NULL*/)
563
-{
564
-  curDir=&workDir;
565
-  lsAction=LS_GetFilename;
566
-  nrFiles=nr;
447
+/**
448
+ * Get the name of a file in the current directory by index
449
+ */
450
+void CardReader::getfilename(uint16_t nr, const char * const match/*=NULL*/) {
451
+  curDir = &workDir;
452
+  lsAction = LS_GetFilename;
453
+  nrFiles = nr;
567 454
   curDir->rewind();
568
-  lsDive("",*curDir,match);
569
-  
455
+  lsDive("", *curDir, match);
570 456
 }
571 457
 
572
-uint16_t CardReader::getnrfilenames()
573
-{
574
-  curDir=&workDir;
575
-  lsAction=LS_Count;
576
-  nrFiles=0;
458
+uint16_t CardReader::getnrfilenames() {
459
+  curDir = &workDir;
460
+  lsAction = LS_Count;
461
+  nrFiles = 0;
577 462
   curDir->rewind();
578
-  lsDive("",*curDir);
463
+  lsDive("", *curDir);
579 464
   //SERIAL_ECHOLN(nrFiles);
580 465
   return nrFiles;
581 466
 }
582 467
 
583
-void CardReader::chdir(const char * relpath)
584
-{
468
+void CardReader::chdir(const char * relpath) {
585 469
   SdFile newfile;
586
-  SdFile *parent=&root;
587
-  
588
-  if(workDir.isOpen())
589
-    parent=&workDir;
590
-  
591
-  if(!newfile.open(*parent,relpath, O_READ))
592
-  {
593
-   SERIAL_ECHO_START;
594
-   SERIAL_ECHOPGM(MSG_SD_CANT_ENTER_SUBDIR);
595
-   SERIAL_ECHOLN(relpath);
470
+  SdFile *parent = &root;
471
+
472
+  if (workDir.isOpen()) parent = &workDir;
473
+
474
+  if (!newfile.open(*parent, relpath, O_READ)) {
475
+    SERIAL_ECHO_START;
476
+    SERIAL_ECHOPGM(MSG_SD_CANT_ENTER_SUBDIR);
477
+    SERIAL_ECHOLN(relpath);
596 478
   }
597
-  else
598
-  {
479
+  else {
599 480
     if (workDirDepth < MAX_DIR_DEPTH) {
600
-      for (int d = ++workDirDepth; d--;)
601
-        workDirParents[d+1] = workDirParents[d];
602
-      workDirParents[0]=*parent;
481
+      ++workDirDepth;
482
+      for (int d = workDirDepth; d--;) workDirParents[d + 1] = workDirParents[d];
483
+      workDirParents[0] = *parent;
603 484
     }
604
-    workDir=newfile;
485
+    workDir = newfile;
605 486
   }
606 487
 }
607 488
 
608
-void CardReader::updir()
609
-{
610
-  if(workDirDepth > 0)
611
-  {
489
+void CardReader::updir() {
490
+  if (workDirDepth > 0) {
612 491
     --workDirDepth;
613 492
     workDir = workDirParents[0];
614
-    int d;
615 493
     for (int d = 0; d < workDirDepth; d++)
616 494
       workDirParents[d] = workDirParents[d+1];
617 495
   }
618 496
 }
619 497
 
620
-
621
-void CardReader::printingHasFinished()
622
-{
623
-    st_synchronize();
624
-    if(file_subcall_ctr>0) //heading up to a parent file that called current as a procedure.
625
-    {
626
-      file.close();
627
-      file_subcall_ctr--;
628
-      openFile(filenames[file_subcall_ctr],true,true);
629
-      setIndex(filespos[file_subcall_ctr]);
630
-      startFileprint();
631
-    }
632
-    else
633
-    {
634
-      quickStop();
635
-      file.close();
636
-      sdprinting = false;
637
-      if(SD_FINISHED_STEPPERRELEASE)
638
-      {
639
-          //finishAndDisableSteppers();
640
-          enquecommands_P(PSTR(SD_FINISHED_RELEASECOMMAND));
641
-      }
642
-      autotempShutdown();
498
+void CardReader::printingHasFinished() {
499
+  st_synchronize();
500
+  if (file_subcall_ctr > 0) { // Heading up to a parent file that called current as a procedure.
501
+    file.close();
502
+    file_subcall_ctr--;
503
+    openFile(filenames[file_subcall_ctr], true, true);
504
+    setIndex(filespos[file_subcall_ctr]);
505
+    startFileprint();
506
+  }
507
+  else {
508
+    quickStop();
509
+    file.close();
510
+    sdprinting = false;
511
+    if (SD_FINISHED_STEPPERRELEASE) {
512
+      //finishAndDisableSteppers();
513
+      enquecommands_P(PSTR(SD_FINISHED_RELEASECOMMAND));
643 514
     }
515
+    autotempShutdown();
516
+  }
644 517
 }
518
+
645 519
 #endif //SDSUPPORT

+ 30
- 34
Marlin/cardreader.h Ver arquivo

@@ -3,21 +3,21 @@
3 3
 
4 4
 #ifdef SDSUPPORT
5 5
 
6
-#define MAX_DIR_DEPTH 10
6
+#define MAX_DIR_DEPTH 10          // Maximum folder depth
7 7
 
8 8
 #include "SdFile.h"
9
-enum LsAction {LS_SerialPrint,LS_Count,LS_GetFilename};
10
-class CardReader
11
-{
9
+enum LsAction { LS_SerialPrint, LS_Count, LS_GetFilename };
10
+
11
+class CardReader {
12 12
 public:
13 13
   CardReader();
14
-  
14
+
15 15
   void initsd();
16 16
   void write_command(char *buf);
17 17
   //files auto[0-9].g on the sd card are performed in a row
18 18
   //this is to delay autostart and hence the initialisaiton of the sd card to some seconds after the normal init, so the device is available quick after a reset
19 19
 
20
-  void checkautostart(bool x); 
20
+  void checkautostart(bool x);
21 21
   void openFile(char* name,bool read,bool replace_current=true);
22 22
   void openLogFile(char* name);
23 23
   void removeFile(char* name);
@@ -30,9 +30,8 @@ public:
30 30
 
31 31
   void getfilename(uint16_t nr, const char* const match=NULL);
32 32
   uint16_t getnrfilenames();
33
-  
33
+
34 34
   void getAbsFilename(char *t);
35
-  
36 35
 
37 36
   void ls();
38 37
   void chdir(const char * relpath);
@@ -41,56 +40,52 @@ public:
41 40
 
42 41
 
43 42
   FORCE_INLINE bool isFileOpen() { return file.isOpen(); }
44
-  FORCE_INLINE bool eof() { return sdpos>=filesize ;};
45
-  FORCE_INLINE int16_t get() {  sdpos = file.curPosition();return (int16_t)file.read();};
46
-  FORCE_INLINE void setIndex(long index) {sdpos = index;file.seekSet(index);};
47
-  FORCE_INLINE uint8_t percentDone(){if(!isFileOpen()) return 0; if(filesize) return sdpos/((filesize+99)/100); else return 0;};
48
-  FORCE_INLINE char* getWorkDirName(){workDir.getFilename(filename);return filename;};
43
+  FORCE_INLINE bool eof() { return sdpos >= filesize; }
44
+  FORCE_INLINE int16_t get() { sdpos = file.curPosition(); return (int16_t)file.read(); }
45
+  FORCE_INLINE void setIndex(long index) { sdpos = index; file.seekSet(index); }
46
+  FORCE_INLINE uint8_t percentDone() { return (isFileOpen() && filesize) ? sdpos / ((filesize + 99) / 100) : 0; }
47
+  FORCE_INLINE char* getWorkDirName() { workDir.getFilename(filename); return filename; }
49 48
 
50 49
 public:
51
-  bool saving;
52
-  bool logging;
53
-  bool sdprinting;  
54
-  bool cardOK;
55
-  char filename[FILENAME_LENGTH];
56
-  char longFilename[LONG_FILENAME_LENGTH];
57
-  bool filenameIsDir;
50
+  bool saving, logging, sdprinting, cardOK, filenameIsDir;
51
+  char filename[FILENAME_LENGTH], longFilename[LONG_FILENAME_LENGTH];
58 52
   int autostart_index;
59 53
 private:
60
-  SdFile root,*curDir,workDir,workDirParents[MAX_DIR_DEPTH];
54
+  SdFile root, *curDir, workDir, workDirParents[MAX_DIR_DEPTH];
61 55
   uint16_t workDirDepth;
62 56
   Sd2Card card;
63 57
   SdVolume volume;
64 58
   SdFile file;
65 59
   #define SD_PROCEDURE_DEPTH 1
66
-  #define MAXPATHNAMELENGTH (FILENAME_LENGTH*MAX_DIR_DEPTH+MAX_DIR_DEPTH+1)
60
+  #define MAXPATHNAMELENGTH (FILENAME_LENGTH*MAX_DIR_DEPTH + MAX_DIR_DEPTH + 1)
67 61
   uint8_t file_subcall_ctr;
68 62
   uint32_t filespos[SD_PROCEDURE_DEPTH];
69 63
   char filenames[SD_PROCEDURE_DEPTH][MAXPATHNAMELENGTH];
70 64
   uint32_t filesize;
71
-  //int16_t n;
72 65
   unsigned long autostart_atmillis;
73
-  uint32_t sdpos ;
66
+  uint32_t sdpos;
74 67
 
75 68
   bool autostart_stilltocheck; //the sd start is delayed, because otherwise the serial cannot answer fast enought to make contact with the hostsoftware.
76
-  
69
+
77 70
   LsAction lsAction; //stored for recursion.
78
-  int16_t nrFiles; //counter for the files in the current directory and recycled as position counter for getting the nrFiles'th name in the directory.
71
+  uint16_t nrFiles; //counter for the files in the current directory and recycled as position counter for getting the nrFiles'th name in the directory.
79 72
   char* diveDirName;
80 73
   void lsDive(const char *prepend, SdFile parent, const char * const match=NULL);
81 74
 };
75
+
82 76
 extern CardReader card;
77
+
83 78
 #define IS_SD_PRINTING (card.sdprinting)
84 79
 
85 80
 #if (SDCARDDETECT > -1)
86
-# ifdef SDCARDDETECTINVERTED 
87
-#  define IS_SD_INSERTED (READ(SDCARDDETECT)!=0)
88
-# else
89
-#  define IS_SD_INSERTED (READ(SDCARDDETECT)==0)
90
-# endif //SDCARDTETECTINVERTED
81
+  #ifdef SDCARDDETECTINVERTED
82
+    #define IS_SD_INSERTED (READ(SDCARDDETECT) != 0)
83
+  #else
84
+    #define IS_SD_INSERTED (READ(SDCARDDETECT) == 0)
85
+  #endif
91 86
 #else
92
-//If we don't have a card detect line, aways asume the card is inserted
93
-# define IS_SD_INSERTED true
87
+  //No card detect line? Assume the card is inserted.
88
+  #define IS_SD_INSERTED true
94 89
 #endif
95 90
 
96 91
 #else
@@ -98,4 +93,5 @@ extern CardReader card;
98 93
 #define IS_SD_PRINTING (false)
99 94
 
100 95
 #endif //SDSUPPORT
101
-#endif
96
+
97
+#endif //__CARDREADER_H

+ 38
- 39
Marlin/digipot_mcp4451.cpp Ver arquivo

@@ -1,59 +1,58 @@
1 1
 #include "Configuration.h"
2 2
 
3 3
 #ifdef DIGIPOT_I2C
4
+
4 5
 #include "Stream.h"
5 6
 #include "utility/twi.h"
6 7
 #include "Wire.h"
7 8
 
8 9
 // Settings for the I2C based DIGIPOT (MCP4451) on Azteeg X3 Pro
9 10
 #if MB(5DPRINT)
10
-#define DIGIPOT_I2C_FACTOR 117.96
11
-#define DIGIPOT_I2C_MAX_CURRENT 1.736
11
+  #define DIGIPOT_I2C_FACTOR 117.96
12
+  #define DIGIPOT_I2C_MAX_CURRENT 1.736
12 13
 #else
13
-#define DIGIPOT_I2C_FACTOR 106.7
14
-#define DIGIPOT_I2C_MAX_CURRENT 2.5
14
+  #define DIGIPOT_I2C_FACTOR 106.7
15
+  #define DIGIPOT_I2C_MAX_CURRENT 2.5
15 16
 #endif
16 17
 
17
-static byte current_to_wiper( float current ){
18
-    return byte(ceil(float((DIGIPOT_I2C_FACTOR*current))));
18
+static byte current_to_wiper(float current) {
19
+  return byte(ceil(float((DIGIPOT_I2C_FACTOR*current))));
19 20
 }
20 21
 
21
-static void i2c_send(byte addr, byte a, byte b)
22
-{
23
-	Wire.beginTransmission(addr);
24
-    Wire.write(a);
25
-    Wire.write(b);
26
-    Wire.endTransmission();
22
+static void i2c_send(byte addr, byte a, byte b) {
23
+  Wire.beginTransmission(addr);
24
+  Wire.write(a);
25
+  Wire.write(b);
26
+  Wire.endTransmission();
27 27
 }
28 28
 
29 29
 // This is for the MCP4451 I2C based digipot
30
-void digipot_i2c_set_current( int channel, float current )
31
-{
32
-    current = min( (float) max( current, 0.0f ), DIGIPOT_I2C_MAX_CURRENT);
33
-    // these addresses are specific to Azteeg X3 Pro, can be set to others,
34
-    // In this case first digipot is at address A0=0, A1= 0, second one is at A0=0, A1= 1
35
-    byte addr= 0x2C; // channel 0-3
36
-    if(channel >= 4) {
37
-    	addr= 0x2E; // channel 4-7
38
-    	channel-= 4;
39
-    }
40
-
41
-    // Initial setup
42
-    i2c_send( addr, 0x40, 0xff );
43
-    i2c_send( addr, 0xA0, 0xff );
44
-
45
-    // Set actual wiper value
46
-    byte addresses[4] = { 0x00, 0x10, 0x60, 0x70 };
47
-    i2c_send( addr, addresses[channel], current_to_wiper(current) );
30
+void digipot_i2c_set_current(int channel, float current) {
31
+  current = min( (float) max( current, 0.0f ), DIGIPOT_I2C_MAX_CURRENT);
32
+  // these addresses are specific to Azteeg X3 Pro, can be set to others,
33
+  // In this case first digipot is at address A0=0, A1= 0, second one is at A0=0, A1= 1
34
+  byte addr = 0x2C; // channel 0-3
35
+  if (channel >= 4) {
36
+  	addr = 0x2E; // channel 4-7
37
+  	channel -= 4;
38
+  }
39
+
40
+  // Initial setup
41
+  i2c_send(addr, 0x40, 0xff);
42
+  i2c_send(addr, 0xA0, 0xff);
43
+
44
+  // Set actual wiper value
45
+  byte addresses[4] = { 0x00, 0x10, 0x60, 0x70 };
46
+  i2c_send(addr, addresses[channel], current_to_wiper(current));
48 47
 }
49 48
 
50
-void digipot_i2c_init()
51
-{
52
-    const float digipot_motor_current[] = DIGIPOT_I2C_MOTOR_CURRENTS;
53
-    Wire.begin();
54
-    // setup initial currents as defined in Configuration_adv.h
55
-    for(int i=0;i<=sizeof(digipot_motor_current)/sizeof(float);i++) {
56
-        digipot_i2c_set_current(i, digipot_motor_current[i]);
57
-    }
49
+void digipot_i2c_init() {
50
+  const float digipot_motor_current[] = DIGIPOT_I2C_MOTOR_CURRENTS;
51
+  Wire.begin();
52
+  // setup initial currents as defined in Configuration_adv.h
53
+  for(int i = 0; i <= sizeof(digipot_motor_current) / sizeof(float); i++) {
54
+    digipot_i2c_set_current(i, digipot_motor_current[i]);
55
+  }
58 56
 }
59
-#endif
57
+
58
+#endif //DIGIPOT_I2C

+ 8
- 0
Marlin/example_configurations/Hephestos/Configuration.h Ver arquivo

@@ -587,6 +587,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
587 587
 //#define LCD_FEEDBACK_FREQUENCY_HZ 1000	// this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
588 588
 //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
589 589
 
590
+// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
591
+// http://reprap.org/wiki/PanelOne
592
+//#define PANEL_ONE
593
+
590 594
 // The MaKr3d Makr-Panel with graphic controller and SD support
591 595
 // http://reprap.org/wiki/MaKr3d_MaKrPanel
592 596
 //#define MAKRPANEL
@@ -645,6 +649,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
645 649
  #define ENCODER_STEPS_PER_MENU_ITEM 1
646 650
 #endif
647 651
 
652
+#if defined (PANEL_ONE)
653
+ #define SDSUPPORT
654
+ #define ULTIMAKERCONTROLLER
655
+#endif
648 656
 
649 657
 #if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
650 658
  #define DOGLCD

+ 8
- 0
Marlin/example_configurations/K8200/Configuration.h Ver arquivo

@@ -597,6 +597,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
597 597
 //#define LCD_FEEDBACK_FREQUENCY_HZ 1000	// this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
598 598
 //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
599 599
 
600
+// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
601
+// http://reprap.org/wiki/PanelOne
602
+//#define PANEL_ONE
603
+
600 604
 // The MaKr3d Makr-Panel with graphic controller and SD support
601 605
 // http://reprap.org/wiki/MaKr3d_MaKrPanel
602 606
 //#define MAKRPANEL
@@ -655,6 +659,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
655 659
  #define ENCODER_STEPS_PER_MENU_ITEM 1
656 660
 #endif
657 661
 
662
+#if defined (PANEL_ONE)
663
+ #define SDSUPPORT
664
+ #define ULTIMAKERCONTROLLER
665
+#endif
658 666
 
659 667
 #if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
660 668
  #define DOGLCD

+ 8
- 0
Marlin/example_configurations/SCARA/Configuration.h Ver arquivo

@@ -590,6 +590,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
590 590
 //#define LCD_FEEDBACK_FREQUENCY_HZ 1000	// this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
591 591
 //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
592 592
 
593
+// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
594
+// http://reprap.org/wiki/PanelOne
595
+//#define PANEL_ONE
596
+
593 597
 // The MaKr3d Makr-Panel with graphic controller and SD support
594 598
 // http://reprap.org/wiki/MaKr3d_MaKrPanel
595 599
 //#define MAKRPANEL
@@ -648,6 +652,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
648 652
  #define ENCODER_STEPS_PER_MENU_ITEM 1
649 653
 #endif
650 654
 
655
+#if defined (PANEL_ONE)
656
+ #define SDSUPPORT
657
+ #define ULTIMAKERCONTROLLER
658
+#endif
651 659
 
652 660
 #if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
653 661
  #define DOGLCD

+ 8
- 0
Marlin/example_configurations/WITBOX/Configuration.h Ver arquivo

@@ -591,6 +591,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
591 591
 //#define LCD_FEEDBACK_FREQUENCY_HZ 1000	// this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
592 592
 //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
593 593
 
594
+// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
595
+// http://reprap.org/wiki/PanelOne
596
+//#define PANEL_ONE
597
+
594 598
 // The MaKr3d Makr-Panel with graphic controller and SD support
595 599
 // http://reprap.org/wiki/MaKr3d_MaKrPanel
596 600
 //#define MAKRPANEL
@@ -649,6 +653,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
649 653
  #define ENCODER_STEPS_PER_MENU_ITEM 1
650 654
 #endif
651 655
 
656
+#if defined (PANEL_ONE)
657
+ #define SDSUPPORT
658
+ #define ULTIMAKERCONTROLLER
659
+#endif
652 660
 
653 661
 #if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
654 662
  #define DOGLCD

+ 8
- 0
Marlin/example_configurations/delta/Configuration.h Ver arquivo

@@ -495,6 +495,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
495 495
 //#define LCD_FEEDBACK_FREQUENCY_HZ 1000	// this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
496 496
 //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
497 497
 
498
+// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
499
+// http://reprap.org/wiki/PanelOne
500
+//#define PANEL_ONE
501
+
498 502
 // The MaKr3d Makr-Panel with graphic controller and SD support
499 503
 // http://reprap.org/wiki/MaKr3d_MaKrPanel
500 504
 //#define MAKRPANEL
@@ -560,6 +564,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
560 564
  #define ENCODER_STEPS_PER_MENU_ITEM 1
561 565
 #endif
562 566
 
567
+#if defined (PANEL_ONE)
568
+ #define SDSUPPORT
569
+ #define ULTIMAKERCONTROLLER
570
+#endif
563 571
 
564 572
 #if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
565 573
  #define DOGLCD

+ 8
- 0
Marlin/example_configurations/makibox/Configuration.h Ver arquivo

@@ -565,6 +565,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
565 565
 //#define LCD_FEEDBACK_FREQUENCY_HZ 1000	// this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
566 566
 //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
567 567
 
568
+// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
569
+// http://reprap.org/wiki/PanelOne
570
+//#define PANEL_ONE
571
+
568 572
 // The MaKr3d Makr-Panel with graphic controller and SD support
569 573
 // http://reprap.org/wiki/MaKr3d_MaKrPanel
570 574
 //#define MAKRPANEL
@@ -623,6 +627,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
623 627
  #define ENCODER_STEPS_PER_MENU_ITEM 1
624 628
 #endif
625 629
 
630
+#if defined (PANEL_ONE)
631
+ #define SDSUPPORT
632
+ #define ULTIMAKERCONTROLLER
633
+#endif
626 634
 
627 635
 #if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
628 636
  #define DOGLCD

+ 8
- 0
Marlin/example_configurations/tvrrug/Round2/Configuration.h Ver arquivo

@@ -578,6 +578,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
578 578
 //#define LCD_FEEDBACK_FREQUENCY_HZ 1000	// this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
579 579
 //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
580 580
 
581
+// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
582
+// http://reprap.org/wiki/PanelOne
583
+//#define PANEL_ONE
584
+
581 585
 // The MaKr3d Makr-Panel with graphic controller and SD support
582 586
 // http://reprap.org/wiki/MaKr3d_MaKrPanel
583 587
 //#define MAKRPANEL
@@ -636,6 +640,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
636 640
  #define ENCODER_STEPS_PER_MENU_ITEM 1
637 641
 #endif
638 642
 
643
+#if defined (PANEL_ONE)
644
+ #define SDSUPPORT
645
+ #define ULTIMAKERCONTROLLER
646
+#endif
639 647
 
640 648
 #if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
641 649
  #define DOGLCD

+ 37
- 0
Marlin/language.h Ver arquivo

@@ -159,6 +159,43 @@
159 159
 
160 160
 #define MSG_ERR_EEPROM_WRITE                "Error writing to EEPROM!"
161 161
 
162
+// temperature.cpp strings
163
+#define MSG_PID_AUTOTUNE                    "PID Autotune"
164
+#define MSG_PID_AUTOTUNE_START              MSG_PID_AUTOTUNE " start"
165
+#define MSG_PID_AUTOTUNE_FAILED             MSG_PID_AUTOTUNE " failed!"
166
+#define MSG_PID_BAD_EXTRUDER_NUM            MSG_PID_AUTOTUNE_FAILED " Bad extruder number"
167
+#define MSG_PID_TEMP_TOO_HIGH               MSG_PID_AUTOTUNE_FAILED " Temperature too high"
168
+#define MSG_PID_TIMEOUT                     MSG_PID_AUTOTUNE_FAILED " timeout"
169
+#define MSG_BIAS                            " bias: "
170
+#define MSG_D                               " d: "
171
+#define MSG_MIN                             " min: "
172
+#define MSG_MAX                             " max: "
173
+#define MSG_KU                              " Ku: "
174
+#define MSG_TU                              " Tu: "
175
+#define MSG_CLASSIC_PID                     " Classic PID "
176
+#define MSG_KP                              " Kp: "
177
+#define MSG_KI                              " Ki: "
178
+#define MSG_KD                              " Kd: "
179
+#define MSG_OK_B                            "ok B:"
180
+#define MSG_OK_T                            "ok T:"
181
+#define MSG_AT                              " @:"
182
+#define MSG_PID_AUTOTUNE_FINISHED           MSG_PID_AUTOTUNE " finished! Put the last Kp, Ki and Kd constants from above into Configuration.h"
183
+#define MSG_PID_DEBUG                       " PID_DEBUG "
184
+#define MSG_PID_DEBUG_INPUT                 ": Input "
185
+#define MSG_PID_DEBUG_OUTPUT                " Output "
186
+#define MSG_PID_DEBUG_PTERM                 " pTerm "
187
+#define MSG_PID_DEBUG_ITERM                 " iTerm "
188
+#define MSG_PID_DEBUG_DTERM                 " dTerm "
189
+#define MSG_HEATING_FAILED                  "Heating failed"
190
+#define MSG_EXTRUDER_SWITCHED_OFF           "Extruder switched off. Temperature difference between temp sensors is too high !"
191
+
192
+#define MSG_INVALID_EXTRUDER_NUM            " - Invalid extruder number !"
193
+#define MSG_THERMAL_RUNAWAY_STOP            "Thermal Runaway, system stopped! Heater_ID: "
194
+#define MSG_SWITCHED_OFF_MAX                " switched off. MAXTEMP triggered !!"
195
+#define MSG_MINTEMP_EXTRUDER_OFF            ": Extruder switched off. MINTEMP triggered !"
196
+#define MSG_MAXTEMP_EXTRUDER_OFF            ": Extruder" MSG_SWITCHED_OFF_MAX
197
+#define MSG_MAXTEMP_BED_OFF                 "Heated bed" MSG_SWITCHED_OFF_MAX
198
+
162 199
 // LCD Menu Messages
163 200
 
164 201
 // Add your own character. Reference: https://github.com/MarlinFirmware/Marlin/pull/1434 photos

+ 76
- 16
Marlin/language_en.h Ver arquivo

@@ -65,6 +65,18 @@
65 65
 #ifndef MSG_PREHEAT_ABS_SETTINGS
66 66
 #define MSG_PREHEAT_ABS_SETTINGS            MSG_PREHEAT_ABS " conf"
67 67
 #endif
68
+#ifndef MSG_H1
69
+#define MSG_H1                              "1"
70
+#endif
71
+#ifndef MSG_H2
72
+#define MSG_H2                              "2"
73
+#endif
74
+#ifndef MSG_H3
75
+#define MSG_H3                              "3"
76
+#endif
77
+#ifndef MSG_H4
78
+#define MSG_H4                              "4"
79
+#endif
68 80
 #ifndef MSG_COOLDOWN
69 81
 #define MSG_COOLDOWN                        "Cooldown"
70 82
 #endif
@@ -110,6 +122,15 @@
110 122
 #ifndef MSG_NOZZLE
111 123
 #define MSG_NOZZLE                          "Nozzle"
112 124
 #endif
125
+#ifndef MSG_N2
126
+#define MSG_N2                              " 2"
127
+#endif
128
+#ifndef MSG_N3
129
+#define MSG_N3                              " 3"
130
+#endif
131
+#ifndef MSG_N4
132
+#define MSG_N4                              " 4"
133
+#endif
113 134
 #ifndef MSG_BED
114 135
 #define MSG_BED                             "Bed"
115 136
 #endif
@@ -119,6 +140,18 @@
119 140
 #ifndef MSG_FLOW
120 141
 #define MSG_FLOW                            "Flow"
121 142
 #endif
143
+#ifndef MSG_F0
144
+#define MSG_F0                              " 0"
145
+#endif
146
+#ifndef MSG_F1
147
+#define MSG_F1                              " 1"
148
+#endif
149
+#ifndef MSG_F2
150
+#define MSG_F2                              " 2"
151
+#endif
152
+#ifndef MSG_F3
153
+#define MSG_F3                              " 3"
154
+#endif
122 155
 #ifndef MSG_CONTROL
123 156
 #define MSG_CONTROL                         "Control"
124 157
 #endif
@@ -152,6 +185,15 @@
152 185
 #ifndef MSG_PID_C
153 186
 #define MSG_PID_C                           "PID-C"
154 187
 #endif
188
+#ifndef MSG_E2
189
+#define MSG_E2                              " E2"
190
+#endif
191
+#ifndef MSG_E3
192
+#define MSG_E3                              " E3"
193
+#endif
194
+#ifndef MSG_E4
195
+#define MSG_E4                              " E4"
196
+#endif
155 197
 #ifndef MSG_ACC
156 198
 #define MSG_ACC                             "Accel"
157 199
 #endif
@@ -213,7 +255,7 @@
213 255
 #define MSG_VOLUMETRIC                      "Filament"
214 256
 #endif
215 257
 #ifndef MSG_VOLUMETRIC_ENABLED
216
-#define MSG_VOLUMETRIC_ENABLED		          "E in mm" STR_h3
258
+#define MSG_VOLUMETRIC_ENABLED              "E in mm" STR_h3
217 259
 #endif
218 260
 #ifndef MSG_FILAMENT_SIZE_EXTRUDER_0
219 261
 #define MSG_FILAMENT_SIZE_EXTRUDER_0        "Fil. Dia. 1"
@@ -341,23 +383,41 @@
341 383
 #ifndef MSG_ENDSTOP_ABORT
342 384
 #define MSG_ENDSTOP_ABORT                   "Endstop abort"
343 385
 #endif
386
+#ifndef MSG_HEATING_FAILED_LCD
387
+#define MSG_HEATING_FAILED_LCD              "Heating failed"
388
+#endif
389
+#ifndef MSG_ERR_REDUNDANT_TEMP
390
+#define MSG_ERR_REDUNDANT_TEMP              "Err: REDUNDANT TEMP ERROR"
391
+#endif
392
+#ifndef MSG_THERMAL_RUNAWAY
393
+#define MSG_THERMAL_RUNAWAY                 "THERMAL RUNAWAY"
394
+#endif
395
+#ifndef MSG_ERR_MAXTEMP
396
+#define MSG_ERR_MAXTEMP                     "Err: MAXTEMP"
397
+#endif
398
+#ifndef MSG_ERR_MINTEMP
399
+#define MSG_ERR_MINTEMP                     "Err: MINTEMP"
400
+#endif
401
+#ifndef MSG_ERR_MAXTEMP_BED
402
+#define MSG_ERR_MAXTEMP_BED                 "Err: MAXTEMP BED"
403
+#endif
344 404
 
345 405
 #ifdef DELTA_CALIBRATION_MENU
346
-    #ifndef MSG_DELTA_CALIBRATE
347
-    #define MSG_DELTA_CALIBRATE             "Delta Calibration"
348
-    #endif
349
-    #ifndef MSG_DELTA_CALIBRATE_X
350
-    #define MSG_DELTA_CALIBRATE_X           "Calibrate X"
351
-    #endif
352
-    #ifndef MSG_DELTA_CALIBRATE_Y
353
-    #define MSG_DELTA_CALIBRATE_Y           "Calibrate Y"
354
-    #endif
355
-    #ifndef MSG_DELTA_CALIBRATE_Z
356
-    #define MSG_DELTA_CALIBRATE_Z           "Calibrate Z"
357
-    #endif
358
-    #ifndef MSG_DELTA_CALIBRATE_CENTER
359
-    #define MSG_DELTA_CALIBRATE_CENTER      "Calibrate Center"
360
-    #endif
406
+  #ifndef MSG_DELTA_CALIBRATE
407
+  #define MSG_DELTA_CALIBRATE             "Delta Calibration"
408
+  #endif
409
+  #ifndef MSG_DELTA_CALIBRATE_X
410
+  #define MSG_DELTA_CALIBRATE_X           "Calibrate X"
411
+  #endif
412
+  #ifndef MSG_DELTA_CALIBRATE_Y
413
+  #define MSG_DELTA_CALIBRATE_Y           "Calibrate Y"
414
+  #endif
415
+  #ifndef MSG_DELTA_CALIBRATE_Z
416
+  #define MSG_DELTA_CALIBRATE_Z           "Calibrate Z"
417
+  #endif
418
+  #ifndef MSG_DELTA_CALIBRATE_CENTER
419
+  #define MSG_DELTA_CALIBRATE_CENTER      "Calibrate Center"
420
+  #endif
361 421
 #endif // DELTA_CALIBRATION_MENU
362 422
 
363 423
 #endif // LANGUAGE_EN_H

+ 20
- 6
Marlin/pins_RAMPS_13.h Ver arquivo

@@ -122,12 +122,22 @@
122 122
 #ifdef ULTRA_LCD
123 123
 
124 124
   #ifdef NEWPANEL
125
-    #define LCD_PINS_RS 16
126
-    #define LCD_PINS_ENABLE 17
127
-    #define LCD_PINS_D4 23
128
-    #define LCD_PINS_D5 25
129
-    #define LCD_PINS_D6 27
130
-    #define LCD_PINS_D7 29
125
+    #ifdef PANEL_ONE
126
+      #define LCD_PINS_RS 40
127
+      #define LCD_PINS_ENABLE 42
128
+      #define LCD_PINS_D4 65
129
+      #define LCD_PINS_D5 66
130
+      #define LCD_PINS_D6 44
131
+      #define LCD_PINS_D7 64
132
+    #else
133
+      #define LCD_PINS_RS 16
134
+      #define LCD_PINS_ENABLE 17
135
+      #define LCD_PINS_D4 23
136
+      #define LCD_PINS_D5 25
137
+      #define LCD_PINS_D6 27
138
+      #define LCD_PINS_D7 29
139
+    #endif
140
+
131 141
 
132 142
     #ifdef REPRAP_DISCOUNT_SMART_CONTROLLER
133 143
       #define BEEPER 37
@@ -162,6 +172,10 @@
162 172
         #define SHIFT_OUT 40 // shift register
163 173
         #define SHIFT_CLK 44 // shift register
164 174
         #define SHIFT_LD 42 // shift register
175
+      #elif defined(PANEL_ONE)
176
+        #define BTN_EN1 59 // AUX2 PIN 3
177
+        #define BTN_EN2 63 // AUX2 PIN 4
178
+        #define BTN_ENC 49 // AUX3 PIN 7
165 179
       #else
166 180
         #define BTN_EN1 37
167 181
         #define BTN_EN2 35

+ 4
- 0
Marlin/pins_RUMBA.h Ver arquivo

@@ -6,6 +6,10 @@
6 6
   #error Oops!  Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu.
7 7
 #endif
8 8
 
9
+#if EXTRUDERS > 3
10
+  #error RUMBA supports up to 3 extruders. Comment this line to keep going.
11
+#endif
12
+
9 13
 #define X_STEP_PIN         17
10 14
 #define X_DIR_PIN          16
11 15
 #define X_ENABLE_PIN       48

+ 71
- 76
Marlin/stepper.cpp Ver arquivo

@@ -399,89 +399,84 @@ ISR(TIMER1_COMPA_vect)
399 399
       count_direction[Y_AXIS]=1;
400 400
     }
401 401
 
402
-    // Set direction en check limit switches
403
-    #ifndef COREXY
404
-    if ((out_bits & (1<<X_AXIS)) != 0)   // stepping along -X axis
405
-    #else
406
-    if ((out_bits & (1<<X_HEAD)) != 0)   //AlexBorro: Head direction in -X axis for CoreXY bots.
407
-    #endif
402
+    if(check_endstops) // check X and Y Endstops
408 403
     {
409
-      CHECK_ENDSTOPS
410
-      {
411
-        #ifdef DUAL_X_CARRIAGE
412
-        // with 2 x-carriages, endstops are only checked in the homing direction for the active extruder
413
-        if ((current_block->active_extruder == 0 && X_HOME_DIR == -1) 
414
-            || (current_block->active_extruder != 0 && X2_HOME_DIR == -1))
415
-        #endif          
416
-        {
417
-          #if defined(X_MIN_PIN) && X_MIN_PIN > -1
418
-            bool x_min_endstop=(READ(X_MIN_PIN) != X_MIN_ENDSTOP_INVERTING);
419
-            if(x_min_endstop && old_x_min_endstop && (current_block->steps_x > 0)) {
420
-              endstops_trigsteps[X_AXIS] = count_position[X_AXIS];
421
-              endstop_x_hit=true;
422
-              step_events_completed = current_block->step_event_count;
404
+        #ifndef COREXY
405
+        if ((out_bits & (1<<X_AXIS)) != 0)   // stepping along -X axis (regular cartesians bot)
406
+        #else
407
+        if (!((current_block->steps_x == current_block->steps_y) && ((out_bits & (1<<X_AXIS))>>X_AXIS != (out_bits & (1<<Y_AXIS))>>Y_AXIS))) // AlexBorro: If DeltaX == -DeltaY, the movement is only in Y axis
408
+        if ((out_bits & (1<<X_HEAD)) != 0) //AlexBorro: Head direction in -X axis for CoreXY bots.
409
+        #endif
410
+        { // -direction
411
+            #ifdef DUAL_X_CARRIAGE
412
+            // with 2 x-carriages, endstops are only checked in the homing direction for the active extruder
413
+            if ((current_block->active_extruder == 0 && X_HOME_DIR == -1) || (current_block->active_extruder != 0 && X2_HOME_DIR == -1))
414
+            #endif          
415
+            {
416
+                #if defined(X_MIN_PIN) && X_MIN_PIN > -1
417
+                bool x_min_endstop=(READ(X_MIN_PIN) != X_MIN_ENDSTOP_INVERTING);
418
+                if(x_min_endstop && old_x_min_endstop && (current_block->steps_x > 0))
419
+                {
420
+                    endstops_trigsteps[X_AXIS] = count_position[X_AXIS];
421
+                    endstop_x_hit=true;
422
+                    step_events_completed = current_block->step_event_count;
423
+                }
424
+                old_x_min_endstop = x_min_endstop;
425
+                #endif
423 426
             }
424
-            old_x_min_endstop = x_min_endstop;
425
-          #endif
426 427
         }
427
-      }
428
-    }
429
-    else 
430
-    { // +direction
431
-      CHECK_ENDSTOPS
432
-      {
433
-        #ifdef DUAL_X_CARRIAGE
434
-        // with 2 x-carriages, endstops are only checked in the homing direction for the active extruder
435
-        if ((current_block->active_extruder == 0 && X_HOME_DIR == 1) 
436
-            || (current_block->active_extruder != 0 && X2_HOME_DIR == 1))
437
-        #endif          
438
-        {
439
-          #if defined(X_MAX_PIN) && X_MAX_PIN > -1
440
-            bool x_max_endstop=(READ(X_MAX_PIN) != X_MAX_ENDSTOP_INVERTING);
441
-            if(x_max_endstop && old_x_max_endstop && (current_block->steps_x > 0)){
442
-              endstops_trigsteps[X_AXIS] = count_position[X_AXIS];
443
-              endstop_x_hit=true;
444
-              step_events_completed = current_block->step_event_count;
428
+        else 
429
+        { // +direction
430
+            #ifdef DUAL_X_CARRIAGE
431
+            // with 2 x-carriages, endstops are only checked in the homing direction for the active extruder
432
+            if ((current_block->active_extruder == 0 && X_HOME_DIR == 1) || (current_block->active_extruder != 0 && X2_HOME_DIR == 1))
433
+            #endif          
434
+            {
435
+                #if defined(X_MAX_PIN) && X_MAX_PIN > -1
436
+                bool x_max_endstop=(READ(X_MAX_PIN) != X_MAX_ENDSTOP_INVERTING);
437
+                if(x_max_endstop && old_x_max_endstop && (current_block->steps_x > 0))
438
+                {
439
+                    endstops_trigsteps[X_AXIS] = count_position[X_AXIS];
440
+                    endstop_x_hit=true;
441
+                    step_events_completed = current_block->step_event_count;
442
+                }
443
+                old_x_max_endstop = x_max_endstop;
444
+                #endif
445 445
             }
446
-            old_x_max_endstop = x_max_endstop;
447
-          #endif
448 446
         }
449
-      }
450
-    }
451 447
 
452
-    #ifndef COREXY
453
-    if ((out_bits & (1<<Y_AXIS)) != 0)   // -direction
454
-    #else
455
-    if ((out_bits & (1<<Y_HEAD)) != 0)  //AlexBorro: Head direction in -Y axis for CoreXY bots.
456
-    #endif
457
-    {
458
-      CHECK_ENDSTOPS
459
-      {
460
-        #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1
461
-          bool y_min_endstop=(READ(Y_MIN_PIN) != Y_MIN_ENDSTOP_INVERTING);
462
-          if(y_min_endstop && old_y_min_endstop && (current_block->steps_y > 0)) {
463
-            endstops_trigsteps[Y_AXIS] = count_position[Y_AXIS];
464
-            endstop_y_hit=true;
465
-            step_events_completed = current_block->step_event_count;
466
-          }
467
-          old_y_min_endstop = y_min_endstop;
468
-        #endif
469
-      }
470
-    }
471
-    else 
472
-    { // +direction
473
-      CHECK_ENDSTOPS
474
-      {
475
-        #if defined(Y_MAX_PIN) && Y_MAX_PIN > -1
476
-          bool y_max_endstop=(READ(Y_MAX_PIN) != Y_MAX_ENDSTOP_INVERTING);
477
-          if(y_max_endstop && old_y_max_endstop && (current_block->steps_y > 0)){
478
-            endstops_trigsteps[Y_AXIS] = count_position[Y_AXIS];
479
-            endstop_y_hit=true;
480
-            step_events_completed = current_block->step_event_count;
481
-          }
482
-          old_y_max_endstop = y_max_endstop;
448
+        #ifndef COREXY
449
+        if ((out_bits & (1<<Y_AXIS)) != 0)   // -direction
450
+        #else
451
+        if (!((current_block->steps_x == current_block->steps_y) && ((out_bits & (1<<X_AXIS))>>X_AXIS == (out_bits & (1<<Y_AXIS))>>Y_AXIS))) // AlexBorro: If DeltaX == DeltaY, the movement is only in X axis
452
+        if ((out_bits & (1<<Y_HEAD)) != 0)  //AlexBorro: Head direction in -Y axis for CoreXY bots.
483 453
         #endif
484
-      }
454
+        { // -direction
455
+            #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1
456
+            bool y_min_endstop=(READ(Y_MIN_PIN) != Y_MIN_ENDSTOP_INVERTING);
457
+            if(y_min_endstop && old_y_min_endstop && (current_block->steps_y > 0))
458
+            {
459
+                endstops_trigsteps[Y_AXIS] = count_position[Y_AXIS];
460
+                endstop_y_hit=true;
461
+                step_events_completed = current_block->step_event_count;
462
+            }
463
+            old_y_min_endstop = y_min_endstop;
464
+            #endif
465
+        }
466
+        else 
467
+        { // +direction
468
+            #if defined(Y_MAX_PIN) && Y_MAX_PIN > -1
469
+            bool y_max_endstop=(READ(Y_MAX_PIN) != Y_MAX_ENDSTOP_INVERTING);
470
+            if(y_max_endstop && old_y_max_endstop && (current_block->steps_y > 0))
471
+            {
472
+                endstops_trigsteps[Y_AXIS] = count_position[Y_AXIS];
473
+                endstop_y_hit=true;
474
+                step_events_completed = current_block->step_event_count;
475
+            }
476
+            old_y_max_endstop = y_max_endstop;
477
+            #endif
478
+
479
+        }
485 480
     }
486 481
 
487 482
     if ((out_bits & (1<<Z_AXIS)) != 0) {   // -direction

+ 912
- 1266
Marlin/temperature.cpp
Diferenças do arquivo suprimidas por serem muito extensas
Ver arquivo


+ 39
- 72
Marlin/temperature.h Ver arquivo

@@ -85,55 +85,25 @@ extern float current_temperature_bed;
85 85
 //inline so that there is no performance decrease.
86 86
 //deg=degreeCelsius
87 87
 
88
-FORCE_INLINE float degHotend(uint8_t extruder) {  
89
-  return current_temperature[extruder];
90
-};
88
+FORCE_INLINE float degHotend(uint8_t extruder) { return current_temperature[extruder]; }
89
+FORCE_INLINE float degBed() { return current_temperature_bed; }
91 90
 
92 91
 #ifdef SHOW_TEMP_ADC_VALUES
93
-  FORCE_INLINE float rawHotendTemp(uint8_t extruder) {  
94
-    return current_temperature_raw[extruder];
95
-  };
96
-
97
-  FORCE_INLINE float rawBedTemp() {  
98
-    return current_temperature_bed_raw;
99
-  };
92
+  FORCE_INLINE float rawHotendTemp(uint8_t extruder) { return current_temperature_raw[extruder]; }
93
+  FORCE_INLINE float rawBedTemp() { return current_temperature_bed_raw; }
100 94
 #endif
101 95
 
102
-FORCE_INLINE float degBed() {
103
-  return current_temperature_bed;
104
-};
105
-
106
-FORCE_INLINE float degTargetHotend(uint8_t extruder) {  
107
-  return target_temperature[extruder];
108
-};
109
-
110
-FORCE_INLINE float degTargetBed() {   
111
-  return target_temperature_bed;
112
-};
113
-
114
-FORCE_INLINE void setTargetHotend(const float &celsius, uint8_t extruder) {  
115
-  target_temperature[extruder] = celsius;
116
-};
117
-
118
-FORCE_INLINE void setTargetBed(const float &celsius) {  
119
-  target_temperature_bed = celsius;
120
-};
96
+FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; }
97
+FORCE_INLINE float degTargetBed() { return target_temperature_bed; }
121 98
 
122
-FORCE_INLINE bool isHeatingHotend(uint8_t extruder){  
123
-  return target_temperature[extruder] > current_temperature[extruder];
124
-};
99
+FORCE_INLINE void setTargetHotend(const float &celsius, uint8_t extruder) { target_temperature[extruder] = celsius; }
100
+FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; }
125 101
 
126
-FORCE_INLINE bool isHeatingBed() {
127
-  return target_temperature_bed > current_temperature_bed;
128
-};
102
+FORCE_INLINE bool isHeatingHotend(uint8_t extruder) { return target_temperature[extruder] > current_temperature[extruder]; }
103
+FORCE_INLINE bool isHeatingBed() { return target_temperature_bed > current_temperature_bed; }
129 104
 
130
-FORCE_INLINE bool isCoolingHotend(uint8_t extruder) {  
131
-  return target_temperature[extruder] < current_temperature[extruder];
132
-};
133
-
134
-FORCE_INLINE bool isCoolingBed() {
135
-  return target_temperature_bed < current_temperature_bed;
136
-};
105
+FORCE_INLINE bool isCoolingHotend(uint8_t extruder) { return target_temperature[extruder] < current_temperature[extruder]; }
106
+FORCE_INLINE bool isCoolingBed() { return target_temperature_bed < current_temperature_bed; }
137 107
 
138 108
 #define degHotend0() degHotend(0)
139 109
 #define degTargetHotend0() degTargetHotend(0)
@@ -141,38 +111,36 @@ FORCE_INLINE bool isCoolingBed() {
141 111
 #define isHeatingHotend0() isHeatingHotend(0)
142 112
 #define isCoolingHotend0() isCoolingHotend(0)
143 113
 #if EXTRUDERS > 1
144
-#define degHotend1() degHotend(1)
145
-#define degTargetHotend1() degTargetHotend(1)
146
-#define setTargetHotend1(_celsius) setTargetHotend((_celsius), 1)
147
-#define isHeatingHotend1() isHeatingHotend(1)
148
-#define isCoolingHotend1() isCoolingHotend(1)
114
+  #define degHotend1() degHotend(1)
115
+  #define degTargetHotend1() degTargetHotend(1)
116
+  #define setTargetHotend1(_celsius) setTargetHotend((_celsius), 1)
117
+  #define isHeatingHotend1() isHeatingHotend(1)
118
+  #define isCoolingHotend1() isCoolingHotend(1)
149 119
 #else
150
-#define setTargetHotend1(_celsius) do{}while(0)
120
+  #define setTargetHotend1(_celsius) do{}while(0)
151 121
 #endif
152 122
 #if EXTRUDERS > 2
153
-#define degHotend2() degHotend(2)
154
-#define degTargetHotend2() degTargetHotend(2)
155
-#define setTargetHotend2(_celsius) setTargetHotend((_celsius), 2)
156
-#define isHeatingHotend2() isHeatingHotend(2)
157
-#define isCoolingHotend2() isCoolingHotend(2)
123
+  #define degHotend2() degHotend(2)
124
+  #define degTargetHotend2() degTargetHotend(2)
125
+  #define setTargetHotend2(_celsius) setTargetHotend((_celsius), 2)
126
+  #define isHeatingHotend2() isHeatingHotend(2)
127
+  #define isCoolingHotend2() isCoolingHotend(2)
158 128
 #else
159
-#define setTargetHotend2(_celsius) do{}while(0)
129
+  #define setTargetHotend2(_celsius) do{}while(0)
160 130
 #endif
161 131
 #if EXTRUDERS > 3
162
-#define degHotend3() degHotend(3)
163
-#define degTargetHotend3() degTargetHotend(3)
164
-#define setTargetHotend3(_celsius) setTargetHotend((_celsius), 3)
165
-#define isHeatingHotend3() isHeatingHotend(3)
166
-#define isCoolingHotend3() isCoolingHotend(3)
132
+  #define degHotend3() degHotend(3)
133
+  #define degTargetHotend3() degTargetHotend(3)
134
+  #define setTargetHotend3(_celsius) setTargetHotend((_celsius), 3)
135
+  #define isHeatingHotend3() isHeatingHotend(3)
136
+  #define isCoolingHotend3() isCoolingHotend(3)
167 137
 #else
168
-#define setTargetHotend3(_celsius) do{}while(0)
138
+  #define setTargetHotend3(_celsius) do{}while(0)
169 139
 #endif
170 140
 #if EXTRUDERS > 4
171
-#error Invalid number of extruders
141
+  #error Invalid number of extruders
172 142
 #endif
173 143
 
174
-
175
-
176 144
 int getHeaterPower(int heater);
177 145
 void disable_heater();
178 146
 void setWatch();
@@ -189,15 +157,14 @@ static bool thermal_runaway = false;
189 157
 #endif
190 158
 #endif
191 159
 
192
-FORCE_INLINE void autotempShutdown(){
193
-#ifdef AUTOTEMP
194
-  if(autotemp_enabled)
195
-  {
196
-    autotemp_enabled=false;
197
-    if(degTargetHotend(active_extruder)>autotemp_min)
198
-      setTargetHotend(0,active_extruder);
199
-  }
200
-#endif
160
+FORCE_INLINE void autotempShutdown() {
161
+  #ifdef AUTOTEMP
162
+    if (autotemp_enabled) {
163
+      autotemp_enabled = false;
164
+      if (degTargetHotend(active_extruder) > autotemp_min)
165
+        setTargetHotend(0, active_extruder);
166
+    }
167
+  #endif
201 168
 }
202 169
 
203 170
 void PID_autotune(float temp, int extruder, int ncycles);

+ 17
- 4
Marlin/thermistortables.h Ver arquivo

@@ -1096,13 +1096,26 @@ const short temptable_1047[][2] PROGMEM = {
1096 1096
 #endif
1097 1097
 
1098 1098
 #if (THERMISTORHEATER_0 == 999) || (THERMISTORHEATER_1 == 999) || (THERMISTORHEATER_2 == 999) || (THERMISTORHEATER_3 == 999) || (THERMISTORBED == 999) //User defined table
1099
-// Dummy Thermistor table.. It will ALWAYS read 25C.
1100
-const short temptable_999[][2] PROGMEM = {
1101
-   {1*OVERSAMPLENR, 25},
1102
-   {1023*OVERSAMPLENR, 25}
1099
+  // Dummy Thermistor table.. It will ALWAYS read a fixed value.
1100
+  #ifndef DUMMY_THERMISTOR_999_VALUE
1101
+    #define DUMMY_THERMISTOR_999_VALUE 25
1102
+  #endif
1103
+  const short temptable_999[][2] PROGMEM = {
1104
+    {1*OVERSAMPLENR, DUMMY_THERMISTOR_999_VALUE},
1105
+    {1023*OVERSAMPLENR, DUMMY_THERMISTOR_999_VALUE}
1103 1106
 };
1104 1107
 #endif
1105 1108
 
1109
+#if (THERMISTORHEATER_0 == 998) || (THERMISTORHEATER_1 == 998) || (THERMISTORHEATER_2 == 998) || (THERMISTORHEATER_3 == 998) || (THERMISTORBED == 998) //User defined table
1110
+  // Dummy Thermistor table.. It will ALWAYS read a fixed value.
1111
+  #ifndef DUMMY_THERMISTOR_998_VALUE
1112
+    #define DUMMY_THERMISTOR_998_VALUE 25
1113
+  #endif
1114
+  const short temptable_998[][2] PROGMEM = {
1115
+    {1*OVERSAMPLENR, DUMMY_THERMISTOR_998_VALUE},
1116
+    {1023*OVERSAMPLENR, DUMMY_THERMISTOR_998_VALUE}
1117
+};
1118
+#endif
1106 1119
 
1107 1120
 
1108 1121
 #define _TT_NAME(_N) temptable_ ## _N

+ 696
- 878
Marlin/ultralcd.cpp
Diferenças do arquivo suprimidas por serem muito extensas
Ver arquivo


Carregando…
Cancelar
Salvar