Merge pull request #8989 from tcm0116/2.0.x_ubl

[2.0.x] Fix UBL compilation warnings
This commit is contained in:
Scott Lahteine
2018-01-02 21:38:45 -06:00
committed by GitHub
6 changed files with 59 additions and 17 deletions

View File

@ -147,9 +147,27 @@ static bool drain_injected_commands_P() {
*/
void enqueue_and_echo_commands_P(const char * const pgcode) {
injected_commands_P = pgcode;
drain_injected_commands_P(); // first command executed asap (when possible)
(void)drain_injected_commands_P(); // first command executed asap (when possible)
}
#if HAS_QUEUE_NOW
/**
* Enqueue and return only when commands are actually enqueued
*/
void enqueue_and_echo_command_now(const char* cmd, bool say_ok/*=false*/) {
while (!enqueue_and_echo_command(cmd, say_ok)) idle();
}
#if HAS_LCD_QUEUE_NOW
/**
* Enqueue from program memory and return only when commands are actually enqueued
*/
void enqueue_and_echo_commands_P_now(const char * const pgcode) {
enqueue_and_echo_commands_P(pgcode);
while (drain_injected_commands_P()) idle();
}
#endif
#endif
/**
* Send an "ok" message to the host, indicating
* that a command was successfully processed.

View File

@ -90,6 +90,22 @@ void enqueue_and_echo_commands_P(const char * const pgcode);
*/
bool enqueue_and_echo_command(const char* cmd, bool say_ok=false);
#define HAS_LCD_QUEUE_NOW (ENABLED(ULTIPANEL) && (ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(PID_AUTOTUNE_MENU) || ENABLED(ADVANCED_PAUSE_FEATURE)))
#define HAS_QUEUE_NOW (ENABLED(SDSUPPORT) || HAS_LCD_QUEUE_NOW)
#if HAS_QUEUE_NOW
/**
* Enqueue and return only when commands are actually enqueued
*/
void enqueue_and_echo_command_now(const char* cmd, bool say_ok=false);
#if HAS_LCD_QUEUE_NOW
/**
* Enqueue from program memory and return only when commands are actually enqueued
*/
void enqueue_and_echo_commands_P_now(const char * const cmd);
#endif
#endif
/**
* Add to the circular command queue the next command from:
* - The command-injection queue (injected_commands_P)