Updated mmu_loop() Case 3:

This commit is contained in:
TheZeroBeast 2018-10-29 12:30:50 +10:00 committed by GitHub
parent 8fd41841c8
commit c5236c84df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 5 deletions

View File

@ -304,11 +304,23 @@ void mmu_loop(void)
case 3: //response to mmu commands
if (mmu_rx_ok() > 0)
{
#ifdef MMU_DEBUG
printf_P(PSTR("MMU => 'ok'\n"));
#endif //MMU_DEBUG
mmu_ready = true;
mmu_state = 1;
/**
* Started implementing FS0 & FS1 comms to MMU for FS0 to
* only have MMU return 'ok\n', FS1 to have MMU stop load as MK3-Sensor has been reached.
*/
if (!mmuFilamentLoading) {
#ifdef MMU_DEBUG
printf_P(PSTR("MMU => 'ok'\n"));
#endif //MMU_DEBUG
mmu_ready = true;
mmu_state = 1;
} else {
if (mmuFilamentLoadSeen) {
mmuFilamentLoading = false;
mmuFilamentSeen = false;
mmu_printf_P(PSTR("FS%d\n"), 1);
} else mmu_printf_P(PSTR("FS%d\n"), 0);
}
}
else if ((mmu_last_request + MMU_CMD_TIMEOUT) < millis())
{ //resend request after timeout (5 min)