mirror of
https://github.com/elua/elua.git
synced 2025-01-08 20:56:17 +08:00
f729155fce
- 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
52 lines
1.6 KiB
Plaintext
52 lines
1.6 KiB
Plaintext
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
|
<html><head><title>eLua webserver test</title>
|
|
</head><body>
|
|
<p align="center"><big>Welcome to the <b>eLua</b> web server!</big><br></p>
|
|
<br>
|
|
<div style="text-align: left;">The right column of the following table is generated by embedded Lua code:<br>
|
|
<br>
|
|
<table width="400" border="1" cellpadding="2" cellspacing="2">
|
|
<tbody>
|
|
<tr>
|
|
<td><b>eLua CPU</b></td>
|
|
<td><?lua print(pd.cpu()) ?></td>
|
|
</tr>
|
|
<tr>
|
|
<td><b>eLua board</b></td>
|
|
<td><?lua print(pd.board()) ?></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<br>
|
|
And now let's test CGI. Use the form below to control the on-board LED.<br><br>
|
|
<form method="get" action="/index.pht" name="led">
|
|
<table width="400" border="0" cellpadding="2" cellspacing="2">
|
|
<tbody>
|
|
<tr>
|
|
<td style="center"><input type="submit" value="Led ON" name="ledon"></td>
|
|
<td style="center"><input type="submit" value="Led OFF" name="ledoff"></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</form>
|
|
<?lua
|
|
local ledpin = pio.PF_0
|
|
pio.output(ledpin)
|
|
if reqdata['ledon'] then
|
|
pio.set(ledpin)
|
|
print '<br><font color="blue"><b>The LED is now ON</b></font><br>'
|
|
elseif reqdata['ledoff'] then
|
|
pio.clear(ledpin)
|
|
print '<br><font color="blue"><b>The LED is now OFF</b></font><br>'
|
|
elseif next(reqdata) ~= nil then
|
|
print '<br><font color="red"><b>Invalid CGI request!</b></font><br>'
|
|
end
|
|
?>
|
|
<br>
|
|
|
|
Press <a href="/test.lua">here</a> to go to a test page generated completely by a Lua script.<br>
|
|
<br>
|
|
<span style="font-weight: bold;">AND MOST IMPORTANTLY... remember to have fun with eLua! :)</span><br>
|
|
</div>
|
|
</body></html>
|