uart_commands.c: no more text inception

This commit is contained in:
Christian Kroll 2014-09-16 23:34:53 +02:00
parent 0d69c2d209
commit f48994b222
1 changed files with 29 additions and 18 deletions

View File

@ -117,8 +117,12 @@ static void uartcmd_erase_eeprom(void) {
* Displays a simple message without the need to prefix a scrolltext command. * Displays a simple message without the need to prefix a scrolltext command.
*/ */
static void uartcmd_simple_message(void) { static void uartcmd_simple_message(void) {
if (uartcmd_processing_allowed()) {
uartcmd_forbid();
#ifdef JOYSTICK_SUPPORT #ifdef JOYSTICK_SUPPORT
if (waitForFire) { if (waitForFire) {
#else
{
#endif #endif
g_rx_buffer[1] = '<'; g_rx_buffer[1] = '<';
g_rx_buffer[2] = '/'; g_rx_buffer[2] = '/';
@ -128,10 +132,11 @@ static void uartcmd_simple_message(void) {
scrolltext(&g_rx_buffer[1]); scrolltext(&g_rx_buffer[1]);
#ifdef JOYSTICK_SUPPORT #ifdef JOYSTICK_SUPPORT
} else { } else {
#endif
UART_PUTS_P(UART_STR_GAMETX_ERR); UART_PUTS_P(UART_STR_GAMETX_ERR);
} }
#endif uartcmd_permit();
}
} }
@ -139,17 +144,23 @@ static void uartcmd_simple_message(void) {
* Displays a message which may use the complete range of scrolltext commands. * Displays a message which may use the complete range of scrolltext commands.
*/ */
static void uartcmd_scroll_message(void) { static void uartcmd_scroll_message(void) {
if (uartcmd_processing_allowed()) {
uartcmd_forbid();
#ifdef JOYSTICK_SUPPORT #ifdef JOYSTICK_SUPPORT
if (waitForFire) { if (waitForFire) {
#else
{
#endif #endif
// text must not be longer than the scroll text buffer // text must not be longer than the scroll text buffer
g_rx_buffer[7 + SCROLLTEXT_BUFFER_SIZE - 1] = 0; g_rx_buffer[7 + SCROLLTEXT_BUFFER_SIZE - 1] = 0;
scrolltext(&g_rx_buffer[7]); scrolltext(&g_rx_buffer[7]);
#ifdef JOYSTICK_SUPPORT #ifdef JOYSTICK_SUPPORT
} else { } else {
#endif
UART_PUTS_P(UART_STR_GAMETX_ERR); UART_PUTS_P(UART_STR_GAMETX_ERR);
} }
#endif uartcmd_permit();
}
} }