Просмотр исходного кода

Merge pull request #88 from daid/Marlin_v1

Made plan_buffer_line arguments const...
ErikZalm 13 лет назад
Родитель
Сommit
1d5809d458
6 измененных файлов: 29 добавлений и 55 удалений
  1. 3
    31
      Marlin/cardreader.h
  2. 11
    13
      Marlin/pins.h
  3. 1
    1
      Marlin/planner.cpp
  4. 1
    1
      Marlin/planner.h
  5. 3
    5
      Marlin/ultralcd.h
  6. 10
    4
      Marlin/ultralcd.pde

+ 3
- 31
Marlin/cardreader.h Просмотреть файл

@@ -64,39 +64,11 @@ private:
64 64
   char* diveDirName;
65 65
   void lsDive(const char *prepend,SdFile parent);
66 66
 };
67
-  
67
+#define IS_SD_PRINTING (card.sdprinting)
68 68
 
69 69
 #else
70 70
 
71
-#define dir_t bool 
72
-class CardReader
73
-{
74
-public:
75
-  FORCE_INLINE CardReader(){};
76
-  
77
-  FORCE_INLINE static void initsd(){};
78
-  FORCE_INLINE static void write_command(char *buf){};
79
-  
80
-  FORCE_INLINE static void checkautostart(bool x) {}; 
81
-  
82
-  FORCE_INLINE static void openFile(char* name,bool read){};
83
-  FORCE_INLINE static void closefile() {};
84
-  FORCE_INLINE static void release(){};
85
-  FORCE_INLINE static void startFileprint(){};
86
-  FORCE_INLINE static void startFilewrite(char *name){};
87
-  FORCE_INLINE static void pauseSDPrint(){};
88
-  FORCE_INLINE static void getStatus(){};
89
-  
90
-  FORCE_INLINE static void selectFile(char* name){};
91
-  FORCE_INLINE static void getfilename(const uint8_t nr){};
92
-  FORCE_INLINE static uint8_t getnrfilenames(){return 0;};
93
-  
71
+#define IS_SD_PRINTING (false)
94 72
 
95
-  FORCE_INLINE static void ls() {};
96
-  FORCE_INLINE static bool eof() {return true;};
97
-  FORCE_INLINE static char get() {return 0;};
98
-  FORCE_INLINE static void setIndex(){};
99
-  FORCE_INLINE uint8_t percentDone(){return 0;};
100
-};
101 73
 #endif //SDSUPPORT
102
-#endif
74
+#endif

+ 11
- 13
Marlin/pins.h Просмотреть файл

@@ -940,22 +940,20 @@
940 940
 #endif
941 941
 
942 942
 //List of pins which to ignore when asked to change by gcode, 0 and 1 are RX and TX, do not mess with those!
943
-#define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN
944
-#if EXTRUDERS == 3
945
-  #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN
946
-  #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN
947
-#elif EXTRUDERS == 2
948
-  #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN
949
-  #define _E2_PINS -1
950
-#elif EXTRUDERS == 1
951
-  #define _E1_PINS -1 
952
-  #define _E2_PINS -1
943
+#define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, HEATER_0_PIN, 
944
+#if EXTRUDERS > 1
945
+  #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, HEATER_1_PIN,
953 946
 #else
954
-  #error Unsupported number of extruders
947
+  #define _E1_PINS
955 948
 #endif
949
+#if EXTRUDERS > 2
950
+  #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, HEATER_2_PIN,
951
+#else
952
+  #define _E2_PINS
953
+#endif
954
+
956 955
 #define SENSITIVE_PINS {0, 1, X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, LED_PIN, PS_ON_PIN, \
957
-                        HEATER_0_PIN, HEATER_1_PIN, HEATER_2_PIN, \
958 956
                         HEATER_BED_PIN, FAN_PIN,                  \
959
-                        _E0_PINS, _E1_PINS, _E2_PINS,             \
957
+                        _E0_PINS _E1_PINS _E2_PINS             \
960 958
                         TEMP_0_PIN, TEMP_1_PIN, TEMP_2_PIN, TEMP_BED_PIN }
961 959
 #endif

+ 1
- 1
Marlin/planner.cpp Просмотреть файл

@@ -441,7 +441,7 @@ float junction_deviation = 0.1;
441 441
 // Add a new linear movement to the buffer. steps_x, _y and _z is the absolute position in 
442 442
 // mm. Microseconds specify how many microseconds the move should take to perform. To aid acceleration
443 443
 // calculation the caller must also provide the physical length of the line in millimeters.
444
-void plan_buffer_line(float &x, float &y, float &z, float &e, float feed_rate, uint8_t &extruder)
444
+void plan_buffer_line(const float &x, const float &y, const float &z, const float &e, float feed_rate, const uint8_t &extruder)
445 445
 {
446 446
   // Calculate the buffer head after we push this byte
447 447
   int next_buffer_head = next_block_index(block_buffer_head);

+ 1
- 1
Marlin/planner.h Просмотреть файл

@@ -67,7 +67,7 @@ void plan_init();
67 67
 
68 68
 // Add a new linear movement to the buffer. x, y and z is the signed, absolute target position in 
69 69
 // millimaters. Feed rate specifies the speed of the motion.
70
-void plan_buffer_line(float &x, float &y, float &z, float &e, float feed_rate, uint8_t &extruder);
70
+void plan_buffer_line(const float &x, const float &y, const float &z, const float &e, float feed_rate, const uint8_t &extruder);
71 71
 
72 72
 // Set position. Used for G92 instructions.
73 73
 void plan_set_position(const float &x, const float &y, const float &z, const float &e);

+ 3
- 5
Marlin/ultralcd.h Просмотреть файл

@@ -129,6 +129,7 @@
129 129
 
130 130
   //conversion routines, could need some overworking
131 131
   char *ftostr51(const float &x);
132
+  char *ftostr52(const float &x);
132 133
   char *ftostr31(const float &x);
133 134
   char *ftostr3(const float &x);
134 135
 
@@ -142,10 +143,8 @@
142 143
   #define LCD_MESSAGE(x)
143 144
   #define LCD_MESSAGEPGM(x)
144 145
   FORCE_INLINE void lcd_status() {};
145
-#endif
146
-  
147
-#ifndef ULTIPANEL  
148
- #define CLICKED false
146
+
147
+  #define CLICKED false
149 148
   #define BLOCK ;
150 149
 #endif 
151 150
   
@@ -160,4 +159,3 @@ char *itostr3(const int &xx);
160 159
 char *itostr4(const int &xx);
161 160
 char *ftostr51(const float &x);
162 161
 #endif //ULTRALCD
163
-

+ 10
- 4
Marlin/ultralcd.pde Просмотреть файл

@@ -12,7 +12,9 @@ extern volatile bool feedmultiplychanged;
12 12
 extern volatile int extrudemultiply;
13 13
 
14 14
 extern long position[4];   
15
+#ifdef SDSUPPORT
15 16
 extern CardReader card;
17
+#endif
16 18
 
17 19
 //===========================================================================
18 20
 //=============================public variables============================
@@ -480,7 +482,11 @@ void MainMenu::showPrepare()
480 482
       MENUITEM(  lcdprintPGM(MSG_MAIN)  ,  BLOCK;status=Main_Menu;beepshort(); ) ;
481 483
       break;
482 484
     case ItemP_autostart:
483
-      MENUITEM(  lcdprintPGM(MSG_AUTOSTART)  ,  BLOCK;card.lastnr=0;card.setroot();card.checkautostart(true);beepshort(); ) ;
485
+      MENUITEM(  lcdprintPGM(MSG_AUTOSTART)  ,  BLOCK;
486
+#ifdef SDSUPPORT
487
+          card.lastnr=0;card.setroot();card.checkautostart(true);
488
+#endif
489
+          beepshort(); ) ;
484 490
       break;
485 491
     case ItemP_disstep:
486 492
       MENUITEM(  lcdprintPGM(MSG_DISABLE_STEPPERS)  ,  BLOCK;enquecommand("M84");beepshort(); ) ;
@@ -1629,7 +1635,7 @@ void MainMenu::showControlMotion()
1629 1635
         if(linechanging)
1630 1636
         {
1631 1637
           if(encoderpos<5) encoderpos=5;
1632
-          if(encoderpos>99999) encoderpos=99999;
1638
+          if(encoderpos>32000) encoderpos=32000;//TODO: This is a problem, encoderpos is 16bit, but steps_per_unit for e can be wel over 800
1633 1639
           lcd.setCursor(11,line);lcd.print(ftostr52(encoderpos/100.0));
1634 1640
         }
1635 1641
         
@@ -1957,7 +1963,7 @@ void MainMenu::showMainMenu()
1957 1963
   #endif
1958 1964
   if(tune)
1959 1965
   {
1960
-    if(!(movesplanned() ||card.sdprinting))
1966
+    if(!(movesplanned() || IS_SD_PRINTING))
1961 1967
     {
1962 1968
       force_lcd_update=true;
1963 1969
       tune=false;
@@ -1965,7 +1971,7 @@ void MainMenu::showMainMenu()
1965 1971
   }
1966 1972
   else 
1967 1973
   {
1968
-    if(movesplanned() ||card.sdprinting)
1974
+    if(movesplanned() || IS_SD_PRINTING)
1969 1975
     {
1970 1976
       force_lcd_update=true;
1971 1977
       tune=true;

Загрузка…
Отмена
Сохранить