FriedV
10-12-2011, 11:40 AM
Trying to compile:
' ----------------------------------------------------------------------
' File...... Std.lib
' Author.... fgvissel 10.10.2011
' Library Std, Delay Subs & idx vars
' ================================================== ====================
' ----- External Libs --------------------------------------------------
' ----- Conditional Compilation Symbols --------------------------------
' ----- Constants ------------------------------------------------------
' ----- IO Pins --------------------------------------------------------
' ----- Shared (HUB) Variables (Byte, Word, Long) ----------------------
' ----- User Data (DATA, WDATA, LDATA, FILE) ---------------------------
' ----- TASK Definitions -----------------------------------------------
' ----- Local Variables (LONG only) ------------------------------------
error var long = 0 'for error signaling, 0 = no error
tmp1 var long 'those are temp vars for temporary use
tmp2 var long 'mind they are global
tmp3 var long
tmp4 var long
tmp5 var long
' tmp6 var long 'more when needed
' tmp7 var long
' tmp8 var long
' tmp9 var long
' ----- SUB and FUNC Definitions ---------------------------------------
DelayMS SUB 1
DelayUS SUB 1
'{$CODE}
' ----- SUB and FUNC Code ----------------------------------------------
SUB DelayMS
pause __param1
ENDSUB
SUB DelayUS
pauseus __param1
ENDSUB
'================================================= ======================and
' ----------------------------------------------------------------------
' File...... Test_SPI_Task.pbas
' Author.... fgvissel 12.10.2011
' ================================================== ====================
' ----- Device Settings ------------------------------------------------
DEVICE P8X32A, XTAL1, PLL16X
XIN 6_250_000
' ----- External Libs --------------------------------------------------
'{$ifndef StdLib}
'{$define StdLib}
LOAD "C:\work\propeller\propbasic\library\Std.Lib"
'{$endif}
' ----- Conditional Compilation Symbols --------------------------------
' ----- Constants ------------------------------------------------------
Dog_Init CON 10
Dog_OutChar CON 11
Dog_OutString CON 12
Dog_Clear CON 13
Dog_Line1 CON 14
Dog_Line2 CON 15
Dog_Line3 CON 16
Dog_ClearLine1 CON 17
Dog_ClearLine2 CON 18
Dog_ClearLine3 CON 19
Dog_Set CON 20
' ----- IO Pins --------------------------------------------------------
ERR_LED Pin 1 low
OK_LED Pin 0 low
' ----- Shared (HUB) Variables (Byte, Word, Long) ----------------------
Cmd hub long = 0 'for command handler
' ----- User Data (DATA, WDATA, LDATA, FILE) ---------------------------
' ----- TASK Definitions -----------------------------------------------
SPI_Task TASK
' ----- Local Variables (LONG only) ------------------------------------
SPI_Cog var long
' ----- SUB and FUNC Definitions ---------------------------------------
' ================================================== ====================
PROGRAM Start
Start:
cogstart SPI_Task, SPI_Cog
if SPI_Cog = 8 then
error = 1
endif
Main:
'###### The End ################################################## ######
tmp1 = _FREQ /10 'the loop of life ....
tmp2 = cnt + tmp1
If error <> 0 then 'finish with error
do
toggle ERR_LED
waitcnt tmp2, tmp1
loop
else 'finish ok
do
toggle OK_LED
waitcnt tmp2, tmp1
loop
endif
'################################################# ####################
END
' ----- SUB and FUNC Code ----------------------------------------------
' ----- TASK Code ------------------------------------------------------
TASK SPI_Task 'handles SPI commands for DogM163 and uM-FPU
' ~~~~~ External Libs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LOAD "C:\work\propeller\propbasic\library\Std.Lib"
' ~~~~~ Conditional Compilation Symbols ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' ~~~~~ Constants ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~
' ~~~~~ IO Pins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
TASKLED pin 7 low
' ~~~~~ Shared (HUB) Variables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' ~~~~~ User Data (DATA, WDATA, LDATA, FILE) ~~~~~~~~~~~~~~~~~~~~~~~~~~~
' ~~~~~ Local Variables (LONG only) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' ~~~~~ SUB and FUNC Definitions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' ~~~~~ Task Code ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~
tmp1 = _FREQ /5 'slow blink forever
tmp2 = cnt + tmp1
do
toggle TASKLED
waitcnt tmp2, tmp1
loop
' ~~~~~ Task SUBs and FUNCs Code ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ENDTASK
' ----------------------------------------------------------------------
PropBasic compiles OK, Spin doesn't:
---------- HomeSpun To RAM ----------
Homespun Spin Compiler 0.31d
parsing C:\Work\Propeller\PropBasic\Programs\Test_SPI_Task _LIB.spin
parsing C:\Work\Propeller\PropBasic\Programs\SPI_Task.spin
compiling Test_SPI_Task_LIB.spin
Error: C:\Work\Propeller\PropBasic\Programs\Test_SPI_Task _LIB.spin (119, 46): Unknown symbol VP_Watch
SPI_Task_COG:=SPI_Task.Init(@__DataStart, @VP_Watch)
^
Is this a bug?
Kind regards, Friedrich
' ----------------------------------------------------------------------
' File...... Std.lib
' Author.... fgvissel 10.10.2011
' Library Std, Delay Subs & idx vars
' ================================================== ====================
' ----- External Libs --------------------------------------------------
' ----- Conditional Compilation Symbols --------------------------------
' ----- Constants ------------------------------------------------------
' ----- IO Pins --------------------------------------------------------
' ----- Shared (HUB) Variables (Byte, Word, Long) ----------------------
' ----- User Data (DATA, WDATA, LDATA, FILE) ---------------------------
' ----- TASK Definitions -----------------------------------------------
' ----- Local Variables (LONG only) ------------------------------------
error var long = 0 'for error signaling, 0 = no error
tmp1 var long 'those are temp vars for temporary use
tmp2 var long 'mind they are global
tmp3 var long
tmp4 var long
tmp5 var long
' tmp6 var long 'more when needed
' tmp7 var long
' tmp8 var long
' tmp9 var long
' ----- SUB and FUNC Definitions ---------------------------------------
DelayMS SUB 1
DelayUS SUB 1
'{$CODE}
' ----- SUB and FUNC Code ----------------------------------------------
SUB DelayMS
pause __param1
ENDSUB
SUB DelayUS
pauseus __param1
ENDSUB
'================================================= ======================and
' ----------------------------------------------------------------------
' File...... Test_SPI_Task.pbas
' Author.... fgvissel 12.10.2011
' ================================================== ====================
' ----- Device Settings ------------------------------------------------
DEVICE P8X32A, XTAL1, PLL16X
XIN 6_250_000
' ----- External Libs --------------------------------------------------
'{$ifndef StdLib}
'{$define StdLib}
LOAD "C:\work\propeller\propbasic\library\Std.Lib"
'{$endif}
' ----- Conditional Compilation Symbols --------------------------------
' ----- Constants ------------------------------------------------------
Dog_Init CON 10
Dog_OutChar CON 11
Dog_OutString CON 12
Dog_Clear CON 13
Dog_Line1 CON 14
Dog_Line2 CON 15
Dog_Line3 CON 16
Dog_ClearLine1 CON 17
Dog_ClearLine2 CON 18
Dog_ClearLine3 CON 19
Dog_Set CON 20
' ----- IO Pins --------------------------------------------------------
ERR_LED Pin 1 low
OK_LED Pin 0 low
' ----- Shared (HUB) Variables (Byte, Word, Long) ----------------------
Cmd hub long = 0 'for command handler
' ----- User Data (DATA, WDATA, LDATA, FILE) ---------------------------
' ----- TASK Definitions -----------------------------------------------
SPI_Task TASK
' ----- Local Variables (LONG only) ------------------------------------
SPI_Cog var long
' ----- SUB and FUNC Definitions ---------------------------------------
' ================================================== ====================
PROGRAM Start
Start:
cogstart SPI_Task, SPI_Cog
if SPI_Cog = 8 then
error = 1
endif
Main:
'###### The End ################################################## ######
tmp1 = _FREQ /10 'the loop of life ....
tmp2 = cnt + tmp1
If error <> 0 then 'finish with error
do
toggle ERR_LED
waitcnt tmp2, tmp1
loop
else 'finish ok
do
toggle OK_LED
waitcnt tmp2, tmp1
loop
endif
'################################################# ####################
END
' ----- SUB and FUNC Code ----------------------------------------------
' ----- TASK Code ------------------------------------------------------
TASK SPI_Task 'handles SPI commands for DogM163 and uM-FPU
' ~~~~~ External Libs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LOAD "C:\work\propeller\propbasic\library\Std.Lib"
' ~~~~~ Conditional Compilation Symbols ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' ~~~~~ Constants ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~
' ~~~~~ IO Pins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
TASKLED pin 7 low
' ~~~~~ Shared (HUB) Variables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' ~~~~~ User Data (DATA, WDATA, LDATA, FILE) ~~~~~~~~~~~~~~~~~~~~~~~~~~~
' ~~~~~ Local Variables (LONG only) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' ~~~~~ SUB and FUNC Definitions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' ~~~~~ Task Code ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~
tmp1 = _FREQ /5 'slow blink forever
tmp2 = cnt + tmp1
do
toggle TASKLED
waitcnt tmp2, tmp1
loop
' ~~~~~ Task SUBs and FUNCs Code ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ENDTASK
' ----------------------------------------------------------------------
PropBasic compiles OK, Spin doesn't:
---------- HomeSpun To RAM ----------
Homespun Spin Compiler 0.31d
parsing C:\Work\Propeller\PropBasic\Programs\Test_SPI_Task _LIB.spin
parsing C:\Work\Propeller\PropBasic\Programs\SPI_Task.spin
compiling Test_SPI_Task_LIB.spin
Error: C:\Work\Propeller\PropBasic\Programs\Test_SPI_Task _LIB.spin (119, 46): Unknown symbol VP_Watch
SPI_Task_COG:=SPI_Task.Init(@__DataStart, @VP_Watch)
^
Is this a bug?
Kind regards, Friedrich