Compare commits
4 Commits
8261e605bc
...
ae59563e7d
| Author | SHA1 | Date | |
|---|---|---|---|
|
ae59563e7d
|
|||
|
42aec53edb
|
|||
|
259ad0a6f1
|
|||
|
8f71535dfd
|
11
CLI/CLI.c
11
CLI/CLI.c
@@ -128,7 +128,11 @@ void historyPrevius(CLI_t* cli)
|
||||
// write line
|
||||
if ((ret >= 0) && (line != NULL))
|
||||
{
|
||||
CLI_stringOut(cli, line);
|
||||
int i;
|
||||
for (i=0; *(line + i) != '\0'; i++)
|
||||
{
|
||||
CLI_charIn(cli, *(line + i));
|
||||
}
|
||||
}
|
||||
}
|
||||
void historyNext(CLI_t* cli)
|
||||
@@ -148,7 +152,10 @@ void historyNext(CLI_t* cli)
|
||||
if ((ret >= 0) && (line != NULL))
|
||||
{
|
||||
int i;
|
||||
CLI_stringOut(cli, line);
|
||||
for (i=0; *(line + i) != '\0'; i++)
|
||||
{
|
||||
CLI_charIn(cli, *(line + i));
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <config.h>
|
||||
#define HISTORY
|
||||
|
||||
#include "../CMDList/CMDList.h"
|
||||
#include "../FIFOBuff/FIFOBuffChar.h"
|
||||
|
||||
@@ -1,18 +1,10 @@
|
||||
|
||||
# FIFO Buffer
|
||||
add_library(FIFOBuffChar FIFOBuff/FIFOBuffChar.c)
|
||||
|
||||
# CMD List
|
||||
add_library(CMDList CMDList/CMDList.c)
|
||||
add_library(CMDListPrint CMDList/printList.c)
|
||||
|
||||
# History
|
||||
add_library(history History/History.c)
|
||||
|
||||
# CLI
|
||||
add_library(CLI CLI/CLI.c)
|
||||
target_link_libraries(CLI CMDList FIFOBuffChar history)
|
||||
|
||||
add_library(CLI_History CLI/CLI.c)
|
||||
target_link_libraries(CLI_History CMDList FIFOBuffChar history)
|
||||
target_compile_definitions(CLI_History PRIVATE HISTORY)
|
||||
idf_component_register(
|
||||
COMPONENT_ALIAS "cli"
|
||||
SRCS
|
||||
CLI/CLI.c
|
||||
FIFOBuff/FIFOBuffChar.c
|
||||
CMDList/CMDList.c
|
||||
History/History.c
|
||||
INCLUDE_DIRS "./"
|
||||
PRIV_INCLUDE_DIRS "../../src")
|
||||
|
||||
@@ -123,7 +123,7 @@ int History_getPrev(History_t* history, char** line)
|
||||
*line = NULL;
|
||||
retCode = -1;
|
||||
}
|
||||
return 0;
|
||||
return retCode;
|
||||
}
|
||||
|
||||
int History_getNext(History_t* history, char** line)
|
||||
@@ -144,7 +144,7 @@ int History_getNext(History_t* history, char** line)
|
||||
*line = NULL;
|
||||
retCode = -1;
|
||||
}
|
||||
return 0;
|
||||
return retCode;
|
||||
}
|
||||
|
||||
int History_getFullHistory(History_t* history, char*** list)
|
||||
|
||||
Reference in New Issue
Block a user