From 6ef7ece046fc72fec92c664df92ec02255c7bb59 Mon Sep 17 00:00:00 2001 From: Robert Foss Date: Tue, 26 Jan 2016 17:14:19 -0500 Subject: [PATCH] Cleaned up APA102 module registration. --- app/modules/apa102.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/modules/apa102.c b/app/modules/apa102.c index 7f509f1e..c43a57b8 100644 --- a/app/modules/apa102.c +++ b/app/modules/apa102.c @@ -1,9 +1,10 @@ -#include "lualib.h" -#include "lauxlib.h" -#include "platform.h" -#include "lrotable.h" #include "c_stdlib.h" #include "c_string.h" +#include "lualib.h" +#include "lauxlib.h" +#include "lrotable.h" +#include "module.h" +#include "platform.h" #include "user_interface.h" @@ -100,8 +101,6 @@ static int apa102_write(lua_State* L) { } -#define MIN_OPT_LEVEL 2 -#include "lrodefs.h" const LUA_REG_TYPE apa102_map[] = { { LSTRKEY( "write" ), LFUNCVAL( apa102_write )}, @@ -110,5 +109,7 @@ const LUA_REG_TYPE apa102_map[] = LUALIB_API int luaopen_apa102(lua_State *L) { LREGISTER(L, "apa102", apa102_map); - return 1; + return 0; } + +NODEMCU_MODULE(APA102, "apa102", apa102_map, luaopen_apa102);