Merge pull request #995 from PavelSindler/filament_type

snmm v2: send filament type to mmu
This commit is contained in:
XPila 2018-08-01 19:33:44 +02:00 committed by GitHub
commit 618aea25d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 0 deletions

1
.gitignore vendored
View file

@ -11,3 +11,4 @@ Firmware/Doc
/Firmware/Firmware.vcxproj.filters /Firmware/Firmware.vcxproj.filters
/Firmware/Firmware - Shortcut.lnk /Firmware/Firmware - Shortcut.lnk
/Firmware/variants/1_75mm_MK3-MMU-EINSy10a-E3Dv6full.h.bak /Firmware/variants/1_75mm_MK3-MMU-EINSy10a-E3Dv6full.h.bak
/Firmware/Marlin_main.cpp~RF12cfae7.TMP

View file

@ -140,6 +140,11 @@
#define PRINTING_TYPE_SD 0 #define PRINTING_TYPE_SD 0
#define PRINTING_TYPE_USB 1 #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 // look here for descriptions of G-codes: http://linuxcnc.org/handbook/gcode/g-code.html
// http://objects.reprap.org/wiki/Mendel_User_Manual:_RepRapGCodes // http://objects.reprap.org/wiki/Mendel_User_Manual:_RepRapGCodes
@ -6289,6 +6294,29 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
} }
break; 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)
//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;
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\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);
}
break;
case 500: // M500 Store settings in EEPROM case 500: // M500 Store settings in EEPROM
{ {
Config_StoreSettings(EEPROM_OFFSET); Config_StoreSettings(EEPROM_OFFSET);