Shop OBEX P1 Docs P2 Docs Learn Events
PropBASIC - Trouble with compiler directives. — Parallax Forums

PropBASIC - Trouble with compiler directives.

simonlsimonl Posts: 866
edited 2010-04-17 23:48 in Propeller 1
OK, it's the first time I've tried to use PropBASIC's compiler directives and they're not working for me :-( Here's what I've got:
' ----------------------------------------------------------------------
' Conditional Compilation Symbols
' ----------------------------------------------------------------------
'{$DEF TenMHz}                                     ' REMOVE if using 5MHz XTAL

' ----------------------------------------------------------------------
' Device Settings
' ----------------------------------------------------------------------
'{$IFDEF TenMHz}
DEVICE          P8X32A, XTAL2, PLL8X
XIN             10_000_000
'{$ELSE}
DEVICE          P8X32A, XTAL1, PLL16X
XIN             5_000_000
'{$ENDIF}




I'm expecting the compiled code to output:
  _ClkMode = XTAL2 + PLL8X
  _XInFreq = 10000000



but it's output is:
  _ClkMode = XTAL1 + PLL16X
  _XInFreq = 5000000



What have I missed?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon

www.norfolkhelicopterclub.com

Announcement: To cut costs in the current economic climate, we have switched-off the light at the end of the tunnel.

Comments

  • JonnyMacJonnyMac Posts: 9,208
    edited 2010-04-17 23:28
    The correct directive is {$DEFINE} (you have {$DEF}).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon McPhalen
    Hollywood, CA
  • simonlsimonl Posts: 866
    edited 2010-04-17 23:38
    Ah, thanks Jon.

    I got the DEF from the "PropBASIC 00.00.80 Feb 11, 2010" manual (http://forums.parallax.com/attachment.php?attachmentid=0) - I guess that must be out-of-date, considering I'm using the latest version of PropBASIC (00.00.92)!

    Thanks again - that works great now smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheers,
    Simon

    www.norfolkhelicopterclub.com

    Announcement: To cut costs in the current economic climate, we have switched-off the light at the end of the tunnel.
  • JonnyMacJonnyMac Posts: 9,208
    edited 2010-04-17 23:48
    Oh... that's WAY out-of-date -- the attached doc has it correct.· Bean and I have been very busy and not able to finish, but we will, shortly, as soon as we both clear some big projects from our desks.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon McPhalen
    Hollywood, CA
Sign In or Register to comment.