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/

Dependents:   Pawn4Test

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)
Committer:
Lobo
Date:
Fri May 24 17:49:26 2013 +0000
Revision:
3:185fdbb7ccf0
Parent:
0:3ab1d2d14eb3
Now includes AnalogIn and AnalogOut functions

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tylerwilson 0:3ab1d2d14eb3 1 #ifndef AMXCONS_H_INCLUDED
tylerwilson 0:3ab1d2d14eb3 2 #define AMXCONS_H_INCLUDED
tylerwilson 0:3ab1d2d14eb3 3
tylerwilson 0:3ab1d2d14eb3 4 typedef struct tagFMTINFO {
tylerwilson 0:3ab1d2d14eb3 5 const cell *params;
tylerwilson 0:3ab1d2d14eb3 6 int numparams;
tylerwilson 0:3ab1d2d14eb3 7 int skip; /* number of characters to skip from the beginning */
tylerwilson 0:3ab1d2d14eb3 8 int length; /* number of characters to print */
tylerwilson 0:3ab1d2d14eb3 9 /* helper functions */
tylerwilson 0:3ab1d2d14eb3 10 int (*f_putstr)(void *dest,const TCHAR *);
tylerwilson 0:3ab1d2d14eb3 11 int (*f_putchar)(void *dest,TCHAR);
tylerwilson 0:3ab1d2d14eb3 12 void *user; /* user data */
tylerwilson 0:3ab1d2d14eb3 13 } AMX_FMTINFO;
tylerwilson 0:3ab1d2d14eb3 14
tylerwilson 0:3ab1d2d14eb3 15 int amx_printstring(AMX *amx,cell *cstr,AMX_FMTINFO *info);
tylerwilson 0:3ab1d2d14eb3 16
tylerwilson 0:3ab1d2d14eb3 17 #endif /* AMXCONS_H_INCLUDED */