Skip to content

Commit

Permalink
UART fixes and lua.c merge
Browse files Browse the repository at this point in the history
  • Loading branch information
TerryE committed Dec 10, 2019
1 parent 18282e2 commit 32e161b
Show file tree
Hide file tree
Showing 14 changed files with 222 additions and 514 deletions.
10 changes: 5 additions & 5 deletions app/driver/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ void input_setprompt (const char *prompt) {
** the bool ins.run_input.
** - TRUE: it clears the UART FIFO up to EOL, doing any callback and sending
** the line to Lua.
** - FALSE: it clears the UART FIFO doing callbacks according to the data_len /
** end_char break.
** - FALSE: it clears the UART FIFO doing callbacks according to the data_len
** or end_char break.
*/
extern void lua_input_string (const char *line, int len);

Expand Down Expand Up @@ -180,9 +180,9 @@ static bool input_readline(void) {
} else {
while (uart_getc(&ch)) {
ins.data[ins.line_pos++] = ch;
if( ins.line_pos >= ins.len ||
(ins.data_len > 0 && ins.line_pos >= ins.data_len) ||
ch == ins.end_char ) {
if( ins.line_pos >= ins.len ||
(ins.data_len >= 0 && ins.line_pos >= ins.data_len) ||
(ins.data_len < 0 && ch == ins.end_char )) {
ins.uart_cb(ins.data, ins.line_pos);
ins.line_pos = 0;
}
Expand Down
4 changes: 2 additions & 2 deletions app/lua/lapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,9 +530,9 @@ LUA_API void lua_pushrotable (lua_State *L, const ROTable *t) {
lua_unlock(L);
}

LUA_API void lua_pushlightfunction(lua_State *L, void *p) {
LUA_API void lua_pushlightfunction(lua_State *L, lua_CFunction f) {
lua_lock(L);
setfvalue(L->top, p);
setfvalue(L->top, f);
api_incr_top(L);
lua_unlock(L);
}
Expand Down
6 changes: 3 additions & 3 deletions app/lua/lauxlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -900,13 +900,13 @@ LUALIB_API void luaL_assertfail(const char *file, int line, const char *message)
* which will then sync up with the remote GDB client to allow forensics of the error.
*/
#ifdef LUA_CROSS_COMPILER
LUALIB_API void luaL_dbgbreak(void) {
puts("debug break"); /* allows BT analysis of assert fails */
LUALIB_API void lua_debugbreak(void) {
puts(" lua_debugbreak "); /* allows BT analysis of assert fails */
}
#else
extern void gdbstub_init(void);

LUALIB_API void luaL_dbgbreak(void) {
LUALIB_API void lua_debugbreak(void) {
static int repeat_entry = 0;
if (repeat_entry == 0) {
dbg_printf("Start up the gdb stub if not already started\n");
Expand Down
3 changes: 0 additions & 3 deletions app/lua/lstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,6 @@ lua_State *lua_open(void) {
return lua_crtstate;
}

lua_State *lua_getstate(void) {
return lua_crtstate;
}
LUA_API void lua_close (lua_State *L) {
#ifndef LUA_CROSS_COMPILER
lua_sethook( L, NULL, 0, 0 );
Expand Down
310 changes: 0 additions & 310 deletions app/lua/lua.c

This file was deleted.

1 change: 1 addition & 0 deletions app/lua/lua.c
Loading

0 comments on commit 32e161b

Please sign in to comment.