ZBasic Language Reference
14
ZBasic Microcontrollers
Option DefaultISR {On | Off}
Default: see discussion
For native mode devices, this option can be used to control whether a "catch all" ISR is automatically
included in your application. By default, it is included for ZX devices and not included with generic target
devices. Note that this option has no effect if you explicitly define a default ISR in your application source
code.
Example
Option DefaultISR Off
Option CallFunctions {On | Off}
Default: Off
For native mode devices, this option can be used to allow your application code to invoke functions as if
they were subroutines (the returned value is discarded). Note that even when CallFunctions is enabled,
functions returning user-defined types like structures, unions and class objects are not allowed to be
called as if they were subroutines.
The presence of this option directive in a module affects only that module; the command line option --
call-functions can be used to affect multiple modules.
Example
Option CallFunctions On
Option TaskStackMargin <margin-value>
Default: 10
When the compiler compares the size of the stack allocated to a task to the estimated task stack usage it
pads the estimate with a safety margin. This option can be used to specify a value for that safety margin
different from the default of 10 bytes. The safety margin may be any non-negative decimal integral value.
Example
Option TaskStackMargin 20
Option ExtRamConfig [On | Off | <constant-expression>]
Default: (see text)
For ZBasic target devices that support external RAM, you may control whether external RAM is enabled
using this directive. Using the keyword On enables external RAM support in the default configuration (16-
bit address, no wait states). If you need a different configuration, you may specify a constant expression
whose 16-bit value is written to the external RAM configuration registers of the CPU. For ATmega-based
devices, the high byte is written to the register XMCRB register and the low byte is written to XMCRA
register. (Note that for the mega128 CPU, the high bit of the XMCRA register is undefined but the
configuration value must have that bit asserted in order for the external RAM interface to be enabled.)
For ATxmega-based target devices, the low byte is written to the EBI_CTRL register while the high byte is
written to the EBI_CS1_CTRLB register.
For ATmega-based device, the default external RAM configuration value is &H0080. For ATxmega-
based devices, the default external RAM configuration value is &H014d.
|