Esempio n. 1
0
/**
 ****************************************************************************************
 * @brief Handles UART data indication.
 *
 * @param[in] msgid      APP_SYS_UART_DATA_IND
 * @param[in] param      Pointer to struct app_uart_data_ind
 * @param[in] dest_id    TASK_APP
 * @param[in] src_id     TASK_APP
 *
 * @return If the message was consumed or not.
 ****************************************************************************************
 */
static int app_uart_data_ind_handler(ke_msg_id_t const msgid, struct app_uart_data_ind const *ind,
                               ke_task_id_t const dest_id, ke_task_id_t const src_id)
{
    switch (ke_state_get(dest_id))
    {
    case APP_INIT:
        break;
    case APP_IDLE:
    default:
#if QN_EACI
        app_eaci_msg_hdl((src_id >> 8) & 0xFF,
                                src_id & 0xFF,
                                ind->len,
                                ind->data);
#elif QN_DEMO_MENU
        if (ind->len != 0)
        {
            memcpy(app_env.input, ind->data, ind->len);
            app_menu_hdl();
        }
#endif
        break;
    }

#if (QN_EACI&&(EACI_MSG_BUFFER_EN==TRUE))
    return (KE_MSG_NO_FREE);
#else
    return (KE_MSG_CONSUMED);
#endif
}
Esempio n. 2
0
/**
 ****************************************************************************************
 * @brief Initialize the application environment.
 *
 ****************************************************************************************
 */
void app_init(void)
{
    app_env_init();
    app_debug_init();
    app_eaci_init();
    
    app_env.menu_id = menu_main;
    app_menu_hdl();
}