Lua interpreter now running inside companion!
This commit is contained in:
@@ -80,7 +80,12 @@ IF( Subversion_FOUND )
|
|||||||
# Subversion_WC_INFO( ${PROJECT_SOURCE_DIR} C9X )
|
# Subversion_WC_INFO( ${PROJECT_SOURCE_DIR} C9X )
|
||||||
ENDIF( )
|
ENDIF( )
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ${PROJECT_SOURCE_DIR}/../.. ${PROJECT_SOURCE_DIR}/../../radio/src/fonts/std )
|
include_directories(
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
${PROJECT_SOURCE_DIR}/../..
|
||||||
|
${PROJECT_SOURCE_DIR}/../../radio/src/fonts/std
|
||||||
|
${PROJECT_SOURCE_DIR}/../../radio/src/lua/src
|
||||||
|
)
|
||||||
|
|
||||||
set(TH9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/th9x)
|
set(TH9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/th9x)
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
|
|||||||
@@ -49,7 +49,8 @@
|
|||||||
#define PPM_CENTER_ADJUSTABLE
|
#define PPM_CENTER_ADJUSTABLE
|
||||||
#define PPM_LIMITS_SYMETRICAL
|
#define PPM_LIMITS_SYMETRICAL
|
||||||
#define FAI_CHOICE
|
#define FAI_CHOICE
|
||||||
|
#define LUA
|
||||||
|
#define LUA_MODEL_SCRIPTS
|
||||||
#define EEPROM_VARIANT 3
|
#define EEPROM_VARIANT 3
|
||||||
|
|
||||||
#undef min
|
#undef min
|
||||||
@@ -116,6 +117,36 @@ inline int geteepromsize() {
|
|||||||
#include "radio/src/translations/tts_sk.cpp"
|
#include "radio/src/translations/tts_sk.cpp"
|
||||||
#include "radio/src/translations/tts_pl.cpp"
|
#include "radio/src/translations/tts_pl.cpp"
|
||||||
|
|
||||||
|
#include "radio/src/lua.cpp"
|
||||||
|
#include "radio/src/lua/src/lapi.c"
|
||||||
|
#include "radio/src/lua/src/lcode.c"
|
||||||
|
#include "radio/src/lua/src/lctype.c"
|
||||||
|
#include "radio/src/lua/src/ldebug.c"
|
||||||
|
#include "radio/src/lua/src/ldo.c"
|
||||||
|
#include "radio/src/lua/src/ldump.c"
|
||||||
|
#include "radio/src/lua/src/lfunc.c"
|
||||||
|
#include "radio/src/lua/src/lgc.c"
|
||||||
|
#include "radio/src/lua/src/llex.c"
|
||||||
|
#include "radio/src/lua/src/lmem.c"
|
||||||
|
#include "radio/src/lua/src/lobject.c"
|
||||||
|
#include "radio/src/lua/src/lopcodes.c"
|
||||||
|
#include "radio/src/lua/src/lparser.c"
|
||||||
|
#include "radio/src/lua/src/lstate.c"
|
||||||
|
#include "radio/src/lua/src/lstring.c"
|
||||||
|
#include "radio/src/lua/src/ltable.c"
|
||||||
|
#include "radio/src/lua/src/ltm.c"
|
||||||
|
#include "radio/src/lua/src/lundump.c"
|
||||||
|
#include "radio/src/lua/src/lvm.c"
|
||||||
|
#include "radio/src/lua/src/lzio.c"
|
||||||
|
#include "radio/src/lua/src/lbaselib.c"
|
||||||
|
#include "radio/src/lua/src/linit.c"
|
||||||
|
#include "radio/src/lua/src/lmathlib.c"
|
||||||
|
#include "radio/src/lua/src/loadlib.c"
|
||||||
|
#include "radio/src/lua/src/lauxlib.c"
|
||||||
|
#include "radio/src/lua/src/ltablib.c"
|
||||||
|
#include "radio/src/lua/src/lcorolib.c"
|
||||||
|
|
||||||
|
|
||||||
int16_t g_anas[NUM_STICKS+BOARD_X9D_NUM_POTS];
|
int16_t g_anas[NUM_STICKS+BOARD_X9D_NUM_POTS];
|
||||||
|
|
||||||
uint16_t anaIn(uint8_t chan)
|
uint16_t anaIn(uint8_t chan)
|
||||||
|
|||||||
+1
-1
@@ -252,7 +252,7 @@ GVARS = NO
|
|||||||
|
|
||||||
# Lua interpreter embedded
|
# Lua interpreter embedded
|
||||||
# Values = NO, NO_MODEL_SCRIPTS, YES
|
# Values = NO, NO_MODEL_SCRIPTS, YES
|
||||||
# LUA = NO
|
LUA = NO
|
||||||
|
|
||||||
# Menu Lock modes
|
# Menu Lock modes
|
||||||
# Values = NO, READONLY, NOMENUS
|
# Values = NO, READONLY, NOMENUS
|
||||||
|
|||||||
@@ -12,7 +12,9 @@
|
|||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
// #define LUA_LIB
|
// #define LUA_LIB
|
||||||
#define USE_FATFS
|
#if !defined(SIMU)
|
||||||
|
#define USE_FATFS
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** ==================================================================
|
** ==================================================================
|
||||||
@@ -443,14 +445,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* the following operations need the math library */
|
/* the following operations need the math library */
|
||||||
#if defined(lobject_c) || defined(lvm_c)
|
//#if defined(lobject_c) || defined(lvm_c)
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#define luai_nummod(L,a,b) ((a) - l_mathop(floor)((a)/(b))*(b))
|
#define luai_nummod(L,a,b) ((a) - l_mathop(floor)((a)/(b))*(b))
|
||||||
#define luai_numpow(L,a,b) (l_mathop(pow)(a,b))
|
#define luai_numpow(L,a,b) (l_mathop(pow)(a,b))
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
/* these are quite standard operations */
|
/* these are quite standard operations */
|
||||||
#if defined(LUA_CORE)
|
// #if defined(LUA_CORE)
|
||||||
#define luai_numadd(L,a,b) ((a)+(b))
|
#define luai_numadd(L,a,b) ((a)+(b))
|
||||||
#define luai_numsub(L,a,b) ((a)-(b))
|
#define luai_numsub(L,a,b) ((a)-(b))
|
||||||
#define luai_nummul(L,a,b) ((a)*(b))
|
#define luai_nummul(L,a,b) ((a)*(b))
|
||||||
@@ -460,7 +462,7 @@
|
|||||||
#define luai_numlt(L,a,b) ((a)<(b))
|
#define luai_numlt(L,a,b) ((a)<(b))
|
||||||
#define luai_numle(L,a,b) ((a)<=(b))
|
#define luai_numle(L,a,b) ((a)<=(b))
|
||||||
#define luai_numisnan(L,a) (!luai_numeq((a), (a)))
|
#define luai_numisnan(L,a) (!luai_numeq((a), (a)))
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user