Переглянути джерело

Merge pull request #8157 from thinkyhead/bf2_anet_10_servo

[2.0.x] Define a default SERVO0_PIN for Anet 1.0
Scott Lahteine 7 роки тому
джерело
коміт
817175613a
Аккаунт користувача з таким Email не знайдено

+ 10
- 4
Marlin/src/HAL/HAL_AVR/watchdog_AVR.cpp Переглянути файл

@@ -30,16 +30,22 @@
30 30
 
31 31
 #include "../../Marlin.h"
32 32
 
33
-// Initialize watchdog with a 4 sec interrupt time
33
+// Initialize watchdog with 8s timeout, if possible. Otherwise, make it 4s.
34 34
 void watchdog_init() {
35
+  #if ENABLED(WATCHDOG_DURATION_8S) && defined(WDTO_8S)
36
+    #define WDTO_NS WDTO_8S
37
+  #else
38
+    #define WDTO_NS WDTO_4S
39
+  #endif
35 40
   #if ENABLED(WATCHDOG_RESET_MANUAL)
36 41
     // We enable the watchdog timer, but only for the interrupt.
37
-    // Take care, as this requires the correct order of operation, with interrupts disabled. See the datasheet of any AVR chip for details.
42
+    // Take care, as this requires the correct order of operation, with interrupts disabled.
43
+    // See the datasheet of any AVR chip for details.
38 44
     wdt_reset();
39 45
     _WD_CONTROL_REG = _BV(_WD_CHANGE_BIT) | _BV(WDE);
40
-    _WD_CONTROL_REG = _BV(WDIE) | WDTO_4S;
46
+    _WD_CONTROL_REG = _BV(WDIE) | WDTO_NS;
41 47
   #else
42
-    wdt_enable(WDTO_4S);
48
+    wdt_enable(WDTO_NS);
43 49
   #endif
44 50
 }
45 51
 

+ 1
- 1
Marlin/src/gcode/config/M200-M205.cpp Переглянути файл

@@ -121,7 +121,7 @@ void GcodeSuite::M204() {
121 121
 void GcodeSuite::M205() {
122 122
   if (parser.seen('S')) planner.min_feedrate_mm_s = parser.value_linear_units();
123 123
   if (parser.seen('T')) planner.min_travel_feedrate_mm_s = parser.value_linear_units();
124
-  if (parser.seen('B')) planner.min_segment_time = parser.value_millis();
124
+  if (parser.seen('B')) planner.min_segment_time_us = parser.value_ulong();
125 125
   if (parser.seen('X')) planner.max_jerk[X_AXIS] = parser.value_linear_units();
126 126
   if (parser.seen('Y')) planner.max_jerk[Y_AXIS] = parser.value_linear_units();
127 127
   if (parser.seen('Z')) planner.max_jerk[Z_AXIS] = parser.value_linear_units();

+ 6
- 6
Marlin/src/module/configuration_store.cpp Переглянути файл

@@ -56,7 +56,7 @@
56 56
  *  163  M204 T    planner.travel_acceleration      (float)
57 57
  *  167  M205 S    planner.min_feedrate_mm_s        (float)
58 58
  *  171  M205 T    planner.min_travel_feedrate_mm_s (float)
59
- *  175  M205 B    planner.min_segment_time         (ulong)
59
+ *  175  M205 B    planner.min_segment_time_us      (ulong)
60 60
  *  179  M205 X    planner.max_jerk[X_AXIS]         (float)
61 61
  *  183  M205 Y    planner.max_jerk[Y_AXIS]         (float)
62 62
  *  187  M205 Z    planner.max_jerk[Z_AXIS]         (float)
@@ -306,7 +306,7 @@ void MarlinSettings::postprocess() {
306 306
     EEPROM_WRITE(planner.travel_acceleration);
307 307
     EEPROM_WRITE(planner.min_feedrate_mm_s);
308 308
     EEPROM_WRITE(planner.min_travel_feedrate_mm_s);
309
-    EEPROM_WRITE(planner.min_segment_time);
309
+    EEPROM_WRITE(planner.min_segment_time_us);
310 310
     EEPROM_WRITE(planner.max_jerk);
311 311
     #if !HAS_HOME_OFFSET
312 312
       const float home_offset[XYZ] = { 0 };
@@ -719,7 +719,7 @@ void MarlinSettings::postprocess() {
719 719
       EEPROM_READ(planner.travel_acceleration);
720 720
       EEPROM_READ(planner.min_feedrate_mm_s);
721 721
       EEPROM_READ(planner.min_travel_feedrate_mm_s);
722
-      EEPROM_READ(planner.min_segment_time);
722
+      EEPROM_READ(planner.min_segment_time_us);
723 723
       EEPROM_READ(planner.max_jerk);
724 724
 
725 725
       #if !HAS_HOME_OFFSET
@@ -1204,7 +1204,7 @@ void MarlinSettings::reset() {
1204 1204
   planner.retract_acceleration = DEFAULT_RETRACT_ACCELERATION;
1205 1205
   planner.travel_acceleration = DEFAULT_TRAVEL_ACCELERATION;
1206 1206
   planner.min_feedrate_mm_s = DEFAULT_MINIMUMFEEDRATE;
1207
-  planner.min_segment_time = DEFAULT_MINSEGMENTTIME;
1207
+  planner.min_segment_time_us = DEFAULT_MINSEGMENTTIME;
1208 1208
   planner.min_travel_feedrate_mm_s = DEFAULT_MINTRAVELFEEDRATE;
1209 1209
   planner.max_jerk[X_AXIS] = DEFAULT_XJERK;
1210 1210
   planner.max_jerk[Y_AXIS] = DEFAULT_YJERK;
@@ -1562,12 +1562,12 @@ void MarlinSettings::reset() {
1562 1562
 
1563 1563
     if (!forReplay) {
1564 1564
       CONFIG_ECHO_START;
1565
-      SERIAL_ECHOLNPGM("Advanced: S<min_feedrate> T<min_travel_feedrate> B<min_segment_time_ms> X<max_xy_jerk> Z<max_z_jerk> E<max_e_jerk>");
1565
+      SERIAL_ECHOLNPGM("Advanced: S<min_feedrate> T<min_travel_feedrate> B<min_segment_time_us> X<max_xy_jerk> Z<max_z_jerk> E<max_e_jerk>");
1566 1566
     }
1567 1567
     CONFIG_ECHO_START;
1568 1568
     SERIAL_ECHOPAIR("  M205 S", LINEAR_UNIT(planner.min_feedrate_mm_s));
1569 1569
     SERIAL_ECHOPAIR(" T", LINEAR_UNIT(planner.min_travel_feedrate_mm_s));
1570
-    SERIAL_ECHOPAIR(" B", planner.min_segment_time);
1570
+    SERIAL_ECHOPAIR(" B", planner.min_segment_time_us);
1571 1571
     SERIAL_ECHOPAIR(" X", LINEAR_UNIT(planner.max_jerk[X_AXIS]));
1572 1572
     SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(planner.max_jerk[Y_AXIS]));
1573 1573
     SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(planner.max_jerk[Z_AXIS]));

+ 25
- 25
Marlin/src/module/planner.cpp Переглянути файл

@@ -112,7 +112,7 @@ float Planner::filament_size[EXTRUDERS],         // As a baseline for the multip
112 112
 uint32_t Planner::max_acceleration_steps_per_s2[XYZE_N],
113 113
          Planner::max_acceleration_mm_per_s2[XYZE_N]; // Use M201 to override by software
114 114
 
115
-millis_t Planner::min_segment_time;
115
+uint32_t Planner::min_segment_time_us;
116 116
 
117 117
 // Initialized by settings.load()
118 118
 float Planner::min_feedrate_mm_s,
@@ -159,7 +159,7 @@ float Planner::previous_speed[NUM_AXIS],
159 159
   // Old direction bits. Used for speed calculations
160 160
   unsigned char Planner::old_direction_bits = 0;
161 161
   // Segment times (in µs). Used for speed calculations
162
-  long Planner::axis_segment_time[2][3] = { {MAX_FREQ_TIME + 1, 0, 0}, {MAX_FREQ_TIME + 1, 0, 0} };
162
+  uint32_t Planner::axis_segment_time_us[2][3] = { { MAX_FREQ_TIME_US + 1, 0, 0 }, { MAX_FREQ_TIME_US + 1, 0, 0 } };
163 163
 #endif
164 164
 
165 165
 #if ENABLED(LIN_ADVANCE)
@@ -1057,15 +1057,15 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
1057 1057
   // Slow down when the buffer starts to empty, rather than wait at the corner for a buffer refill
1058 1058
   #if ENABLED(SLOWDOWN) || ENABLED(ULTRA_LCD) || defined(XY_FREQUENCY_LIMIT)
1059 1059
     // Segment time im micro seconds
1060
-    unsigned long segment_time = LROUND(1000000.0 / inverse_mm_s);
1060
+    uint32_t segment_time_us = LROUND(1000000.0 / inverse_mm_s);
1061 1061
   #endif
1062 1062
   #if ENABLED(SLOWDOWN)
1063 1063
     if (WITHIN(moves_queued, 2, (BLOCK_BUFFER_SIZE) / 2 - 1)) {
1064
-      if (segment_time < min_segment_time) {
1064
+      if (segment_time_us < min_segment_time_us) {
1065 1065
         // buffer is draining, add extra time.  The amount of time added increases if the buffer is still emptied more.
1066
-        inverse_mm_s = 1000000.0 / (segment_time + LROUND(2 * (min_segment_time - segment_time) / moves_queued));
1066
+        inverse_mm_s = 1000000.0 / (segment_time_us + LROUND(2 * (min_segment_time_us - segment_time_us) / moves_queued));
1067 1067
         #if defined(XY_FREQUENCY_LIMIT) || ENABLED(ULTRA_LCD)
1068
-          segment_time = LROUND(1000000.0 / inverse_mm_s);
1068
+          segment_time_us = LROUND(1000000.0 / inverse_mm_s);
1069 1069
         #endif
1070 1070
       }
1071 1071
     }
@@ -1073,7 +1073,7 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
1073 1073
 
1074 1074
   #if ENABLED(ULTRA_LCD)
1075 1075
     CRITICAL_SECTION_START
1076
-      block_buffer_runtime_us += segment_time;
1076
+      block_buffer_runtime_us += segment_time_us;
1077 1077
     CRITICAL_SECTION_END
1078 1078
   #endif
1079 1079
 
@@ -1130,34 +1130,34 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
1130 1130
     // Check and limit the xy direction change frequency
1131 1131
     const unsigned char direction_change = block->direction_bits ^ old_direction_bits;
1132 1132
     old_direction_bits = block->direction_bits;
1133
-    segment_time = LROUND((float)segment_time / speed_factor);
1133
+    segment_time_us = LROUND((float)segment_time_us / speed_factor);
1134 1134
 
1135
-    long xs0 = axis_segment_time[X_AXIS][0],
1136
-         xs1 = axis_segment_time[X_AXIS][1],
1137
-         xs2 = axis_segment_time[X_AXIS][2],
1138
-         ys0 = axis_segment_time[Y_AXIS][0],
1139
-         ys1 = axis_segment_time[Y_AXIS][1],
1140
-         ys2 = axis_segment_time[Y_AXIS][2];
1135
+    uint32_t xs0 = axis_segment_time_us[X_AXIS][0],
1136
+             xs1 = axis_segment_time_us[X_AXIS][1],
1137
+             xs2 = axis_segment_time_us[X_AXIS][2],
1138
+             ys0 = axis_segment_time_us[Y_AXIS][0],
1139
+             ys1 = axis_segment_time_us[Y_AXIS][1],
1140
+             ys2 = axis_segment_time_us[Y_AXIS][2];
1141 1141
 
1142 1142
     if (TEST(direction_change, X_AXIS)) {
1143
-      xs2 = axis_segment_time[X_AXIS][2] = xs1;
1144
-      xs1 = axis_segment_time[X_AXIS][1] = xs0;
1143
+      xs2 = axis_segment_time_us[X_AXIS][2] = xs1;
1144
+      xs1 = axis_segment_time_us[X_AXIS][1] = xs0;
1145 1145
       xs0 = 0;
1146 1146
     }
1147
-    xs0 = axis_segment_time[X_AXIS][0] = xs0 + segment_time;
1147
+    xs0 = axis_segment_time_us[X_AXIS][0] = xs0 + segment_time_us;
1148 1148
 
1149 1149
     if (TEST(direction_change, Y_AXIS)) {
1150
-      ys2 = axis_segment_time[Y_AXIS][2] = axis_segment_time[Y_AXIS][1];
1151
-      ys1 = axis_segment_time[Y_AXIS][1] = axis_segment_time[Y_AXIS][0];
1150
+      ys2 = axis_segment_time_us[Y_AXIS][2] = axis_segment_time_us[Y_AXIS][1];
1151
+      ys1 = axis_segment_time_us[Y_AXIS][1] = axis_segment_time_us[Y_AXIS][0];
1152 1152
       ys0 = 0;
1153 1153
     }
1154
-    ys0 = axis_segment_time[Y_AXIS][0] = ys0 + segment_time;
1154
+    ys0 = axis_segment_time_us[Y_AXIS][0] = ys0 + segment_time_us;
1155 1155
 
1156
-    const long max_x_segment_time = MAX3(xs0, xs1, xs2),
1157
-               max_y_segment_time = MAX3(ys0, ys1, ys2),
1158
-               min_xy_segment_time = min(max_x_segment_time, max_y_segment_time);
1159
-    if (min_xy_segment_time < MAX_FREQ_TIME) {
1160
-      const float low_sf = speed_factor * min_xy_segment_time / (MAX_FREQ_TIME);
1156
+    const uint32_t max_x_segment_time = MAX3(xs0, xs1, xs2),
1157
+                   max_y_segment_time = MAX3(ys0, ys1, ys2),
1158
+                   min_xy_segment_time = min(max_x_segment_time, max_y_segment_time);
1159
+    if (min_xy_segment_time < MAX_FREQ_TIME_US) {
1160
+      const float low_sf = speed_factor * min_xy_segment_time / (MAX_FREQ_TIME_US);
1161 1161
       NOMORE(speed_factor, low_sf);
1162 1162
     }
1163 1163
   #endif // XY_FREQUENCY_LIMIT

+ 6
- 6
Marlin/src/module/planner.h Переглянути файл

@@ -123,7 +123,7 @@ typedef struct {
123 123
     uint8_t valve_pressure, e_to_p_pressure;
124 124
   #endif
125 125
 
126
-  uint32_t segment_time;
126
+  uint32_t segment_time_us;
127 127
 
128 128
 } block_t;
129 129
 
@@ -154,9 +154,9 @@ class Planner {
154 154
                  axis_steps_per_mm[XYZE_N],
155 155
                  steps_to_mm[XYZE_N];
156 156
     static uint32_t max_acceleration_steps_per_s2[XYZE_N],
157
-                    max_acceleration_mm_per_s2[XYZE_N]; // Use M201 to override by software
157
+                    max_acceleration_mm_per_s2[XYZE_N]; // Use M201 to override
158 158
 
159
-    static millis_t min_segment_time;
159
+    static uint32_t min_segment_time_us; // Use 'M205 B<µs>' to override
160 160
     static float min_feedrate_mm_s,
161 161
                  acceleration,         // Normal acceleration mm/s^2  DEFAULT ACCELERATION for all printing moves. M204 SXXXX
162 162
                  retract_acceleration, // Retract acceleration mm/s^2 filament pull-back and push-forward while standing still in the other axes M204 TXXXX
@@ -214,11 +214,11 @@ class Planner {
214 214
 
215 215
     #ifdef XY_FREQUENCY_LIMIT
216 216
       // Used for the frequency limit
217
-      #define MAX_FREQ_TIME long(1000000.0/XY_FREQUENCY_LIMIT)
217
+      #define MAX_FREQ_TIME_US (uint32_t)(1000000.0 / XY_FREQUENCY_LIMIT)
218 218
       // Old direction bits. Used for speed calculations
219 219
       static unsigned char old_direction_bits;
220 220
       // Segment times (in µs). Used for speed calculations
221
-      static long axis_segment_time[2][3];
221
+      static long axis_segment_time_us[2][3];
222 222
     #endif
223 223
 
224 224
     #if ENABLED(LIN_ADVANCE)
@@ -439,7 +439,7 @@ class Planner {
439 439
       if (blocks_queued()) {
440 440
         block_t* block = &block_buffer[block_buffer_tail];
441 441
         #if ENABLED(ULTRA_LCD)
442
-          block_buffer_runtime_us -= block->segment_time; //We can't be sure how long an active block will take, so don't count it.
442
+          block_buffer_runtime_us -= block->segment_time_us; //We can't be sure how long an active block will take, so don't count it.
443 443
         #endif
444 444
         SBI(block->flag, BLOCK_BIT_BUSY);
445 445
         return block;

+ 21
- 19
Marlin/src/pins/pins_ANET_10.h Переглянути файл

@@ -155,36 +155,38 @@
155 155
 #if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)
156 156
   #define LCD_SDSS           28
157 157
   #if ENABLED(ADC_KEYPAD)
158
-    #define SERVO0_PIN         27 // free for BLTouch/3D-Touch
159
-    #define LCD_PINS_RS        28
160
-    #define LCD_PINS_ENABLE    29
161
-    #define LCD_PINS_D4        10
162
-    #define LCD_PINS_D5        11
163
-    #define LCD_PINS_D6        16
164
-    #define LCD_PINS_D7        17
165
-    #define BTN_EN1            -1
166
-    #define BTN_EN2            -1
167
-    #define BTN_ENC            -1
168
-    #define ADC_KEYPAD_PIN      1
158
+    #define SERVO0_PIN       27 // free for BLTouch/3D-Touch
159
+    #define LCD_PINS_RS      28
160
+    #define LCD_PINS_ENABLE  29
161
+    #define LCD_PINS_D4      10
162
+    #define LCD_PINS_D5      11
163
+    #define LCD_PINS_D6      16
164
+    #define LCD_PINS_D7      17
165
+    #define BTN_EN1          -1
166
+    #define BTN_EN2          -1
167
+    #define BTN_ENC          -1
168
+    #define ADC_KEYPAD_PIN    1
169 169
     #define ENCODER_FEEDRATE_DEADZONE 2
170 170
   #elif ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) || ENABLED(ANET_FULL_GRAPHICS_LCD)
171 171
     // Pin definitions for the Anet A6 Full Graphics display and the RepRapDiscount Full Graphics
172 172
     // display using an adapter board  // https://go.aisler.net/benlye/anet-lcd-adapter/pcb
173 173
     // See below for alternative pin definitions for use with https://www.thingiverse.com/thing:2103748
174
-    #define SERVO0_PIN         29 // free for BLTouch/3D-Touch
175
-    #define BEEPER_PIN         17
176
-    #define LCD_PINS_RS        27
177
-    #define LCD_PINS_ENABLE    28
178
-    #define LCD_PINS_D4        30
179
-    #define BTN_EN1            11
180
-    #define BTN_EN2            10
181
-    #define BTN_ENC            16
174
+    #define SERVO0_PIN       29 // free for BLTouch/3D-Touch
175
+    #define BEEPER_PIN       17
176
+    #define LCD_PINS_RS      27
177
+    #define LCD_PINS_ENABLE  28
178
+    #define LCD_PINS_D4      30
179
+    #define BTN_EN1          11
180
+    #define BTN_EN2          10
181
+    #define BTN_ENC          16
182 182
     #define ST7920_DELAY_1 DELAY_0_NOP
183 183
     #define ST7920_DELAY_2 DELAY_1_NOP
184 184
     #define ST7920_DELAY_3 DELAY_2_NOP
185 185
     #define STD_ENCODER_PULSES_PER_STEP 4
186 186
     #define STD_ENCODER_STEPS_PER_MENU_ITEM 1
187 187
   #endif
188
+#else
189
+  #define SERVO0_PIN         27
188 190
 #endif  // ULTRA_LCD && NEWPANEL
189 191
 
190 192
 /**

+ 3
- 0
buildroot/share/git/mfpub Переглянути файл

@@ -45,6 +45,9 @@ git clean -d -f
45 45
 # Push 'master' to the fork and make a proper PR...
46 46
 if [[ $BRANCH == "master" ]]; then
47 47
 
48
+  # Don't lose upstream changes!
49
+  mfup
50
+
48 51
   # Allow working directly with the main fork
49 52
   echo
50 53
   echo -n "Pushing to origin/master... "

Завантаження…
Відмінити
Зберегти