MMU_DEBUG
This commit is contained in:
parent
6fa798aa83
commit
1bb9e9ed92
|
|
@ -173,39 +173,51 @@ void mmu_loop(void)
|
||||||
if ((mmu_cmd >= MMU_CMD_T0) && (mmu_cmd <= MMU_CMD_T4))
|
if ((mmu_cmd >= MMU_CMD_T0) && (mmu_cmd <= MMU_CMD_T4))
|
||||||
{
|
{
|
||||||
filament = mmu_cmd - MMU_CMD_T0;
|
filament = mmu_cmd - MMU_CMD_T0;
|
||||||
|
#ifdef MMU_DEBUG
|
||||||
printf_P(PSTR("MMU <= 'T%d'\n"), filament);
|
printf_P(PSTR("MMU <= 'T%d'\n"), filament);
|
||||||
|
#endif //MMU_DEBUG
|
||||||
mmu_printf_P(PSTR("T%d\n"), filament);
|
mmu_printf_P(PSTR("T%d\n"), filament);
|
||||||
mmu_state = 3; // wait for response
|
mmu_state = 3; // wait for response
|
||||||
}
|
}
|
||||||
else if ((mmu_cmd >= MMU_CMD_L0) && (mmu_cmd <= MMU_CMD_L4))
|
else if ((mmu_cmd >= MMU_CMD_L0) && (mmu_cmd <= MMU_CMD_L4))
|
||||||
{
|
{
|
||||||
filament = mmu_cmd - MMU_CMD_L0;
|
filament = mmu_cmd - MMU_CMD_L0;
|
||||||
|
#ifdef MMU_DEBUG
|
||||||
printf_P(PSTR("MMU <= 'L%d'\n"), filament);
|
printf_P(PSTR("MMU <= 'L%d'\n"), filament);
|
||||||
|
#endif //MMU_DEBUG
|
||||||
mmu_printf_P(PSTR("L%d\n"), filament);
|
mmu_printf_P(PSTR("L%d\n"), filament);
|
||||||
mmu_state = 3; // wait for response
|
mmu_state = 3; // wait for response
|
||||||
}
|
}
|
||||||
else if (mmu_cmd == MMU_CMD_C0)
|
else if (mmu_cmd == MMU_CMD_C0)
|
||||||
{
|
{
|
||||||
|
#ifdef MMU_DEBUG
|
||||||
printf_P(PSTR("MMU <= 'C0'\n"));
|
printf_P(PSTR("MMU <= 'C0'\n"));
|
||||||
|
#endif //MMU_DEBUG
|
||||||
mmu_puts_P(PSTR("C0\n")); //send 'continue loading'
|
mmu_puts_P(PSTR("C0\n")); //send 'continue loading'
|
||||||
mmu_state = 3;
|
mmu_state = 3;
|
||||||
}
|
}
|
||||||
else if (mmu_cmd == MMU_CMD_U0)
|
else if (mmu_cmd == MMU_CMD_U0)
|
||||||
{
|
{
|
||||||
|
#ifdef MMU_DEBUG
|
||||||
printf_P(PSTR("MMU <= 'U0'\n"));
|
printf_P(PSTR("MMU <= 'U0'\n"));
|
||||||
|
#endif //MMU_DEBUG
|
||||||
mmu_puts_P(PSTR("U0\n")); //send 'unload current filament'
|
mmu_puts_P(PSTR("U0\n")); //send 'unload current filament'
|
||||||
mmu_state = 3;
|
mmu_state = 3;
|
||||||
}
|
}
|
||||||
else if ((mmu_cmd >= MMU_CMD_E0) && (mmu_cmd <= MMU_CMD_E4))
|
else if ((mmu_cmd >= MMU_CMD_E0) && (mmu_cmd <= MMU_CMD_E4))
|
||||||
{
|
{
|
||||||
int filament = mmu_cmd - MMU_CMD_E0;
|
int filament = mmu_cmd - MMU_CMD_E0;
|
||||||
|
#ifdef MMU_DEBUG
|
||||||
printf_P(PSTR("MMU <= 'E%d'\n"), filament);
|
printf_P(PSTR("MMU <= 'E%d'\n"), filament);
|
||||||
|
#endif //MMU_DEBUG
|
||||||
mmu_printf_P(PSTR("E%d\n"), filament); //send eject filament
|
mmu_printf_P(PSTR("E%d\n"), filament); //send eject filament
|
||||||
mmu_state = 3; // wait for response
|
mmu_state = 3; // wait for response
|
||||||
}
|
}
|
||||||
else if (mmu_cmd == MMU_CMD_R0)
|
else if (mmu_cmd == MMU_CMD_R0)
|
||||||
{
|
{
|
||||||
|
#ifdef MMU_DEBUG
|
||||||
printf_P(PSTR("MMU <= 'R0'\n"));
|
printf_P(PSTR("MMU <= 'R0'\n"));
|
||||||
|
#endif //MMU_DEBUG
|
||||||
mmu_puts_P(PSTR("R0\n")); //send recover after eject
|
mmu_puts_P(PSTR("R0\n")); //send recover after eject
|
||||||
mmu_state = 3; // wait for response
|
mmu_state = 3; // wait for response
|
||||||
}
|
}
|
||||||
|
|
@ -224,7 +236,9 @@ void mmu_loop(void)
|
||||||
if (mmu_rx_ok() > 0)
|
if (mmu_rx_ok() > 0)
|
||||||
{
|
{
|
||||||
fscanf_P(uart2io, PSTR("%hhu"), &mmu_finda); //scan finda from buffer
|
fscanf_P(uart2io, PSTR("%hhu"), &mmu_finda); //scan finda from buffer
|
||||||
|
#ifdef MMU_DEBUG
|
||||||
printf_P(PSTR("MMU => '%dok'\n"), mmu_finda);
|
printf_P(PSTR("MMU => '%dok'\n"), mmu_finda);
|
||||||
|
#endif //MMU_DEBUG
|
||||||
//printf_P(PSTR("Eact: %d\n"), int(e_active()));
|
//printf_P(PSTR("Eact: %d\n"), int(e_active()));
|
||||||
if (!mmu_finda && CHECK_FINDA && fsensor_enabled) {
|
if (!mmu_finda && CHECK_FINDA && fsensor_enabled) {
|
||||||
fsensor_stop_and_save_print();
|
fsensor_stop_and_save_print();
|
||||||
|
|
@ -244,7 +258,9 @@ void mmu_loop(void)
|
||||||
case 3: //response to mmu commands
|
case 3: //response to mmu commands
|
||||||
if (mmu_rx_ok() > 0)
|
if (mmu_rx_ok() > 0)
|
||||||
{
|
{
|
||||||
|
#ifdef MMU_DEBUG
|
||||||
printf_P(PSTR("MMU => 'ok'\n"));
|
printf_P(PSTR("MMU => 'ok'\n"));
|
||||||
|
#endif //MMU_DEBUG
|
||||||
mmu_ready = true;
|
mmu_ready = true;
|
||||||
mmu_state = 1;
|
mmu_state = 1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -481,4 +481,6 @@
|
||||||
|
|
||||||
//#define SUPPORT_VERBOSITY
|
//#define SUPPORT_VERBOSITY
|
||||||
|
|
||||||
|
//#define MMU_DEBUG //print communication between MMU2 and printer on serial
|
||||||
|
|
||||||
#endif //__CONFIGURATION_PRUSA_H
|
#endif //__CONFIGURATION_PRUSA_H
|
||||||
|
|
|
||||||
|
|
@ -482,4 +482,6 @@
|
||||||
|
|
||||||
//#define SUPPORT_VERBOSITY
|
//#define SUPPORT_VERBOSITY
|
||||||
|
|
||||||
|
//#define MMU_DEBUG //print communication between MMU2 and printer on serial
|
||||||
|
|
||||||
#endif //__CONFIGURATION_PRUSA_H
|
#endif //__CONFIGURATION_PRUSA_H
|
||||||
|
|
|
||||||
|
|
@ -613,4 +613,6 @@
|
||||||
|
|
||||||
//#define SUPPORT_VERBOSITY
|
//#define SUPPORT_VERBOSITY
|
||||||
|
|
||||||
|
//#define MMU_DEBUG //print communication between MMU2 and printer on serial
|
||||||
|
|
||||||
#endif //__CONFIGURATION_PRUSA_H
|
#endif //__CONFIGURATION_PRUSA_H
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue