1
0
mirror of https://github.com/elua/elua.git synced 2025-01-08 20:56:17 +08:00

- Added version() function to elua module. Returns a string with the running eLua version

- Added the elua module to str7, str9, lpc24xx, lpc288x, stm32, avr32, at91sam7x and lm3s platforms
- OBS: the elua module is NOT working on at91sam7x yet (and I don't know why)
- Minor refinements in the License text
This commit is contained in:
Dado Sutter 2010-02-20 20:02:56 +00:00
parent f825e2c39e
commit 746dd14de7
10 changed files with 24 additions and 3 deletions

View File

@ -1,3 +1,5 @@
Copyright (c) 2007, 2008, 2009, 2010 Dado Sutter and Bogdan Marinescu
eLua is Open Source and is freely distributed under the MIT licence.
The Lua part of eLua is licensed under the Lua licensing terms, which you

View File

@ -7,6 +7,7 @@
#include "auxmods.h"
#include "lrotable.h"
#include "legc.h"
#include "version.h"
#include <string.h>
// Lua: elua.egc_setup( mode, [ memlimit ] )
@ -21,12 +22,22 @@ static int egc_setup( lua_State *L )
return 0;
}
// Lua: elua.version()
static int version( lua_State *L )
{
lua_pushstring( L, ELUA_STR_VERSION );
return 1;
}
// Module function map
#define MIN_OPT_LEVEL 2
#include "lrodefs.h"
const LUA_REG_TYPE elua_map[] =
{
{ LSTRKEY( "egc_setup" ), LFUNCVAL( egc_setup ) },
{ LSTRKEY( "version" ), LFUNCVAL( version ) },
#if LUA_OPTIMIZE_MEMORY > 0
{ LSTRKEY( "EGC_NOT_ACTIVE" ), LNUMVAL( EGC_NOT_ACTIVE ) },
{ LSTRKEY( "EGC_ON_ALLOC_FAILURE" ), LNUMVAL( EGC_ON_ALLOC_FAILURE ) },

View File

@ -48,6 +48,7 @@
_ROM( AUXLIB_PACK, luaopen_pack, pack_map )\
_ROM( AUXLIB_BIT, luaopen_bit, bit_map )\
_ROM( AUXLIB_CPU, luaopen_cpu, cpu_map )\
_ROM( AUXLIB_ELUA, luaopen_elua, elua_map )\
RPCLINE\
_ROM( LUA_MATHLIBNAME, luaopen_math, math_map )

View File

@ -46,6 +46,7 @@
_ROM( AUXLIB_TMR, luaopen_tmr, tmr_map )\
_ROM( AUXLIB_TERM, luaopen_term, term_map )\
_ROM( AUXLIB_CPU, luaopen_cpu, cpu_map )\
_ROM( AUXLIB_ELUA, luaopen_elua, elua_map )\
RPCLINE\
_ROM( AUXLIB_BIT, luaopen_bit, bit_map )\
_ROM( AUXLIB_PACK, luaopen_pack, pack_map )\

View File

@ -89,6 +89,7 @@
_ROM( AUXLIB_BITARRAY, luaopen_bitarray, bitarray_map )\
NETLINE\
_ROM( AUXLIB_CPU, luaopen_cpu, cpu_map )\
_ROM( AUXLIB_ELUA, luaopen_elua, elua_map )\
ADCLINE\
RPCLINE\
_ROM( LUA_MATHLIBNAME, luaopen_math, math_map )\
@ -100,7 +101,7 @@
// Static TCP/IP configuration
#define ELUA_CONF_IPADDR0 192
#define ELUA_CONF_IPADDR1 168
#define ELUA_CONF_IPADDR2 0
#define ELUA_CONF_IPADDR2 100
#define ELUA_CONF_IPADDR3 5
#define ELUA_CONF_NETMASK0 255
@ -110,12 +111,12 @@
#define ELUA_CONF_DEFGW0 192
#define ELUA_CONF_DEFGW1 168
#define ELUA_CONF_DEFGW2 0
#define ELUA_CONF_DEFGW2 100
#define ELUA_CONF_DEFGW3 1
#define ELUA_CONF_DNS0 192
#define ELUA_CONF_DNS1 168
#define ELUA_CONF_DNS2 0
#define ELUA_CONF_DNS2 100
#define ELUA_CONF_DNS3 1
// *****************************************************************************

View File

@ -48,6 +48,7 @@
_ROM( AUXLIB_PACK, luaopen_pack, pack_map )\
_ROM( AUXLIB_BIT, luaopen_bit, bit_map )\
_ROM( AUXLIB_CPU, luaopen_cpu, cpu_map )\
_ROM( AUXLIB_ELUA, luaopen_elua, elua_map )\
_ROM( AUXLIB_PWM, luaopen_pwm, pwm_map )\
RPCLINE\
_ROM( LUA_MATHLIBNAME, luaopen_math, math_map )

View File

@ -84,6 +84,7 @@
_ROM( AUXLIB_TERM, luaopen_term, term_map )\
_ROM( AUXLIB_PACK, luaopen_pack, pack_map )\
_ROM( AUXLIB_BIT, luaopen_bit, bit_map )\
_ROM( AUXLIB_ELUA, luaopen_elua, elua_map )\
RPCLINE\
_ROM( LUA_MATHLIBNAME, luaopen_math, math_map )

View File

@ -69,6 +69,7 @@
_ROM( AUXLIB_PACK, luaopen_pack, pack_map )\
_ROM( AUXLIB_BIT, luaopen_bit, bit_map )\
_ROM( AUXLIB_CPU, luaopen_cpu, cpu_map )\
_ROM( AUXLIB_ELUA, luaopen_elua, elua_map )\
_ROM( AUXLIB_TMR, luaopen_tmr, tmr_map )\
ADCLINE\
_ROM( AUXLIB_CAN, luaopen_can, can_map )\

View File

@ -46,6 +46,7 @@
_ROM( AUXLIB_TERM, luaopen_term, term_map )\
_ROM( AUXLIB_PACK, luaopen_pack, pack_map )\
_ROM( AUXLIB_BIT, luaopen_bit, bit_map )\
_ROM( AUXLIB_ELUA, luaopen_elua, elua_map )\
_ROM( AUXLIB_CPU, luaopen_cpu, cpu_map )\
RPCLINE\
_ROM( LUA_MATHLIBNAME, luaopen_math, math_map )

View File

@ -95,6 +95,7 @@ u32 SCU_GetMCLKFreqValue();
_ROM( AUXLIB_PACK, luaopen_pack, pack_map )\
_ROM( AUXLIB_BIT, luaopen_bit, bit_map )\
_ROM( AUXLIB_CPU, luaopen_cpu, cpu_map)\
_ROM( AUXLIB_CPU, luaopen_elua, elua_map)\
RPCLINE\
_ROM( AUXLIB_PWM, luaopen_pwm, pwm_map)\
_ROM( LUA_MATHLIBNAME, luaopen_math, math_map )\