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)
amxpool.h
- Committer:
- Lobo
- Date:
- 2013-05-24
- Revision:
- 3:185fdbb7ccf0
- Parent:
- 0:3ab1d2d14eb3
File content as of revision 3:185fdbb7ccf0:
/* Simple allocation from a memory pool, with automatic release of * least-recently used blocks (LRU blocks). * * Copyright (c) ITB CompuPhase, 2007-2012 * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy * of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. * * Version: $Id: amxpool.h 4731 2012-06-21 11:11:18Z thiadmer $ */ #ifndef AMXPOOL_H_INCLUDED #define AMXPOOL_H_INCLUDED #ifdef __cplusplus extern "C" { #endif void amx_poolinit(void *pool, unsigned size); void *amx_poolalloc(unsigned size, int index); void amx_poolfree(void *block); void *amx_poolfind(int index); int amx_poolprotect(int index); #ifdef __cplusplus } #endif #endif /* AMXPOOL_H_INCLUDED */