Switch to CMake
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
macro(add_lua_export_target target)
|
||||
add_custom_command(
|
||||
OUTPUT lua_exports_${target}.inc
|
||||
COMMAND ${CMAKE_C_COMPILER} -E ${ARGN} -DEXPORT ${INTTYPES_INCLUDE_OPTION} ${RADIO_SRC_DIRECTORY}/myeeprom.h | grep LEXP > lua_exports_${target}.txt
|
||||
COMMAND python ${RADIO_DIRECTORY}/util/luaexport.py ${VERSION} lua_exports_${target}.txt lua_exports_${target}.inc lua_fields_${target}.txt
|
||||
)
|
||||
add_custom_target(lua_export_${target} DEPENDS lua_exports_${target}.inc)
|
||||
endmacro(add_lua_export_target)
|
||||
|
||||
add_lua_export_target(taranis -DPCBTARANIS -DLUA -DVIRTUALINPUTS)
|
||||
add_lua_export_target(taranis_x9e -DPCBTARANIS -DREVPLUS -DREV9E -DLUA -DVIRTUALINPUTS)
|
||||
add_lua_export_target(horus -DPCBHORUS -DLUA -DVIRTUALINPUTS)
|
||||
@@ -71,11 +71,6 @@
|
||||
|
||||
#define FIND_FIELD_DESC 0x01
|
||||
|
||||
struct LuaField {
|
||||
uint16_t id;
|
||||
char desc[50];
|
||||
};
|
||||
|
||||
/*luadoc
|
||||
@function getVersion()
|
||||
|
||||
@@ -255,7 +250,7 @@ void luaGetValueAndPush(int src)
|
||||
/**
|
||||
Return field data for a given field name
|
||||
*/
|
||||
bool luaFindFieldByName(const char * name, LuaField & field, unsigned int flags=0)
|
||||
bool luaFindFieldByName(const char * name, LuaField & field, unsigned int flags)
|
||||
{
|
||||
// TODO better search method (binary lookup)
|
||||
for (unsigned int n=0; n<DIM(luaSingleFields); ++n) {
|
||||
|
||||
@@ -39,16 +39,12 @@
|
||||
|
||||
#if defined(LUA)
|
||||
|
||||
#if !defined(SIMU)
|
||||
extern "C" {
|
||||
#endif
|
||||
#include <lua.h>
|
||||
#include <lauxlib.h>
|
||||
#include <lualib.h>
|
||||
#include <lrotable.h>
|
||||
#if !defined(SIMU)
|
||||
}
|
||||
#endif
|
||||
|
||||
extern lua_State *L;
|
||||
extern bool luaLcdAllowed;
|
||||
@@ -149,10 +145,13 @@ extern "C" {
|
||||
#elif defined(PCBHORUS)
|
||||
#define IS_MASKABLE(key) ((key) != KEY_EXIT && (key) != KEY_ENTER)
|
||||
#endif
|
||||
struct LuaField {
|
||||
uint16_t id;
|
||||
char desc[50];
|
||||
};
|
||||
bool luaFindFieldByName(const char * name, LuaField & field, unsigned int flags=0);
|
||||
#else // #if defined(LUA)
|
||||
|
||||
#define LUA_LOAD_MODEL_SCRIPTS()
|
||||
|
||||
#endif // #if defined(LUA)
|
||||
|
||||
#endif // #ifndef lua_api_h
|
||||
|
||||
Reference in New Issue
Block a user