This is the open source Pawn interpreter ported to mbed. See here: http://www.compuphase.com/pawn/pawn.htm and here: http://code.google.com/p/pawnscript/
Some instructions:
- Put the attached include folder next to your source, so when you compile you get all the proper definitions
- Use the attached main.p as a starting point if you wish
- Compile your main.p into main.amx - Put your main.amx on the mbed 'drive'
- Reset and be amazed.
Important Compile Notes:
- You should use the -S# option to define a smaller default stack size. Start with -S64 and go up from there if needed.
- To use on the Cortex-M0 version of the mbed (LPC11U24), you MUST include the TARGET=3 command-line option as well, so the pin names are properly defined. In the future this may be handled on the native code side.
Known Issues:
At the moment it appears the kbhit() function is not working right - at least on my mac. Will continue testing on Windows.Working fine.
Todo:
- Add more wrappers for the mbed peripherals
- Add Pawn overlay support, to allow much larger scripts to run (even on the LPC11U24)
Diff: osdefs.h
- Revision:
- 2:01588bd27169
- Parent:
- 1:cc719e522b5d
--- a/osdefs.h Wed May 22 12:20:59 2013 +0000 +++ b/osdefs.h Wed May 22 16:30:01 2013 +0000 @@ -48,14 +48,17 @@ #endif #if defined(TARGET_LPC1768) || defined(TARGET_LPC2368) || defined(TARGET_LPC11U24) + // no Unicode support, so force only ANSI #define AMX_ANSIONLY 1 + // No dynamically loaded module #define AMX_NODYNALOAD 1 + // use the simplest Console I/O type - serial terminal #define AMX_TERMINAL 1 + // If we get the core VM working with RVDS assember, this will speed things up // #define AMX_ASM 1 - -// #define TCHAR char -// #define __T(x) (x) - #define stime(x) (x) + // for the amxtime module. On Linux, stime is the standard set time call. On mbed, + // it is set_time. Fortunately, they both take the same param - seconds since 01/01/70 + #define stime(x) set_time(x) #endif #if (defined __linux || defined __linux__) && !defined __LINUX__