MMU communication fix
This commit is contained in:
parent
9fe27c108d
commit
315bfc43dd
2 changed files with 13 additions and 5 deletions
|
@ -7428,7 +7428,7 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
|
|||
handle_status_leds();
|
||||
#endif
|
||||
check_axes_activity();
|
||||
// mmu_loop();
|
||||
mmu_loop();
|
||||
}
|
||||
|
||||
void kill(const char *full_screen_message, unsigned char id)
|
||||
|
|
|
@ -177,6 +177,7 @@ void mmu_loop(void)
|
|||
fscanf_P(uart2io, PSTR("%hhu"), &mmu_finda); //scan finda from buffer
|
||||
printf_P(PSTR("MMU => '%dok'\n"), mmu_finda);
|
||||
mmu_state = 1;
|
||||
if (mmu_cmd == 0)
|
||||
mmu_ready = true;
|
||||
}
|
||||
else if ((mmu_last_request + 30000) < millis())
|
||||
|
@ -228,19 +229,26 @@ void mmu_command(uint8_t cmd)
|
|||
|
||||
bool mmu_get_response(void)
|
||||
{
|
||||
// printf_P(PSTR("mmu_get_response - begin\n"));
|
||||
KEEPALIVE_STATE(IN_PROCESS);
|
||||
while (mmu_cmd != 0)
|
||||
{
|
||||
// mmu_loop();
|
||||
delay_keep_alive(100);
|
||||
}
|
||||
while (!mmu_ready)
|
||||
{
|
||||
mmu_loop();
|
||||
// mmu_loop();
|
||||
if (mmu_state != 3)
|
||||
break;
|
||||
delay_keep_alive(100);
|
||||
}
|
||||
bool ret = mmu_ready;
|
||||
mmu_ready = false;
|
||||
// printf_P(PSTR("mmu_get_response - end %d\n"), ret?1:0);
|
||||
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
|
||||
//if timeout is set to true function return false if there is no "ok" received before timeout
|
||||
bool response = true;
|
||||
|
|
Loading…
Reference in a new issue