Commit 6b6456be authored by Johny Mattsson's avatar Johny Mattsson
Browse files

Major cleanup of module registration.

As per #810 & #796, only LUA_OPTIMIZE_MEMORY=2 & MIN_OPT_LEVEL=2 are
supported when building. This commit effects that limitation.

With this change modules/auxmods.h no longer needs to be updated for
every new module, nor do module writers need to cater for a hypothetical
LUA_OPTIMIZE_MEMORY < 2 scenario.
parent 68eadaaf
#include "lualib.h"
#include "lauxlib.h" #include "lauxlib.h"
#include "platform.h" #include "platform.h"
#include "auxmods.h" #include "lrodefs.h"
#include "lrotable.h"
#include "c_stdlib.h" #include "c_stdlib.h"
#include "c_string.h" #include "c_string.h"
#include "user_interface.h" #include "user_interface.h"
...@@ -127,8 +125,6 @@ static int ICACHE_FLASH_ATTR ws2812_writegrb(lua_State* L) { ...@@ -127,8 +125,6 @@ static int ICACHE_FLASH_ATTR ws2812_writegrb(lua_State* L) {
return 0; return 0;
} }
#define MIN_OPT_LEVEL 2
#include "lrodefs.h"
const LUA_REG_TYPE ws2812_map[] = const LUA_REG_TYPE ws2812_map[] =
{ {
{ LSTRKEY( "writergb" ), LFUNCVAL( ws2812_writergb )}, { LSTRKEY( "writergb" ), LFUNCVAL( ws2812_writergb )},
...@@ -138,6 +134,5 @@ const LUA_REG_TYPE ws2812_map[] = ...@@ -138,6 +134,5 @@ const LUA_REG_TYPE ws2812_map[] =
LUALIB_API int luaopen_ws2812(lua_State *L) { LUALIB_API int luaopen_ws2812(lua_State *L) {
// TODO: Make sure that the GPIO system is initialized // TODO: Make sure that the GPIO system is initialized
LREGISTER(L, "ws2812", ws2812_map); return 0;
return 1;
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment