From d46bc5cc1f8b88d5fcb0aa34142d20cd1d10a062 Mon Sep 17 00:00:00 2001 From: devsaurus Date: Mon, 26 Oct 2015 22:39:33 +0100 Subject: [PATCH] align spi_recv to platform_spi_send_recv --- app/modules/spi.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/modules/spi.c b/app/modules/spi.c index 46394cf7..6a0d2f97 100644 --- a/app/modules/spi.c +++ b/app/modules/spi.c @@ -173,11 +173,12 @@ static int spi_send_recv( lua_State *L ) return spi_generic_send_recv( L, 1 ); } -// Lua: read = spi.recv( id, size ) +// Lua: read = spi.recv( id, size, [default data] ) static int spi_recv( lua_State *L ) { int id = luaL_checkinteger( L, 1 ); int size = luaL_checkinteger( L, 2 ), i; + int def = luaL_optinteger( L, 3, 0xffffffff ); luaL_Buffer b; @@ -189,10 +190,7 @@ static int spi_recv( lua_State *L ) luaL_buffinit( L, &b ); for (i=0; i