You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/03/21 15:31:21 UTC
[GitHub] [incubator-nuttx] mogenson opened a new pull request #5815: defconfig: add Lua configs for sim and teensy-4.x
mogenson opened a new pull request #5815:
URL: https://github.com/apache/incubator-nuttx/pull/5815
## Summary
Add defconfigs for `sim:lua` and `teensy-4.x:lua-4.1` to use the newly added [Lua interpreter](https://github.com/apache/incubator-nuttx-apps/pull/1075).
## Impact
Used to verify the Lua interpreter build in CI.
## Testing
The `sim:lua` config can be used to verify the example Lua C module:
```
NuttShell (NSH) NuttX-10.2.0
nsh> lua
Lua 5.4.0 Copyright (C) 1994-2020 Lua.org, PUC-Rio
> hello.say_hello()
Hello World!
nsh>
```
The `teensy-4.x:lua-4.1` can be used to run a Lua script from the board's microsd card. The following Lua script blinks the onboard LED using the userled driver:
```lua
-- concatenate strings and print to NSH console
print("hello from " .. _VERSION)
-- open device driver, file is closed when leds is garbage collected
leds = io.open("/dev/userleds", "wb")
-- from 1 to 10, inclusive
for i = 1, 10 do -- lua convention is to start at 1
-- pack value into uint32_t and write to file
leds:write(string.pack("I", i % 2))
leds:flush()
-- run sleep command from NSH
os.execute("sleep 1")
end
```
```
NuttShell (NSH) NuttX-10.2.0
nsh> mount -t vfat /dev/mmcsd0 /mnt
nsh> lua /mnt/main.lua
hello from Lua 5.4
nsh>
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #5815: defconfig: add Lua configs for sim and teensy-4.x
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #5815:
URL: https://github.com/apache/incubator-nuttx/pull/5815
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #5815: defconfig: add Lua configs for sim and teensy-4.x
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #5815:
URL: https://github.com/apache/incubator-nuttx/pull/5815#issuecomment-1074662626
@mogenson look like awk in CI machine is different from yours:
```
awk: syntax error at source line 1
context is
{ if >>> (match($0,/LUA_[A-Z]+LIBNAME\s"([a-z]+)"$/, <<<
awk: illegal statement at source line 1
awk: illegal statement at source line 1
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #5815: defconfig: add Lua configs for sim and teensy-4.x
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #5815:
URL: https://github.com/apache/incubator-nuttx/pull/5815#issuecomment-1076696502
@mogenson could you rebase and push again your patch to enforce CI fetch the new code base? it look like that CI still use the stale content.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] mogenson commented on pull request #5815: defconfig: add Lua configs for sim and teensy-4.x
Posted by GitBox <gi...@apache.org>.
mogenson commented on pull request #5815:
URL: https://github.com/apache/incubator-nuttx/pull/5815#issuecomment-1075735554
Looks like the MacOS build has the BSD flavor of awk instead of GNU awk:
```
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
```
I'm also on a Mac, but have GNU awk installed. I guess we probably can't rely on a user having GNU awk installed. I'll look into a new script that doesn't rely on GNU awk features, or come up with an alternate pipeline of sed/cut/other Unix utilities.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org