Skip to content
Permalink
Browse files
- Lua Tiny RAM (LTR) patch is now integrated in eLua and is enabled b…
…y default

- all eLua modules updated to work with LTR
- "cpu" module added to avr32, at91sam7x, str7
- "disp" module no longer generic (now stays in src/modules/lm3s). For this reason, the "disp" platform interface was also removed.
- the "modcommon" mechanism in STM32 (ROM loader) was depreciated in favour of the Lua Tiny RAM patch (and the "stm3210lcd" module from the STM32 backend now uses LTR).
- small bugfixes
  • Loading branch information
bogdanm committed Jan 11, 2009
1 parent 737aeda commit f729155
Show file tree
Hide file tree
Showing 79 changed files with 1,471 additions and 899 deletions.
@@ -3,6 +3,7 @@ target = ARGUMENTS.get( 'target', 'lua' ).lower()
cputype = ARGUMENTS.get( 'cpu', '' ).upper()
allocator = ARGUMENTS.get( 'allocator', '' ).lower()
boardname = ARGUMENTS.get( 'board' , '').upper()
optram = int( ARGUMENTS.get( 'optram', '1' ) )

# ROMFS file list
romfs = { 'bisect' : [ 'bisect.lua' ],
@@ -15,7 +16,8 @@ romfs = { 'bisect' : [ 'bisect.lua' ],
'tvbgone' : [ 'tvbgone.lua', 'codes.bin' ],
'hello' : [ 'hello.lua' ],
'info' : [ 'info.lua' ],
'morse' : [ 'mose.lua' ]
'morse' : [ 'morse.lua' ],
'dualpwm' : [ 'dualpwm.lua' ]
}

# List of platform/CPU combinations
@@ -41,28 +43,14 @@ board_list = { 'SAM7-EX256' : [ 'AT91SAM7X256', 'AT91SAM7X512' ],
'ATEVK1100' : [ 'AT32UC3A0512' ]
}

# ROMFS file list
romfs = { 'bisect' : [ 'bisect.lua' ],
'hangman' : [ 'hangman.lua' ],
'lhttpd' : [ 'index.pht', 'lhttpd.lua', 'test.lua' ],
'pong' : [ 'pong.lua', 'LM3S.lua' ],
'led' : [ 'led.lua' ],
'piano' : [ 'piano.lua' ],
'pwmled' : [ 'pwmled.lua' ],
'tvbgone' : [ 'tvbgone.lua', 'codes.bin' ],
'hello' : [ 'hello.lua' ],
'info' : [ 'info.lua' ],
'morse' : [ 'morse.lua' ]
}

# List of board/romfs data combinations
file_list = { 'SAM7-EX256' : [ 'bisect', 'hangman' , 'led', 'piano', 'hello', 'info', 'morse' ],
'EK-LM3S8962' : [ 'bisect', 'hangman', 'lhttpd', 'pong', 'led', 'piano', 'pwmled', 'tvbgone', 'hello', 'info', 'morse' ],
'EK-LM3S6965' : [ 'bisect', 'hangman', 'lhttpd', 'pong', 'led', 'piano', 'pwmled', 'tvbgone', 'hello', 'info', 'morse' ],
'STR9-COMSTICK' : [ 'bisect', 'hangman', 'led', 'hello', 'info' ],
'PC' : [ 'bisect', 'hello', 'info' ],
'LPC-H2888' : [ 'bisect', 'hangman', 'led', 'hello', 'info' ],
'MOD711' : [ 'bisect', 'hangman', 'led', 'hello', 'info' ],
'MOD711' : [ 'bisect', 'hangman', 'led', 'hello', 'info', 'dualpwm' ],
'STM3210E-EVAL' : [ 'bisect', 'hello', 'info' ],
'ATEVK1100' : [ 'bisect', 'hangman', 'led', 'hello', 'info' ]
}
@@ -149,7 +137,7 @@ if allocator == 'multiple':
# Lua source files and include path
lua_files = """lapi.c lcode.c ldebug.c ldo.c ldump.c lfunc.c lgc.c llex.c lmem.c lobject.c lopcodes.c
lparser.c lstate.c lstring.c ltable.c ltm.c lundump.c lvm.c lzio.c lauxlib.c lbaselib.c
ldblib.c liolib.c lmathlib.c loslib.c ltablib.c lstrlib.c loadlib.c linit.c lua.c"""
ldblib.c liolib.c lmathlib.c loslib.c ltablib.c lstrlib.c loadlib.c linit.c lua.c lrotable.c"""
if target == 'lualong' or target == 'lua':
lua_full_files = " " + " ".join( [ "src/lua/%s" % name for name in lua_files.split() ] )
local_include = "-Iinc -Iinc/newlib -Isrc/lua"
@@ -159,6 +147,7 @@ else:
print "Invalid target", target
sys.exit( 1 )
local_include = local_include + " -Isrc/modules -Isrc/platform/%s" % platform
cdefs = cdefs + " -DLUA_OPTIMIZE_MEMORY=%d" % ( optram != 0 and 2 or 0 )

# Additional libraries
local_libs = ''
@@ -175,7 +164,7 @@ uip_files = " src/elua_uip.c " + " ".join( [ "src/uip/%s" % name for name in uip
local_include = local_include + " -Isrc/uip"

# Lua module files
module_names = "disp.c modcommon.c pio.c spi.c tmr.c pd.c uart.c term.c pwm.c lpack.c bit.c net.c cpu.c"
module_names = "pio.c spi.c tmr.c pd.c uart.c term.c pwm.c lpack.c bit.c net.c cpu.c"
module_files = " " + " ".join( [ "src/modules/%s" % name for name in module_names.split() ] )

# Optimizer flags (speed or size)
@@ -147,21 +147,6 @@ u32 platform_timer_op( unsigned id, int op, u32 data );
u32 platform_s_timer_op( unsigned id, int op, u32 data );
u32 platform_timer_get_diff_us( unsigned id, timer_data_type end, timer_data_type start );

// *****************************************************************************
// OLED DISP subsection


void platform_disp_init( unsigned long freq );
void platform_disp_clear( void );
void platform_disp_stringDraw( const char *str, unsigned long x, unsigned long y, unsigned char level );
void platform_disp_imageDraw( const unsigned char *img, unsigned long x, unsigned long y,
unsigned long width, unsigned long height);
void platform_disp_enable( unsigned long freq );
void platform_disp_disable( void );
void platform_disp_displayOn( void );
void platform_disp_displayOff( void );


// *****************************************************************************
// PWM subsection

@@ -0,0 +1,29 @@
-- Control LED intensity with PWM on two channels

local pwmid1, pwmid2, tmrid = 0, 1, 3

if pd.board() ~= "MOD711" then
print "Unsopported board"
return
end

print "Control LED with PWM (fade up/down)"
print "Press any key to exit"
local crtduty, incr = 10, 5
pwm.setup( pwmid1, 50000, crtduty )
pwm.setup( pwmid2, 50000, 100 - crtduty )
pwm.start( pwmid1 )
pwm.start( pwmid2 )
while uart.recv( 1, 0, 0 ) < 0 do
if crtduty == 95 or crtduty == 5 then
incr = -incr
end
crtduty = crtduty + incr
pwm.setup( pwmid1, 50000, crtduty )
pwm.setup( pwmid2, 50000, 100 - crtduty )
tmr.delay( tmrid, 50000 )
end

pwm.stop( pwmid1 )
pwm.stop( pwmid2 )

@@ -19,7 +19,7 @@
</table>
<br>
And now let's test CGI. Use the form below to control the on-board LED.<br><br>
<form method="get" action="http://elua/index.pht" name="led">
<form method="get" action="/index.pht" name="led">
<table width="400" border="0" cellpadding="2" cellspacing="2">
<tbody>
<tr>
@@ -8,7 +8,7 @@
PLAT= none

CC= gcc
CFLAGS= -O2 -Wall $(MYCFLAGS)
CFLAGS= -O2 -Wall $(MYCFLAGS) -DLUA_OPTIMIZE_MEMORY=2
AR= ar rcu
RANLIB= ranlib
RM= rm -f
@@ -25,7 +25,7 @@ PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
LUA_A= liblua.a
CORE_O= lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o \
lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o \
lundump.o lvm.o lzio.o
lundump.o lvm.o lzio.o lrotable.o
LIB_O= lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o \
lstrlib.o loadlib.o linit.o

@@ -122,13 +122,14 @@ solaris:

lapi.o: lapi.c lua.h luaconf.h lapi.h lobject.h llimits.h ldebug.h \
lstate.h ltm.h lzio.h lmem.h ldo.h lfunc.h lgc.h lstring.h ltable.h \
lundump.h lvm.h
lauxlib.o: lauxlib.c lua.h luaconf.h lauxlib.h
lbaselib.o: lbaselib.c lua.h luaconf.h lauxlib.h lualib.h
lundump.h lvm.h lrotable.h
lauxlib.o: lauxlib.c lua.h luaconf.h lauxlib.h lrotable.h
lbaselib.o: lbaselib.c lua.h luaconf.h lauxlib.h lualib.h lrotable.h \
lrodefs.h
lcode.o: lcode.c lua.h luaconf.h lcode.h llex.h lobject.h llimits.h \
lzio.h lmem.h lopcodes.h lparser.h ldebug.h lstate.h ltm.h ldo.h lgc.h \
ltable.h
ldblib.o: ldblib.c lua.h luaconf.h lauxlib.h lualib.h
ldblib.o: ldblib.c lua.h luaconf.h lauxlib.h lualib.h lrotable.h lrodefs.h
ldebug.o: ldebug.c lua.h luaconf.h lapi.h lobject.h llimits.h lcode.h \
llex.h lzio.h lmem.h lopcodes.h lparser.h ldebug.h lstate.h ltm.h ldo.h \
lfunc.h lstring.h lgc.h ltable.h lvm.h
@@ -140,43 +141,49 @@ ldump.o: ldump.c lua.h luaconf.h lobject.h llimits.h lstate.h ltm.h \
lfunc.o: lfunc.c lua.h luaconf.h lfunc.h lobject.h llimits.h lgc.h lmem.h \
lstate.h ltm.h lzio.h
lgc.o: lgc.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h ltm.h \
lzio.h lmem.h ldo.h lfunc.h lgc.h lstring.h ltable.h
linit.o: linit.c lua.h luaconf.h lualib.h lauxlib.h
liolib.o: liolib.c lua.h luaconf.h lauxlib.h lualib.h
lzio.h lmem.h ldo.h lfunc.h lgc.h lstring.h ltable.h lrotable.h
linit.o: linit.c lua.h luaconf.h lualib.h lauxlib.h lrotable.h
liolib.o: liolib.c lua.h luaconf.h lauxlib.h lualib.h lrotable.h lrodefs.h
llex.o: llex.c lua.h luaconf.h ldo.h lobject.h llimits.h lstate.h ltm.h \
lzio.h lmem.h llex.h lparser.h lstring.h lgc.h ltable.h
lmathlib.o: lmathlib.c lua.h luaconf.h lauxlib.h lualib.h
lmathlib.o: lmathlib.c lua.h luaconf.h lauxlib.h lualib.h lrotable.h \
lrodefs.h
lmem.o: lmem.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h \
ltm.h lzio.h lmem.h ldo.h
loadlib.o: loadlib.c lua.h luaconf.h lauxlib.h lualib.h
loadlib.o: loadlib.c lua.h luaconf.h lauxlib.h lualib.h lrotable.h
lobject.o: lobject.c lua.h luaconf.h ldo.h lobject.h llimits.h lstate.h \
ltm.h lzio.h lmem.h lstring.h lgc.h lvm.h
lopcodes.o: lopcodes.c lopcodes.h llimits.h lua.h luaconf.h
loslib.o: loslib.c lua.h luaconf.h lauxlib.h lualib.h
loslib.o: loslib.c lua.h luaconf.h lauxlib.h lualib.h lrotable.h lrodefs.h
lparser.o: lparser.c lua.h luaconf.h lcode.h llex.h lobject.h llimits.h \
lzio.h lmem.h lopcodes.h lparser.h ldebug.h lstate.h ltm.h ldo.h \
lfunc.h lstring.h lgc.h ltable.h
lstate.o: lstate.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h \
ltm.h lzio.h lmem.h ldo.h lfunc.h lgc.h llex.h lstring.h ltable.h
lstring.o: lstring.c lua.h luaconf.h lmem.h llimits.h lobject.h lstate.h \
ltm.h lzio.h lstring.h lgc.h
lstrlib.o: lstrlib.c lua.h luaconf.h lauxlib.h lualib.h
lstrlib.o: lstrlib.c lua.h luaconf.h lauxlib.h lualib.h lrotable.h \
lrodefs.h
ltable.o: ltable.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h \
ltm.h lzio.h lmem.h ldo.h lgc.h ltable.h
ltablib.o: ltablib.c lua.h luaconf.h lauxlib.h lualib.h
ltm.h lzio.h lmem.h ldo.h lgc.h ltable.h lrotable.h
ltablib.o: ltablib.c lua.h luaconf.h lauxlib.h lualib.h lrotable.h \
lrodefs.h
ltm.o: ltm.c lua.h luaconf.h lobject.h llimits.h lstate.h ltm.h lzio.h \
lmem.h lstring.h lgc.h ltable.h
lmem.h lstring.h lgc.h ltable.h lrotable.h
lua.o: lua.c lua.h luaconf.h lauxlib.h lualib.h
luac.o: luac.c lua.h luaconf.h lauxlib.h ldo.h lobject.h llimits.h \
lstate.h ltm.h lzio.h lmem.h lfunc.h lopcodes.h lstring.h lgc.h \
lundump.h
lundump.o: lundump.c lua.h luaconf.h ldebug.h lstate.h lobject.h \
llimits.h ltm.h lzio.h lmem.h ldo.h lfunc.h lstring.h lgc.h lundump.h
lvm.o: lvm.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h ltm.h \
lzio.h lmem.h ldo.h lfunc.h lgc.h lopcodes.h lstring.h ltable.h lvm.h
lzio.h lmem.h ldo.h lfunc.h lgc.h lopcodes.h lstring.h ltable.h lvm.h \
lrotable.h
lzio.o: lzio.c lua.h luaconf.h llimits.h lmem.h lstate.h lobject.h ltm.h \
lzio.h
print.o: print.c ldebug.h lstate.h lua.h luaconf.h lobject.h llimits.h \
ltm.h lzio.h lmem.h lopcodes.h lundump.h
lrotable.o: lrotable.c lua.h lrotable.h lauxlib.h lobject.h lstring.h \
lobject.h lapi.h

# (end of Makefile)

0 comments on commit f729155

Please sign in to comment.