Make Uart driver universal
This commit is contained in:
@@ -41,12 +41,6 @@ static shellmatta_instance_t shell;
|
||||
static char shell_buffer[512];
|
||||
static char history_buffer[1024];
|
||||
|
||||
static shellmatta_retCode_t write_shell_callback(const char *data, uint32_t len)
|
||||
{
|
||||
uart_send_array_with_dma(data, len);
|
||||
return SHELLMATTA_OK;
|
||||
}
|
||||
|
||||
static shellmatta_retCode_t shell_cmd_ver(const shellmatta_handle_t handle,
|
||||
const char *arguments,
|
||||
uint32_t length)
|
||||
@@ -324,13 +318,13 @@ static shellmatta_cmd_t cmd[9] = {
|
||||
}
|
||||
};
|
||||
|
||||
shellmatta_handle_t shell_init(void)
|
||||
shellmatta_handle_t shell_init(shellmatta_write_t write_func)
|
||||
{
|
||||
shellmatta_handle_t handle;
|
||||
shellmatta_retCode_t ret;
|
||||
|
||||
ret = shellmatta_doInit(&shell, &handle, shell_buffer, sizeof(shell_buffer), history_buffer, sizeof(history_buffer),
|
||||
"\e[1;32mEnter command:\e[m\r\n", cmd, write_shell_callback);
|
||||
"\e[1;32mEnter command:\e[m\r\n", cmd, write_func);
|
||||
if (ret != SHELLMATTA_OK)
|
||||
handle = NULL;
|
||||
|
||||
|
Reference in New Issue
Block a user