Merge branch 'MK3' into MK3_dev

This commit is contained in:
Marek Bel 2018-08-23 23:28:20 +02:00
commit f1c51502fd
3 changed files with 19 additions and 6 deletions

View File

@ -7425,7 +7425,7 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
handle_status_leds(); handle_status_leds();
#endif #endif
check_axes_activity(); check_axes_activity();
// mmu_loop(); mmu_loop();
} }
void kill(const char *full_screen_message, unsigned char id) void kill(const char *full_screen_message, unsigned char id)

View File

@ -177,6 +177,7 @@ void mmu_loop(void)
fscanf_P(uart2io, PSTR("%hhu"), &mmu_finda); //scan finda from buffer fscanf_P(uart2io, PSTR("%hhu"), &mmu_finda); //scan finda from buffer
printf_P(PSTR("MMU => '%dok'\n"), mmu_finda); printf_P(PSTR("MMU => '%dok'\n"), mmu_finda);
mmu_state = 1; mmu_state = 1;
if (mmu_cmd == 0)
mmu_ready = true; mmu_ready = true;
} }
else if ((mmu_last_request + 30000) < millis()) else if ((mmu_last_request + 30000) < millis())
@ -228,19 +229,26 @@ void mmu_command(uint8_t cmd)
bool mmu_get_response(void) bool mmu_get_response(void)
{ {
// printf_P(PSTR("mmu_get_response - begin\n"));
KEEPALIVE_STATE(IN_PROCESS); KEEPALIVE_STATE(IN_PROCESS);
while (mmu_cmd != 0)
{
// mmu_loop();
delay_keep_alive(100);
}
while (!mmu_ready) while (!mmu_ready)
{ {
mmu_loop(); // mmu_loop();
if (mmu_state != 3) if (mmu_state != 3)
break; break;
delay_keep_alive(100);
} }
bool ret = mmu_ready; bool ret = mmu_ready;
mmu_ready = false; mmu_ready = false;
// printf_P(PSTR("mmu_get_response - end %d\n"), ret?1:0);
return ret; return ret;
/* printf_P(PSTR("mmu_get_response - begin\n")); /* //waits for "ok" from mmu
//waits for "ok" from mmu
//function returns true if "ok" was received //function returns true if "ok" was received
//if timeout is set to true function return false if there is no "ok" received before timeout //if timeout is set to true function return false if there is no "ok" received before timeout
bool response = true; bool response = true;
@ -313,6 +321,7 @@ void manage_response(bool move_axes, bool turn_off_nozzle)
} }
} }
lcd_display_message_fullscreen_P(_i("Check MMU. Fix the issue and then press button on MMU unit.")); lcd_display_message_fullscreen_P(_i("Check MMU. Fix the issue and then press button on MMU unit."));
delay_keep_alive(1000);
} }
else if (mmu_print_saved) { else if (mmu_print_saved) {
printf_P(PSTR("MMU start responding\n")); printf_P(PSTR("MMU start responding\n"));

View File

@ -532,7 +532,11 @@ void lcdui_print_percent_done(void)
// Print extruder status (5 chars total) // Print extruder status (5 chars total)
void lcdui_print_extruder(void) void lcdui_print_extruder(void)
{ {
int chars = lcd_printf_P(_N(" T%u"), mmu_extruder); int chars = 0;
if (mmu_extruder == tmp_extruder)
chars = lcd_printf_P(_N(" T%u"), mmu_extruder);
else
chars = lcd_printf_P(_N(" %u>%u"), mmu_extruder, tmp_extruder);
lcd_space(5 - chars); lcd_space(5 - chars);
} }