Overview
- Object ID : 4926 (2025-02-03 22:08:31)
- Author : Chip Gracey
- Content : Code
- Microcontroller : Propeller 2
- Languages : PASM2, SPIN2
- Category : Tool
- Licence : MIT
- Tags : p2, Parallax, Pasm2
Content
Latest PNut Documentation:
https://docs.google.com/document/d/16qVkmA6Co5fUNKJHF6pBfGfDupuRwDtf-wyieh_fbqw/edit
Propeller 2 Silicon Documentation:
https://docs.google.com/document/d/1gn6oaT5Ib7CytvlZHacmrSbVBJsD9t_-kmvjd7nUR6o/edit?usp=sharing
Propeller 2 Assembly Language Instructions:
https://docs.google.com/spreadsheets/d/1_vJk-Ad569UMwgXTKTdfJkHYHpc1rZwxB-DcIiAZNdk/edit?usp=sharing
General Propeller 2 Documentation:
https://www.parallax.com/propeller-2/documentation/
PNut GitHub Repository (not yet updated):
https://github.com/parallaxinc/P2_PNut_Public
PNut_v49 adds access to child-object data structures (CON STRUCT's). You can use them anywhere you'd use local-object STRUCT's and you can export them upwards by using "CON STRUCT name = object,structure" syntax.
PNut_v49p1 contains new DEBUG PLOT commands allowing up to 8 bitmap layers that you can selectively copy into the PLOT window. This is useful for doing photo-realistic displays, where pre-drawn images are copied into the plot window to show, say, a toggle switch being in an ON or OFF position.
CON STRUCT StructX(Object.StructA x[10]) 'StructX is ten StructA's, exported
CON STRUCT StructY = Object.StructA 'StructY is a copy of StructA, exported
VAR Object.StructA StructJ 'StructJ is an instance of StructA
VAR ^Object.StructA StructK 'StructK is a pointer to StructA
PUB Name(^Object.StructA StructL) 'StructL is a pointer to StructA
DAT StructM Object.StructA 'StructM is an instance of StructA
Also, a bug was fixed in the anti-alias line-draw routine used by the DEBUG display windows. This bug began in v44 and caused lines with slope near 1 to draw as right-angle lines.
PNut_v48 added a preprocessor to Spin2.
From the command line, global preprocessor symbols can be (-D)efined. All source files in the compilation can check these symbols:
PNut_v48 filename -D pig -D egg
Within each source file, the global symbols can be checked, undefined, or defined again:
#DEFINE symbol 'define a symbol
#UNDEF symbol 'undefine a symbol
#IFDEF symbol 'begin a new scope if symbol is defined
#IFNDEF symbol 'begin a new scope if symbol is undefined
#ELSEIFDEF symbol 'begin an else block if symbol is defined
#ELSEIFNDEF symbol 'begin an else block if symbol is undefined
#ELSE 'begin an else block
#ENDIF 'end scope and revert to any outer scope
Also, a new command-line switch "-ci" compiles and saves the flash image