Merge pull request #1063 from mkbel/fix_load_all_2

Fix load all 2
This commit is contained in:
PavelSindler 2018-08-24 16:24:47 +02:00 committed by GitHub
commit 1774378f7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 3 deletions

View file

@ -162,6 +162,13 @@ void mmu_loop(void)
mmu_printf_P(PSTR("T%d\n"), extruder);
mmu_state = 3; // wait for response
}
else if ((mmu_cmd >= MMU_CMD_L0) && (mmu_cmd <= MMU_CMD_L4))
{
int filament = mmu_cmd - MMU_CMD_L0;
printf_P(PSTR("MMU <= 'L%d'\n"), filament);
mmu_printf_P(PSTR("L%d\n"), filament);
mmu_state = 3; // wait for response
}
mmu_cmd = 0;
}
else if ((mmu_last_response + 1000) < millis()) //request every 1s
@ -479,8 +486,13 @@ void display_loading()
void extr_adj(int extruder) //loading filament for SNMM
{
#ifndef SNMM
printf_P(PSTR("L%d \n"),extruder);
fprintf_P(uart2io, PSTR("L%d\n"), extruder);
uint8_t cmd = MMU_CMD_L0 + extruder;
if (cmd > MMU_CMD_L4)
{
printf_P(PSTR("Filament out of range %d \n"),extruder);
return;
}
mmu_command(cmd);
//show which filament is currently loaded
@ -490,7 +502,7 @@ void extr_adj(int extruder) //loading filament for SNMM
//if(strlen(_T(MSG_LOADING_FILAMENT))>18) lcd.setCursor(0, 1);
//else lcd.print(" ");
lcd_print(" ");
lcd_print(mmu_extruder + 1);
lcd_print(extruder + 1);
// get response
manage_response(false, false);

View file

@ -23,6 +23,11 @@ extern int16_t mmu_buildnr;
#define MMU_CMD_T2 0x12
#define MMU_CMD_T3 0x13
#define MMU_CMD_T4 0x14
#define MMU_CMD_L0 0x20
#define MMU_CMD_L1 0x21
#define MMU_CMD_L2 0x22
#define MMU_CMD_L3 0x23
#define MMU_CMD_L4 0x24
extern int mmu_puts_P(const char* str);