From 135c4db5da256e58291419daa941264350dcd659 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Wed, 1 Aug 2018 15:43:13 +0200 Subject: [PATCH 1/3] gcode for filemant type initial version: just re-sending information to mmu --- .gitignore | 1 + Firmware/Marlin_main.cpp | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/.gitignore b/.gitignore index c2e7ec75..321c2431 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ Firmware/Doc /Firmware/Firmware.vcxproj.filters /Firmware/Firmware - Shortcut.lnk /Firmware/variants/1_75mm_MK3-MMU-EINSy10a-E3Dv6full.h.bak +/Firmware/Marlin_main.cpp~RF12cfae7.TMP diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index ac83b81a..c1ddd788 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -140,6 +140,11 @@ #define PRINTING_TYPE_SD 0 #define PRINTING_TYPE_USB 1 +//filament types +#define FILAMENT_DEFAULT 0 +#define FILAMENT_FLEX 1 +#define FILAMENT_PVA 2 + // look here for descriptions of G-codes: http://linuxcnc.org/handbook/gcode/g-code.html // http://objects.reprap.org/wiki/Mendel_User_Manual:_RepRapGCodes @@ -6289,6 +6294,27 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)) } break; + case 403: //M403 set filament type (material) for particular extruder and send this information to mmu + { + //currently three different materials are needed (default, flex and PVA) + //store this information for future use in different load/unload profiles etc. + uint8_t extruder; + uint8_t filament; + + if(code_seen('E')) extruder = code_value(); + if(code_seen('F')) filament = code_value(); + + printf_P(PSTR("Extruder: %d; "), extruder); + switch (filament) { + case FILAMENT_FLEX: printf_P(PSTR("Flex")); break; + case FILAMENT_PVA: printf_P(PSTR("PVA")); break; + default: printf_P(PSTR("Default")); break; + } + printf_P(PSTR("F%d%d\n"), extruder, filament); + fprintf_P(uart2io, PSTR("F%d%d\n"), extruder, filament); + } + break; + case 500: // M500 Store settings in EEPROM { Config_StoreSettings(EEPROM_OFFSET); From b35ef498f0d556b4eab69a6f84836e99ade24c4e Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Wed, 1 Aug 2018 16:46:46 +0200 Subject: [PATCH 2/3] comments updated --- Firmware/Marlin_main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index c1ddd788..6e24a5cf 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -6297,7 +6297,9 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)) case 403: //M403 set filament type (material) for particular extruder and send this information to mmu { //currently three different materials are needed (default, flex and PVA) - //store this information for future use in different load/unload profiles etc. + //add storing this information for different load/unload profiles etc. in the future + //firmware does not wait for "ok" from mmu + uint8_t extruder; uint8_t filament; From 54adb0beea6b1b9bd6145714c8de48c571a21f9d Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Wed, 1 Aug 2018 16:54:26 +0200 Subject: [PATCH 3/3] missing eol added --- Firmware/Marlin_main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 6e24a5cf..9d8c99a4 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -6308,9 +6308,9 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)) printf_P(PSTR("Extruder: %d; "), extruder); switch (filament) { - case FILAMENT_FLEX: printf_P(PSTR("Flex")); break; - case FILAMENT_PVA: printf_P(PSTR("PVA")); break; - default: printf_P(PSTR("Default")); break; + case FILAMENT_FLEX: printf_P(PSTR("Flex\n")); break; + case FILAMENT_PVA: printf_P(PSTR("PVA\n")); break; + default: printf_P(PSTR("Default\n")); break; } printf_P(PSTR("F%d%d\n"), extruder, filament); fprintf_P(uart2io, PSTR("F%d%d\n"), extruder, filament);