Beispiel #1
0
/*****************************************************************************
 * FUNCTION: ZGConsoleInit
 *
 * RETURNS: None
 *
 * PARAMS:  p_cmdStrings  -- pointer to array of application-specific command strings
 *          numCmdStrings -- number of strings in p_cmdStrings
 *
 * NOTES:   Initialization for console thread
 *
 *****************************************************************************/
tZGVoidReturn ZGConsoleInit( ROM tZGU8 **p_cmdStrings, tZGU8 numCmdStrings)
{
    SET_RX_STATE(kSTWaitForChar);
    SET_CURSOR(0);

    // zero out command line buffer
    memset(g_ConsoleContext.rxBuf, 0x00, sizeof(g_ConsoleContext.rxBuf));

    g_ConsoleContext.bStateMachineLoop = kZGBoolTrue;
    g_ConsoleContext.firstChar         = kZGBoolFalse;
    g_ConsoleContext.p_cmdStrings      = p_cmdStrings;
    g_ConsoleContext.numCmdStrings     = numCmdStrings;
    g_ConsoleContext.appConsoleMsgRx   = kZGBoolFalse;
    SET_ECHO_ON();
#if (kZGNumHistoryEntries > 0)
    InitHistory();
#endif

}
/*****************************************************************************
 * FUNCTION: WFConsoleInit
 *
 * RETURNS: None
 *
 * PARAMS:
 *
 * NOTES:   Initialization for console thread
 *
 *****************************************************************************/
void WFConsoleInit(void)
{

    SET_RX_STATE(kSTWaitForChar);
    SET_CURSOR(0);

    // zero out command line buffer
    memset(g_ConsoleContext.rxBuf, 0x00, sizeof(g_ConsoleContext.rxBuf));

    g_ConsoleContext.bStateMachineLoop = TRUE;
    g_ConsoleContext.firstChar         = FALSE;
    g_ConsoleContext.appConsoleMsgRx   = FALSE;
    SET_ECHO_ON();
#if (kWFNumHistoryEntries > 0)
    InitHistory();
#endif

    g_ConsoleContext.echoOn = TRUE;

}