void Generate_RunTimeEnvironment_Source_File_FREERTOS()
        {
            RteOsInterfaceGenerator osGenerator = new RteFreeRtosGenerator();

            String       FileName = RteFunctionsGenerator.GetRteFolder() + "\\" + Properties.Resources.RTE_RUNTIME_ENVIRONMENT_C_FILENAME;
            StreamWriter writer   = new StreamWriter(FileName);

            RteFunctionsGenerator.GenerateFileTitle(writer, FileName, Properties.Resources.RTE_RUNTIME_ENVIRONMENT_FILE_DESCRIPTION);
            RteFunctionsGenerator.OpenGuardDefine(writer);

            writer.WriteLine();
            RteFunctionsGenerator.AddInclude(writer, Properties.Resources.RTE_RUNTIME_ENVIRONMENT_H_FILENAME);
            writer.WriteLine();

            writer.WriteLine("/* Scheduler variables  */");

            foreach (OsTask osTask in AutosarApplication.GetInstance().OsTasks)
            {
                List <double> frequences        = PeriodChangeTimes(osTask);
                List <String> freqVariableNames = new List <string>();

                for (int i = 0; i < frequences.Count; i++)
                {
                    String freqName = osTask.Name + "_" + RteFunctionsGenerator.CreateFrequencyDefineName(frequences[i]) + "_" + i.ToString();
                    freqVariableNames.Add(freqName);
                    String variableDeclaration = RteFunctionsGenerator.GenerateVariable(freqName, "uint32", true, 0, "0");
                    writer.WriteLine(variableDeclaration);
                }
                writer.WriteLine();
            }

            /* Declare variables for scheduling */
            WriteAllTasksVariables(writer, osGenerator);

            WriteAllExternComponentInstances(writer);
            /* End declare variables */

            WriteAllOsTasks_FREERTOS(writer, osGenerator);

            WriteInitOsTasks(writer, osGenerator);

            writer.WriteLine();
            RteFunctionsGenerator.CloseGuardDefine(writer);

            writer.WriteLine();
            RteFunctionsGenerator.WriteEndOfFile(writer);
            writer.Close();
        }