<Config>
   <Tool Header="RCST7" Desc="ST7/STM8 Compiler" ExitFail="1" SourceFilter="*.c" TargetFilter="ST7" ConfigPath="ST7\RCST7.config" Help="Doc\ST7\RCSTM8">
      <![CDATA[$(Target.ToolSetST7.Areloc)    "$(RkitBin)\RCSTM8.EXE" $(CmdInput) QUIET GENERATEDEPFILE $(RCST7.LISTING.CODE) $(RCST7.OBJECT.SRC) $(RCST7.OBJECT.DEBUG) OJ("$(NodeC.Build.OutputFile)_") PR("$(NodeC.Build.ListingFile)") PIN("$(Directories.IncDir)") $(RCST7.Model.Model) $(RCST7.Model.Stack) DGC(data) $(RCST7.Model.LocalMemory) $(RCST7.Model.ModeAuto) O($(RCST7.OPTIM.OTLEVEL),$(RCST7.OPTIM.SPEEDSIZE)) $(RCST7.LISTING.LST) $(RCST7.Model.Stack) $(RCST7.LISTING.PREPRO) $(RCST7.CodeGen.INITSTAT) $(RCST7.CodeGen.UNSIGNEDCHAR) $(RCST7.CodeGen.SMALLOBJECT) $(RCST7.CodeGen.ENUMTYPE) $(RCST7.CodeGen.NODUP) $(RCST7.LISTING.INCLIST) $(RCST7.Defines.Defines) $(RCST7.Defines.More)]]>
      <![CDATA[$(Target.ToolSetST7.Areloc)    "$(RkitBin)\RCSTM8.EXE" $(CmdInput) QUIET GENERATEDEPFILE $(RCST7.LISTING.CODE) $(RCST7.OBJECT.SRC) $(RCST7.OBJECT.DEBUG) OJ("$(NodeC.Build.OutputFile)") PR("$(NodeC.Build.ListingFile)") PIN("$(Directories.IncDir)") $(RCST7.Model.Model) $(RCST7.Model.Stack) $(Target.ToolSetST7.ArelocInfo) DGC(data) $(RCST7.Model.LocalMemory) $(RCST7.Model.ModeAuto) O($(RCST7.OPTIM.OTLEVEL),$(RCST7.OPTIM.SPEEDSIZE)) $(RCST7.LISTING.LST) $(RCST7.Model.Stack) $(RCST7.LISTING.PREPRO) $(RCST7.CodeGen.INITSTAT) $(RCST7.CodeGen.UNSIGNEDCHAR) $(RCST7.CodeGen.SMALLOBJECT) $(RCST7.CodeGen.ENUMTYPE) $(RCST7.CodeGen.NODUP) $(RCST7.LISTING.INCLIST) $(RCST7.Defines.Defines) $(RCST7.Defines.More)]]>
      <![CDATA[$(Target.ToolSetST7.NotAreloc) "$(RkitBin)\RCSTM8.EXE" $(CmdInput) QUIET GENERATEDEPFILE $(RCST7.LISTING.CODE) $(RCST7.OBJECT.SRC) $(RCST7.OBJECT.DEBUG) OJ("$(NodeC.Build.OutputFile)") PR("$(NodeC.Build.ListingFile)") PIN("$(Directories.IncDir)") $(RCST7.Model.Model) $(RCST7.Model.Stack) $(Target.ToolSetST7.ArelocInfo) $(RCST7.Model.GlobalMemory) $(RCST7.Model.LocalMemory) $(RCST7.Model.ModeAuto) O($(RCST7.OPTIM.OTLEVEL),$(RCST7.OPTIM.SPEEDSIZE)) $(RCST7.LISTING.LST) $(RCST7.Model.Stack) $(RCST7.LISTING.PREPRO) $(RCST7.CodeGen.INITSTAT) $(RCST7.CodeGen.UNSIGNEDCHAR) $(RCST7.CodeGen.SMALLOBJECT) $(RCST7.CodeGen.ENUMTYPE) $(RCST7.CodeGen.NODUP) $(RCST7.LISTING.INCLIST) $(RCST7.Defines.Defines) $(RCST7.Defines.More)]]>
   </Tool>
   <Defs>
      <Set Header="RCST7" Desc="Compiler options" Comment="Specifies the Raisonance ST7/STM8 optimizing C compiler settings.">
         <Section Header="General" Hidden="1">
            <Property Header="OutExt" Type="PT_STRING" Value=".obj"/>
            <Property Header="ListExt" Type="PT_STRING" Value=".lst"/>
            <Property Header="InExt" Type="PT_STRING" Value="*.c"/>
         </Section>
         <Section Header="Model" Desc="Program model" Comment="Specifies the application configuration such as memory model and stack location.">
            <Property Header="Mode" Desc="Mode" Type="PT_STRING" Value="Vide" Hidden="1">
               <![CDATA[
                  {
                  var isstm8 = (Project.GetPropertyValue("RCST7", "Model", "Mode" ) == "stm8" );

                  if( isstm8 == 1)
                     {
                     var stm8_model = Project.GetPropertyValue("RCST7", "Model", "ModelP");
                     Project.SetPropertyValue("RCST7","Model", "Model", stm8_model);         // Write the actual STM8 config

                     Project.HideProperty("RCST7", "Model", "ModelP", 0);

                     Project.SetPropertyValue("RCST7", "Model", "Stack", "");                // Stack0 is forbidden on STM8
                     Project.HideProperty(    "RCST7", "Model", "Stack", 1 );

                     Project.SetPropertyValue("RCST7", "Model", "LocalMemory", "");          // DLC option is disabled
                     Project.HideProperty(    "RCST7", "Model", "LocalMemory", 1);

                     Project.SetPropertyValue("RCST7", "Model", "ModeAuto", "");             // STM8 supports only implicit MODE_AUTO
                     Project.HideProperty(    "RCST7", "Model", "ModeAuto", 1);
                     }
                  else  // ST7
                     {
                     Project.SetPropertyValue("Target","ProcessorST7","IsSTM8", "");         // See RLST7.config
                     Project.SetPropertyValue("RCST7","Model", "Model", "");                 // Force ST7 model
                     Project.HideProperty("RCST7", "Model", "ModelP", 1);
                     Project.HideProperty("RCST7", "Model", "Stack", 0 );
                     Project.HideProperty("RCST7", "Model", "LocalMemory", 0);
                     Project.HideProperty("RCST7", "Model", "ModeAuto", 0);
                     }
                  }
               ]]>
            </Property>
            <Property Header="Model" Desc="Model" Type="PT_CHOICE" Default="" Comment="Defines the microcontroller instruction set (ST7/STM8) and memory model. 'STM8 Large ROM' will generate far CALL/RET patterns and should be used only for programs larger than 64KB of code.\nNote that this option is available for STM8 derivatives only." Hidden="1">
               <Enum Header="ST7 Standard" Value=""/>
               <Enum Header="STM8 Small ROM" Value="STM8(SMALL)"/>
               <Enum Header="STM8 Large ROM" Value="STM8(LARGE)"/>
            </Property>
            <Property Header="ModelP" Desc="Model" Type="PT_CHOICE" Default="STM8(SMALL)" Comment="Defines STM8 memory model. 'STM8 Large ROM' will generate far CALL/RET patterns and should be used only for programs larger than 64KB of code." Hidden="1">
               <Enum Header="STM8 Small ROM" Value="STM8(SMALL)"/>
               <Enum Header="STM8 Large ROM" Value="STM8(LARGE)"/>
               <![CDATA[
                  {
                  var stm8_model = Project.GetPropertyValue("RCST7", "Model", "ModelP");
                  var stm8_currentmodel = Project.GetPropertyValue("RCST7", "Model", "Model");

                  // Do not update the Model if it is already accurate
                  if(stm8_model != stm8_currentmodel)
                     {
                     Project.SetPropertyValue("RCST7", "Model", "Model", stm8_model);
                     }
                  }
               ]]>
            </Property>
            <Property Header="Stack" Desc="Stack in zero page" Type="PT_CHOICE" Default="" Comment="Specifies whether the hardware stack is located in the zero page [0-FFh]." ReadOnly="1">
               <Enum Header="Yes" Value="STACK0"/>
               <Enum Header="No" Value=""/>
            </Property>
            <Property Header="GlobalMemory" Desc="Default global memory class" Type="PT_CHOICE" Default="" Comment="Specifies the default memory space for global variables.">
               <Enum Header="Page0" Value=""/>
               <Enum Header="Data" Value="DGC(DATA)"/>
            </Property>
            <Property Header="LocalMemory" Desc="Default local memory class" Type="PT_CHOICE" Default="" Comment="Specifies the default memory space for local variables and function parameters.">
               <Enum Header="Page0" Value=""/>
               <Enum Header="Data" Value="DLC(DATA)"/>
            </Property>
            <Property Header="ModeAuto" Desc="All functions are reentrant" Type="PT_CHOICE" Default="" Comment="Makes all functions reentrant (AUTO = put local variables on the stack). The code generated is less optimal.">
               <Enum Header="Yes" Value="AUTO"/>
               <Enum Header="No" Value=""/>
            </Property>
         </Section>
         <Section Header="CodeGen" Desc="Code generation" Comment="Defines code generation options.">
            <Property Header="INITSTAT" Desc="Initialize static variables to 0" Type="PT_CHOICE" Default="" Comment="Initializes (to 0) all global variables that are not specifically initialized. ANSI specifications require this setting.">
               <Enum Header="Yes" Value="INITSTATICVAR"/>
               <Enum Header="No" Value=""/>
            </Property>
            <Property Header="UNSIGNEDCHAR" Desc="Default type for 'char'" Type="PT_CHOICE" Default="" Comment="Considers the 'char' variables either as signed or unsigned by default.">
               <Enum Header="Unsigned" Value=""/>
               <Enum Header="Signed" Value="SIGNEDCHAR"/>
            </Property>
            <Property Header="SMALLOBJECT" Desc="Only small objects" Type="PT_CHOICE" Default="SMALLOBJECT" Comment="Tells the compiler that all objects are smaller than 256 bytes. Enables optimized indexed addressing modes.">
               <Enum Header="Yes" Value="SMALLOBJECT"/>
               <Enum Header="No" Value=""/>
            </Property>
            <Property Header="ENUMTYPE" Desc="Type for small enum variables" Type="PT_CHOICE" Default="" Comment="When enums use only values less than 256, they can be optimized as 'char' instead of 'int'. ANSI specifications require this setting.">
               <Enum Header="char" Value="ET(CHAR)"/>
               <Enum Header="int" Value="ET(INT)"/>
            </Property>
            <Property Header="NODUP" Desc="Aggregate identical strings" Type="PT_CHOICE" Default="" Comment="Stores duplicated strings as a single object (DUPLICATESTRING).">
               <Enum Header="Yes" Value=""/>
               <Enum Header="No" Value="NODUPLICATESTRING"/>
            </Property>
         </Section>
         <Section Header="OPTIM" Desc="Optimization" Comment="Sets the optimization level options for the code generation.">
            <Property Header="SPEEDSIZE" Desc="Optimization preference" Type="PT_CHOICE" Default="SIZE" Comment="Compiler can produce optimized code regarding either program size, or program execution speed.">
               <Enum Header="Size" Value="SIZE"/>
               <Enum Header="Speed" Value="SPEED"/>
            </Property>
            <Property Header="OTLEVEL" Desc="Optimization level" Type="PT_CHOICE" Default="3" Comment="Different -and nested- optimisation levels are available:\n 0: No Optimization \n 1: Dead code is removed, conditional jump optimization.\n     Overlayable segments are identified for the linker.\n     Complex moves are optimized.\n     'switch' instructions are optimized, local sub-expression.\n     Global sub-expressions, loop optimization\n 2: Loop modification\n 3: Advanced peephole optimization">
               <Enum Header="0" Value="0"/>
               <Enum Header="1" Value="1"/>
               <Enum Header="2" Value="2"/>
               <Enum Header="3" Value="3"/>
            </Property>
         </Section>
         <Section Header="OBJECT" Desc="Compiler output" Comment="Sets the compiler output format.">
            <Property Header="SRC" Desc="Output format" Type="PT_CHOICE" Default="" Comment="Generates either a source file (.src) that can be assembled, or a linkable object file.">
               <Enum Header="src" Value="SRC"/>
               <Enum Header="obj" Value=""/>
            </Property>
            <Property Header="DEBUG" Desc="Debugging information" Type="PT_CHOICE" Default="DB" Comment="Tells the compiler to generate the debugging information in the object file.">
               <Enum Header="Debug" Value="DB"/>
               <Enum Header="No Debug" Value="NODEBUG"/>
            </Property>
         </Section>
         <Section Header="LISTING" Desc="Listing" Comment="Sets listing file options.">
            <Property Header="LST" Desc="Generate a listing file" Type="PT_CHOICE" Default="" Comment="Generates a listing file or not.">
               <Enum Header="Yes" Value=""/>
               <Enum Header="No" Value="NOPRINT"/>
            </Property>
            <Property Header="CODE" Desc="Append assembly mnemonics" Type="PT_CHOICE" Default="CODE" Comment="Includes the assembler translation of each source file in the listing.">
               <Enum Header="Yes" Value="CODE"/>
               <Enum Header="No" Value=""/>
            </Property>
            <Property Header="INCLIST" Desc="Insert contents of included files" Type="PT_CHOICE" Default="" Comment="Specifies whether the content of included files must be added to the listing file.">
               <Enum Header="Yes" Value="LISTINCLUDE"/>
               <Enum Header="No" Value=""/>
            </Property>
            <Property Header="PREPRO" Desc="Create a preprocessed source" Type="PT_CHOICE" Default="" Comment="Generates a preprocessor listing file (with file extension '.i').">
               <Enum Header="Yes" Value="PREPRINT"/>
               <Enum Header="No" Value=""/>
            </Property>
         </Section>
         <Section Header="Defines" Desc="Additional options" Comment="Defines user-defined preprocessor macros or specific command-line options.">
            <Property Header="Defines" Desc="Defines" Type="PT_EDITLIST" Default="" Pattern="DF(%s) " Comment="Specifies user-defined preprocessor macros. Each macro has the form 'symbol=value'. Symbols are set to 1 if the value is omitted. You can specify up to 60 definitions of 512 characters each."/>
            <Property Header="More" Desc="More options" Type="PT_STRING" Default="" Pattern=" %s " Comment="Specifies additional options to be added on the ST7/STM8 compiler command line."/>
         </Section>
      </Set>
   </Defs>
</Config>
