Fix "Check MMU. Fix the issue and then press button on MMU unit." shown instead of "Loading filament 1".

This commit is contained in:
Marek Bel 2018-08-24 03:49:51 +02:00
parent 142bf28dc2
commit 050a7c41d0
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);
mmu_printf_P(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);