Hello Matthias & all:

> Matthias Trute <mtr...@web.de> writes:
>> That makes sense. But appl_own.py as the filenname..... There should
>> be better ones. Or a more generic approach. I'm not a python expert,
>> but many python directories contain a file named __init__.py to do
>> something useful.
>
> Seems too "pythonic" for me :-)
> In fact, I would have preferred it to be appl_owns.frt with
> "$D5 constant CRC8PLY" lines, only that I am too lazy :-)
>

Thanks for the encouragement. I hope that my new attempt to patch
amforth-shell.py is better.

Patch: http://pastebin.com/ENbdSkj5

Usage:

Create a file in the application directory called appl_defs.frt:
Yes, a forth file :-)

\ example

0 constant false
-1 constant true
$d5 constant CRC8PLY
-1 constant CRC8MSB

Let's create the test.frt:

\ #error-on-output no

(
$d5 constant CRC8PLY
-1 constant CRC8MSB
)

CRC8PLY .
CRC8MSB .

$ make shell
AMFORTH_LIB=.:/home/enoch/avr/amforth/trunk/lib python 
/home/enoch/avr/amforth/trunk/tools/amforth-shell.py -p /dev/ttyUSB2
|I=appl_defs: example
|I=appl_defs: 4 loaded
|I=Entering amforth interactive interpreter
|I=getting MCU name..
|I=successfully loaded register definitions for at90can128
|I=getting filenames on the host
|I=  Reading .
|I=  Reading /home/enoch/avr/amforth/trunk/lib
(AT90CAN128)> #include test.frt
|D=#include test.frt
|I=getting filenames on the host
|I=  Reading .
|I=  Reading /home/enoch/avr/amforth/trunk/lib
|I=using test.frt from/home/enoch/private/project
**** /home/enoch/private/project
|I=getting MCU name..
|I=successfully loaded register definitions for at90can128
|F=/home/enoch/private/project/test.frt
|D|    1|\ #error-on-output no
|W|    2|
|C|    3|(
|C|    4|$d5 constant CRC8PLY
|C|    5|-1 constant CRC8MSB
|C|    6|)
|W|    7|
|S|    8|CRC8PLY .
|O|    8|213
|S|    9|CRC8MSB .
|O|    9|-1
|W|   10|
*

Regards, Enoch.





------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel

Reply via email to