1
0
mirror of https://github.com/elua/elua.git synced 2025-01-25 01:02:54 +08:00
elua/inc/validate.h
Bogdan Marinescu 4793225724 eLua now works over TCP/IP instead of serial connection. This is basically printf/scanf over TCP/IP instead of UART, so it should look&feel just like "regular" Lua, except that you don't have
ANSI terminal support (yet) and "recv" doesn't work anymore because XMODEM doesn't work over TCP/IP. Only for LM3S8962/LM3S6965 for now, but it should straightforward (not easy though)
to port it to other platforms. Only static IP for now. More TCP/IP functions need to be implemented (and an eLua module must be written to access them). To enable console over TCP:

- enable "BUILD_CON_TCP" in build.h, also disable "BUILD_XMODEM" and "BUILD_TERM" in build.h (you'll get an error if you don't)
- disable "BUILD_CON_GENERIC" in build.h (you'll get an error if you don't)
- edit your network settings in build.h
- build the image&burn it
- telnet to the address configured in build.h. Be sure to use a decent telnet client, like the one in Linux or putty. Don't try with telnet from Windows, as it surely won't work. Also, it might
  not work with the telnet client from Tera Term Pro (didn't test this).
- type 'exit' from shell to terminate the connection.

Also, note that from this point on you'll need a newer version of binutils to compile for Cortex. I'm using binutils-2.19.50.tar.bz2 (from the snapshots page). 2.18 might work too, but I didn't
test it.
2008-09-18 20:22:15 +00:00

35 lines
1.3 KiB
C

// Validate eLua configuration options
// Should be included in main.c, as this is the first file that's compiled, so
// any configuration errors are caught right at the beginning of the build
// process
#ifndef __VALIDATE_H__
#define __VALIDATE_H__
#include "build.h"
// Can't define more than one console devices
#if defined( BUILD_CON_TCP ) && defined( BUILD_CON_GENERIC )
#error "Can't have two console devices (don't enable BUILD_CON_TCP and BUILD_CON_GENERIC in build.h at the same time)"
#endif // #if defined( BUILD_CON_TCP ) && defined( BUILD_CON_GENERIC )
// For TCP console we need to enable TCP support
#ifdef BUILD_CON_TCP
#ifndef BUILD_UIP
#error "BUILD_CON_TCP requires BUILD_UIP to be defined in build.h"
#endif // #ifndef BUILD_UIP
#endif // #ifdef BUILD_CON_TCP
// If TCP console is enabled, we don't need xmodem or term
// (they can still function separately over UART, but this doesn't make sense)
#ifdef BUILD_CON_TCP
#ifdef BUILD_XMODEM
#error "XMODEM doesn't work with TCP console. Disable BUILD_XMODEM in build.h"
#endif // #ifdef BUILD_XMODME
#ifdef BUILD_TERM
#error "ANSI terminal support doesn't work (yet) with TCP console. Disable BUILD_TERM in build.h"
#endif // #ifdef BUILD_TERM
#endif // #ifdef BUILD_CON_TCP
#endif // #ifndef __VALIDATE_H__