Explorar el Código

Malyan M200 V2 (#17840)

Scott Lahteine hace 4 años
padre
commit
38d1587091
No account linked to committer's email address

+ 26
- 25
Marlin/src/core/boards.h Ver fichero

@@ -277,31 +277,32 @@
277 277
 
278 278
 #define BOARD_STM32F103RE             4000  // STM32F103RE Libmaple-based STM32F1 controller
279 279
 #define BOARD_MALYAN_M200             4001  // STM32C8T6  Libmaple-based STM32F1 controller
280
-#define BOARD_STM3R_MINI              4002  // STM32F103RE Libmaple-based STM32F1 controller
281
-#define BOARD_GTM32_PRO_VB            4003  // STM32F103VET6 controller
282
-#define BOARD_MORPHEUS                4004  // STM32F103C8 / STM32F103CB  Libmaple-based STM32F1 controller
283
-#define BOARD_CHITU3D                 4005  // Chitu3D (STM32F103RET6)
284
-#define BOARD_MKS_ROBIN               4006  // MKS Robin (STM32F103ZET6)
285
-#define BOARD_MKS_ROBIN_MINI          4007  // MKS Robin Mini (STM32F103VET6)
286
-#define BOARD_MKS_ROBIN_NANO          4008  // MKS Robin Nano (STM32F103VET6)
287
-#define BOARD_MKS_ROBIN_LITE          4009  // MKS Robin Lite/Lite2 (STM32F103RCT6)
288
-#define BOARD_MKS_ROBIN_LITE3         4010  // MKS Robin Lite3 (STM32F103RCT6)
289
-#define BOARD_MKS_ROBIN_PRO           4011  // MKS Robin Pro (STM32F103ZET6)
290
-#define BOARD_BTT_SKR_MINI_V1_1       4012  // BigTreeTech SKR Mini v1.1 (STM32F103RC)
291
-#define BOARD_BTT_SKR_MINI_E3_V1_0    4013  // BigTreeTech SKR Mini E3 (STM32F103RC)
292
-#define BOARD_BTT_SKR_MINI_E3_V1_2    4014  // BigTreeTech SKR Mini E3 V1.2 (STM32F103RC)
293
-#define BOARD_BTT_SKR_E3_DIP          4015  // BigTreeTech SKR E3 DIP V1.0 (STM32F103RC / STM32F103RE)
294
-#define BOARD_JGAURORA_A5S_A1         4016  // JGAurora A5S A1 (STM32F103ZET6)
295
-#define BOARD_FYSETC_AIO_II           4017  // FYSETC AIO_II
296
-#define BOARD_FYSETC_CHEETAH          4018  // FYSETC Cheetah
297
-#define BOARD_FYSETC_CHEETAH_V12      4019  // FYSETC Cheetah V1.2
298
-#define BOARD_LONGER3D_LK             4020  // Alfawise U20/U20+/U30 (Longer3D LK1/2) / STM32F103VET6
299
-#define BOARD_GTM32_MINI              4021  // STM32F103VET6 controller
300
-#define BOARD_GTM32_MINI_A30          4022  // STM32F103VET6 controller
301
-#define BOARD_GTM32_REV_B             4023  // STM32F103VET6 controller
302
-#define BOARD_MKS_ROBIN_E3D           4024  // MKS Robin E3D(STM32F103RCT6)
303
-#define BOARD_MKS_ROBIN_E3            4025  // MKS Robin E3(STM32F103RCT6)
304
-#define BOARD_MALYAN_M300             4026  // STM32F070-based delta
280
+#define BOARD_MALYAN_M200_V2          4002  // STM32F070RB  Libmaple-based STM32F0 controller
281
+#define BOARD_STM3R_MINI              4003  // STM32F103RE  Libmaple-based STM32F1 controller
282
+#define BOARD_GTM32_PRO_VB            4004  // STM32F103VET6 controller
283
+#define BOARD_MORPHEUS                4005  // STM32F103C8 / STM32F103CB  Libmaple-based STM32F1 controller
284
+#define BOARD_CHITU3D                 4006  // Chitu3D (STM32F103RET6)
285
+#define BOARD_MKS_ROBIN               4007  // MKS Robin (STM32F103ZET6)
286
+#define BOARD_MKS_ROBIN_MINI          4008  // MKS Robin Mini (STM32F103VET6)
287
+#define BOARD_MKS_ROBIN_NANO          4009  // MKS Robin Nano (STM32F103VET6)
288
+#define BOARD_MKS_ROBIN_LITE          4010  // MKS Robin Lite/Lite2 (STM32F103RCT6)
289
+#define BOARD_MKS_ROBIN_LITE3         4011  // MKS Robin Lite3 (STM32F103RCT6)
290
+#define BOARD_MKS_ROBIN_PRO           4012  // MKS Robin Pro (STM32F103ZET6)
291
+#define BOARD_BTT_SKR_MINI_V1_1       4013  // BigTreeTech SKR Mini v1.1 (STM32F103RC)
292
+#define BOARD_BTT_SKR_MINI_E3_V1_0    4014  // BigTreeTech SKR Mini E3 (STM32F103RC)
293
+#define BOARD_BTT_SKR_MINI_E3_V1_2    4015  // BigTreeTech SKR Mini E3 V1.2 (STM32F103RC)
294
+#define BOARD_BTT_SKR_E3_DIP          4016  // BigTreeTech SKR E3 DIP V1.0 (STM32F103RC / STM32F103RE)
295
+#define BOARD_JGAURORA_A5S_A1         4017  // JGAurora A5S A1 (STM32F103ZET6)
296
+#define BOARD_FYSETC_AIO_II           4018  // FYSETC AIO_II
297
+#define BOARD_FYSETC_CHEETAH          4019  // FYSETC Cheetah
298
+#define BOARD_FYSETC_CHEETAH_V12      4020  // FYSETC Cheetah V1.2
299
+#define BOARD_LONGER3D_LK             4021  // Alfawise U20/U20+/U30 (Longer3D LK1/2) / STM32F103VET6
300
+#define BOARD_GTM32_MINI              4022  // STM32F103VET6 controller
301
+#define BOARD_GTM32_MINI_A30          4023  // STM32F103VET6 controller
302
+#define BOARD_GTM32_REV_B             4024  // STM32F103VET6 controller
303
+#define BOARD_MKS_ROBIN_E3D           4025  // MKS Robin E3D(STM32F103RCT6)
304
+#define BOARD_MKS_ROBIN_E3            4026  // MKS Robin E3(STM32F103RCT6)
305
+#define BOARD_MALYAN_M300             4027  // STM32F070-based delta
305 306
 
306 307
 //
307 308
 // ARM Cortex-M4F

+ 5
- 5
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/marlin_events.cpp Ver fichero

@@ -150,19 +150,19 @@ namespace ExtUI {
150 150
   #if HAS_PID_HEATING
151 151
     void onPidTuning(const result_t rst) {
152 152
       // Called for temperature PID tuning result
153
-      SERIAL_ECHOLNPAIR("OnPidTuning:", rst);
153
+      //SERIAL_ECHOLNPAIR("OnPidTuning:", rst);
154 154
       switch (rst) {
155 155
         case PID_BAD_EXTRUDER_NUM:
156
-          StatusScreen::setStatusMessage(STR_PID_BAD_EXTRUDER_NUM);
156
+          StatusScreen::setstatusmessagePGM(GET_TEXT(MSG_PID_BAD_EXTRUDER_NUM));
157 157
           break;
158 158
         case PID_TEMP_TOO_HIGH:
159
-          StatusScreen::setStatusMessage(STR_PID_TEMP_TOO_HIGH);
159
+          StatusScreen::setstatusmessagePGM(GET_TEXT(MSG_PID_TEMP_TOO_HIGH));
160 160
           break;
161 161
         case PID_TUNING_TIMEOUT:
162
-          StatusScreen::setStatusMessage(STR_PID_TIMEOUT);
162
+          StatusScreen::setstatusmessagePGM(GET_TEXT(MSG_PID_TIMEOUT));
163 163
           break;
164 164
         case PID_DONE:
165
-          StatusScreen::setStatusMessage(STR_PID_AUTOTUNE_FINISHED);
165
+          StatusScreen::setstatusmessagePGM(GET_TEXT(MSG_PID_AUTOTUNE_DONE));
166 166
           break;
167 167
       }
168 168
       GOTO_SCREEN(StatusScreen);

+ 2
- 2
Marlin/src/lcd/extui/ui_api.cpp Ver fichero

@@ -330,8 +330,8 @@ namespace ExtUI {
330 330
     // Delta limits XY based on the current offset from center
331 331
     // This assumes the center is 0,0
332 332
     #if ENABLED(DELTA)
333
-      if (axis != Z_AXIS) {
334
-        max = SQRT(sq((float)(DELTA_PRINTABLE_RADIUS)) - sq(current_position[Y_AXIS - axis])); // (Y_AXIS - axis) == the other axis
333
+      if (axis != Z) {
334
+        max = SQRT(sq(float(DELTA_PRINTABLE_RADIUS)) - sq(current_position[Y - axis])); // (Y - axis) == the other axis
335 335
         min = -max;
336 336
       }
337 337
     #endif

+ 6
- 7
Marlin/src/lcd/extui_dgus_lcd.cpp Ver fichero

@@ -45,7 +45,7 @@ namespace ExtUI {
45 45
 
46 46
   void onIdle() { ScreenHandler.loop(); }
47 47
 
48
-  void onPrinterKilled(PGM_P error, PGM_P component) {
48
+  void onPrinterKilled(PGM_P const error, PGM_P const component) {
49 49
     ScreenHandler.sendinfoscreen(GET_TEXT(MSG_HALTED), error, NUL_STR, GET_TEXT(MSG_PLEASE_RESET), true, true, true, true);
50 50
     ScreenHandler.GotoScreen(DGUSLCD_SCREEN_KILL);
51 51
     while (!ScreenHandler.loop());  // Wait while anything is left to be sent
@@ -127,19 +127,18 @@ namespace ExtUI {
127 127
   #if HAS_PID_HEATING
128 128
     void onPidTuning(const result_t rst) {
129 129
       // Called for temperature PID tuning result
130
-      SERIAL_ECHOLNPAIR("onPidTuning:",rst);
131
-      switch(rst) {
130
+      switch (rst) {
132 131
         case PID_BAD_EXTRUDER_NUM:
133
-          ScreenHandler.setstatusmessagePGM(PSTR(STR_PID_BAD_EXTRUDER_NUM));
132
+          ScreenHandler.setstatusmessagePGM(GET_TEXT(MSG_PID_BAD_EXTRUDER_NUM));
134 133
           break;
135 134
         case PID_TEMP_TOO_HIGH:
136
-          ScreenHandler.setstatusmessagePGM(PSTR(STR_PID_TEMP_TOO_HIGH));
135
+          ScreenHandler.setstatusmessagePGM(GET_TEXT(MSG_PID_TEMP_TOO_HIGH));
137 136
           break;
138 137
         case PID_TUNING_TIMEOUT:
139
-          ScreenHandler.setstatusmessagePGM(PSTR(STR_PID_TIMEOUT));
138
+          ScreenHandler.setstatusmessagePGM(GET_TEXT(MSG_PID_TIMEOUT));
140 139
           break;
141 140
         case PID_DONE:
142
-          ScreenHandler.setstatusmessagePGM(PSTR(STR_PID_AUTOTUNE_FINISHED));
141
+          ScreenHandler.setstatusmessagePGM(GET_TEXT(MSG_PID_AUTOTUNE_DONE));
143 142
           break;
144 143
       }
145 144
       ScreenHandler.GotoScreen(DGUSLCD_SCREEN_MAIN);

+ 37
- 11
Marlin/src/lcd/extui_malyan_lcd.cpp Ver fichero

@@ -97,6 +97,18 @@ void write_to_lcd(const char * const message) {
97 97
   LCD_SERIAL.Print::write(encoded_message, message_length);
98 98
 }
99 99
 
100
+// {E:<msg>} is for error states.
101
+void set_lcd_error_P(PGM_P const error, PGM_P const component=nullptr) {
102
+  write_to_lcd_P(PSTR("{E:"));
103
+  write_to_lcd_P(error);
104
+  if (component) {
105
+    write_to_lcd_P(PSTR(" "));
106
+    write_to_lcd_P(component);
107
+  }
108
+  write_to_lcd_P(PSTR("}"));
109
+}
110
+
111
+
100 112
 /**
101 113
  * Process an LCD 'C' command.
102 114
  * These are currently all temperature commands
@@ -465,15 +477,33 @@ namespace ExtUI {
465 477
     #endif
466 478
   }
467 479
 
468
-  // {E:<msg>} is for error states.
469
-  void onPrinterKilled(PGM_P error, PGM_P component) {
470
-    write_to_lcd_P(PSTR("{E:"));
471
-    write_to_lcd_P(error);
472
-    write_to_lcd_P(PSTR(" "));
473
-    write_to_lcd_P(component);
474
-    write_to_lcd_P("}");
480
+  void onPrinterKilled(PGM_P const error, PGM_P const component) {
481
+    set_lcd_error_P(error, component);
475 482
   }
476 483
 
484
+  #if HAS_PID_HEATING
485
+
486
+    void onPidTuning(const result_t rst) {
487
+      // Called for temperature PID tuning result
488
+      //SERIAL_ECHOLNPAIR("OnPidTuning:", rst);
489
+      switch (rst) {
490
+        case PID_BAD_EXTRUDER_NUM:
491
+          set_lcd_error_P(GET_TEXT(MSG_PID_BAD_EXTRUDER_NUM));
492
+          break;
493
+        case PID_TEMP_TOO_HIGH:
494
+          set_lcd_error_P(GET_TEXT(MSG_PID_TEMP_TOO_HIGH));
495
+          break;
496
+        case PID_TUNING_TIMEOUT:
497
+          set_lcd_error_P(GET_TEXT(MSG_PID_TIMEOUT));
498
+          break;
499
+        case PID_DONE:
500
+          set_lcd_error_P(GET_TEXT(MSG_PID_AUTOTUNE_DONE));
501
+          break;
502
+      }
503
+    }
504
+
505
+  #endif
506
+
477 507
   void onPrintTimerStarted() { write_to_lcd_P(PSTR("{SYS:BUILD}")); }
478 508
   void onPrintTimerPaused() {}
479 509
   void onPrintTimerStopped() { write_to_lcd_P(PSTR("{TQ:100}")); }
@@ -500,10 +530,6 @@ namespace ExtUI {
500 530
   #if ENABLED(POWER_LOSS_RECOVERY)
501 531
     void onPowerLossResume() {}
502 532
   #endif
503
-
504
-  #if HAS_PID_HEATING
505
-    void onPidTuning(const result_t rst) {}
506
-  #endif
507 533
 }
508 534
 
509 535
 #endif // MALYAN_LCD

+ 4
- 0
Marlin/src/lcd/language/language_en.h Ver fichero

@@ -266,6 +266,10 @@ namespace Language_en {
266 266
   PROGMEM Language_Str MSG_LCD_OFF                         = _UxGT("Off");
267 267
   PROGMEM Language_Str MSG_PID_AUTOTUNE                    = _UxGT("PID Autotune");
268 268
   PROGMEM Language_Str MSG_PID_AUTOTUNE_E                  = _UxGT("PID Autotune *");
269
+  PROGMEM Language_Str MSG_PID_AUTOTUNE_DONE               = _UxGT("PID tuning done");
270
+  PROGMEM Language_Str MSG_PID_BAD_EXTRUDER_NUM            = _UxGT("Autotune failed. Bad extruder.");
271
+  PROGMEM Language_Str MSG_PID_TEMP_TOO_HIGH               = _UxGT("Autotune failed. Temperature too high.");
272
+  PROGMEM Language_Str MSG_PID_TIMEOUT                     = _UxGT("Autotune failed! Timeout.");
269 273
   PROGMEM Language_Str MSG_PID_P                           = _UxGT("PID-P");
270 274
   PROGMEM Language_Str MSG_PID_P_E                         = _UxGT("PID-P *");
271 275
   PROGMEM Language_Str MSG_PID_I                           = _UxGT("PID-I");

+ 2
- 0
Marlin/src/pins/pins.h Ver fichero

@@ -469,6 +469,8 @@
469 469
 //
470 470
 // STM32 ARM Cortex-M0
471 471
 //
472
+#elif MB(MALYAN_M200_V2)
473
+  #include "stm32f0/pins_MALYAN_M200_V2.h"      // STM32F0                                env:STM32F070RB_malyan
472 474
 #elif MB(MALYAN_M300)
473 475
   #include "stm32f0/pins_MALYAN_M300.h"         // STM32F070                              env:malyan_M300
474 476
 

+ 31
- 0
Marlin/src/pins/stm32f0/pins_MALYAN_M200_V2.h Ver fichero

@@ -0,0 +1,31 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+#pragma once
24
+
25
+#ifndef STM32F0xx
26
+  #error "Oops! Select an STM32F0 board in your IDE."
27
+#endif
28
+
29
+#define BOARD_INFO_NAME "Malyan M200 V2"
30
+
31
+#include "../stm32f1/pins_MALYAN_M200.h"

+ 3
- 1
Marlin/src/pins/stm32f1/pins_MALYAN_M200.h Ver fichero

@@ -29,7 +29,9 @@
29 29
   #error "Oops! Select an STM32 board in your IDE."
30 30
 #endif
31 31
 
32
-#define BOARD_INFO_NAME "Malyan M200"
32
+#ifndef BOARD_INFO_NAME
33
+  #define BOARD_INFO_NAME "Malyan M200"
34
+#endif
33 35
 
34 36
 // Assume Flash EEPROM
35 37
 #if NO_EEPROM_SELECTED

+ 0
- 1
buildroot/share/PlatformIO/boards/malyanM200.json Ver fichero

@@ -11,7 +11,6 @@
11 11
     "ldscript": "jtagOffset.ld",
12 12
     "mcu": "stm32f103cb",
13 13
     "variant": "malyanM200",
14
-    "genericvariant" : "MALYAN_M200_V1",
15 14
     "vec_tab_addr": "0x8002000"
16 15
   },
17 16
   "debug": {

+ 1
- 1
buildroot/share/PlatformIO/boards/malyanM200v2.json Ver fichero

@@ -4,7 +4,7 @@
4 4
     "extra_flags": "-DSTM32F070xB",
5 5
     "f_cpu": "48000000L",
6 6
     "mcu": "stm32f070rbt6",
7
-    "genericvariant" : "MALYAN_M200_V2",
7
+    "variant": "MALYANM200_F070CB",
8 8
     "vec_tab_addr": "0x8002000"
9 9
   },
10 10
   "debug": {

+ 15
- 3
platformio.ini Ver fichero

@@ -605,10 +605,22 @@ lib_ignore    = Adafruit NeoPixel, SPI
605 605
 [env:STM32F103CB_malyan]
606 606
 platform    = ststm32
607 607
 board       = malyanM200
608
-build_flags = !python Marlin/src/HAL/STM32F1/build_flags.py -DMCU_STM32F103CB -D __STM32F1__=1 -std=c++1y -D MOTHERBOARD="BOARD_MALYAN_M200" -DSERIAL_USB -ffunction-sections -fdata-sections -Wl,--gc-sections
608
+build_flags = !python Marlin/src/HAL/STM32F1/build_flags.py -DMCU_STM32F103CB -D __STM32F1__=1 -std=c++1y -DSERIAL_USB -ffunction-sections -fdata-sections -Wl,--gc-sections
609 609
   -DDEBUG_LEVEL=0 -D__MARLIN_FIRMWARE__
610 610
 src_filter  = ${common.default_src_filter} +<src/HAL/STM32F1>
611
-lib_ignore  = Adafruit NeoPixel, LiquidCrystal, LiquidTWI2, TMCStepper, U8glib-HAL, SPI
611
+lib_ignore  = LiquidCrystal, LiquidTWI2, Adafruit NeoPixel, TMCStepper, U8glib-HAL, SPI
612
+
613
+#
614
+# Malyan M200 v2 (STM32F070RB)
615
+#
616
+[env:STM32F070RB_malyan]
617
+platform    = ststm32
618
+board       = malyanM200v2
619
+build_flags = -DSTM32F0xx -DUSBCON -DUSBD_VID=0x0483 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="ARMED_V1"' -DUSBD_USE_CDC -DHAL_PCD_MODULE_ENABLED
620
+  -O2 -ffreestanding -fsigned-char -fno-move-loop-invariants -fno-strict-aliasing -std=gnu11 -std=gnu++11
621
+  -IMarlin/src/HAL/STM32
622
+src_filter  = ${common.default_src_filter} +<src/HAL/STM32>
623
+lib_ignore  = LiquidCrystal, LiquidTWI2, Adafruit NeoPixel, TMCStepper, U8glib-HAL
612 624
 
613 625
 #
614 626
 # Malyan M300 (STM32F070CB)
@@ -620,7 +632,7 @@ build_flags = ${common.build_flags}
620 632
     -DUSBCON -DUSBD_VID=0x0483 "-DUSB_MANUFACTURER=\"Unknown\"" "-DUSB_PRODUCT=\"MALYAN_M300\""
621 633
     -DHAL_PCD_MODULE_ENABLED -DUSBD_USE_CDC -DDISABLE_GENERIC_SERIALUSB -DHAL_UART_MODULE_ENABLED
622 634
 src_filter  = ${common.default_src_filter} +<src/HAL/STM32>
623
-lib_ignore  = U8glib, LiquidCrystal_I2C, LiquidCrystal, NewliquidCrystal, LiquidTWI2, Adafruit NeoPixel, TMCStepper, Servo(STM32F1), TMC26XStepper, U8glib-HAL
635
+lib_ignore  = LiquidCrystal, LiquidTWI2, Adafruit NeoPixel, TMCStepper, U8glib-HAL
624 636
 
625 637
 #
626 638
 # Chitu boards like Tronxy X5s (STM32F103ZET6)

Loading…
Cancelar
Guardar