Start Back Next End
  
ZBasic Language Reference
20
ZBasic Microcontrollers
Option CodeType
Option CodeType <code-type>
Default: C
This option, available only when compiling for native mode devices, specifies the type of intermediate
code to generate corresponding to the ZBasic application which is then converted to target processor
instructions by the back-end compiler.  The default is to generate C code but in some cases, it may be
useful to direct the ZBasic compiler to generate C++ code by specifying the <code-type> as C++ or CPP.
Example
Option CodeType C++
Option Arduino
Option Arduino ["<arduino-directory>"]
Default: off
This directive, available only when compiling for native mode devices, is used to specify that an
application is being built using code from the Arduino code base.  The optional <arduino-directory>
specifies a directory where the ZBasic-Arduino compatibility libraries and include files can be found.
The presence of this option has several effects.  Firstly, it directs the compiler to generate C++ code and
enables ZBasic object extensions.  Secondly, if the optional <arduino-directory> is given, that directory
and all of the sub-directories thereof will be searched for any needed header (.h) files and the ArdLib
sub-directory thereof will be expected to contain the pre-built ZBasic-Arduino compatibility library for the
target device, e.g. ArdLLib/libArdZB_mega328p.a.
See the ZBasic application note for more details on building applications incorporating Arduino code.
Example
Option Arduino "C:/projects/ZBasicArduino"
Option Notice
Option Notice {On | Off}
Default: on
This directive can be used to enable or disable output from the #notice directives.
Example
Option Notice Off
Option SerialReadStrobe
Option SerialReadStrobe "<pin-designator>"
Default: none
This directive, available only when compiling for native mode devices, specifies a pin to toggle just before
reading the first of nine bit window samples when the function SerialGetByte() is called.  When observed
with a logic analyzer or similar instrument, this is useful for confirming that the sample is being taken near
the middle of the start bit.  The pin, which you must configure as an output prior to invoking
SerialGetByte(), may be specified in the form <port>.<bit> or as a physical pin number as shown in the
two examples below.  This option is available on all ATxmega devices and those ATmega and ATtiny
devices that can toggle an output pin by writing a bit to the PINx register.
Examples
Option SerialReadStrobe A.2
' use pin A.2 for the strobe
Previous page Top Next page