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@0:3ab1d2d14eb3, 2012-11-15 (annotated)
- Committer:
- tylerwilson
- Date:
- Thu Nov 15 17:41:21 2012 +0000
- Revision:
- 0:3ab1d2d14eb3
Initial Pawn 4.x interpreter for mbed check-in
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tylerwilson | 0:3ab1d2d14eb3 | 1 | /* Simple allocation from a memory pool, with automatic release of |
tylerwilson | 0:3ab1d2d14eb3 | 2 | * least-recently used blocks (LRU blocks). |
tylerwilson | 0:3ab1d2d14eb3 | 3 | * |
tylerwilson | 0:3ab1d2d14eb3 | 4 | * Copyright (c) ITB CompuPhase, 2007-2012 |
tylerwilson | 0:3ab1d2d14eb3 | 5 | * |
tylerwilson | 0:3ab1d2d14eb3 | 6 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not |
tylerwilson | 0:3ab1d2d14eb3 | 7 | * use this file except in compliance with the License. You may obtain a copy |
tylerwilson | 0:3ab1d2d14eb3 | 8 | * of the License at |
tylerwilson | 0:3ab1d2d14eb3 | 9 | * |
tylerwilson | 0:3ab1d2d14eb3 | 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
tylerwilson | 0:3ab1d2d14eb3 | 11 | * |
tylerwilson | 0:3ab1d2d14eb3 | 12 | * Unless required by applicable law or agreed to in writing, software |
tylerwilson | 0:3ab1d2d14eb3 | 13 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
tylerwilson | 0:3ab1d2d14eb3 | 14 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
tylerwilson | 0:3ab1d2d14eb3 | 15 | * License for the specific language governing permissions and limitations |
tylerwilson | 0:3ab1d2d14eb3 | 16 | * under the License. |
tylerwilson | 0:3ab1d2d14eb3 | 17 | * |
tylerwilson | 0:3ab1d2d14eb3 | 18 | * Version: $Id: amxpool.h 4731 2012-06-21 11:11:18Z thiadmer $ |
tylerwilson | 0:3ab1d2d14eb3 | 19 | */ |
tylerwilson | 0:3ab1d2d14eb3 | 20 | #ifndef AMXPOOL_H_INCLUDED |
tylerwilson | 0:3ab1d2d14eb3 | 21 | #define AMXPOOL_H_INCLUDED |
tylerwilson | 0:3ab1d2d14eb3 | 22 | |
tylerwilson | 0:3ab1d2d14eb3 | 23 | #ifdef __cplusplus |
tylerwilson | 0:3ab1d2d14eb3 | 24 | extern "C" { |
tylerwilson | 0:3ab1d2d14eb3 | 25 | #endif |
tylerwilson | 0:3ab1d2d14eb3 | 26 | |
tylerwilson | 0:3ab1d2d14eb3 | 27 | void amx_poolinit(void *pool, unsigned size); |
tylerwilson | 0:3ab1d2d14eb3 | 28 | void *amx_poolalloc(unsigned size, int index); |
tylerwilson | 0:3ab1d2d14eb3 | 29 | void amx_poolfree(void *block); |
tylerwilson | 0:3ab1d2d14eb3 | 30 | void *amx_poolfind(int index); |
tylerwilson | 0:3ab1d2d14eb3 | 31 | int amx_poolprotect(int index); |
tylerwilson | 0:3ab1d2d14eb3 | 32 | |
tylerwilson | 0:3ab1d2d14eb3 | 33 | #ifdef __cplusplus |
tylerwilson | 0:3ab1d2d14eb3 | 34 | } |
tylerwilson | 0:3ab1d2d14eb3 | 35 | #endif |
tylerwilson | 0:3ab1d2d14eb3 | 36 | |
tylerwilson | 0:3ab1d2d14eb3 | 37 | #endif /* AMXPOOL_H_INCLUDED */ |