Ejemplo n.º 1
0
        public ESPxxOpenOCDSettingsEditor(IBSPConfiguratorHost host, string baseDir, ESPxxOpenOCDSettings settings, KnownInterfaceInstance context, bool isESP32)
            : base(host, baseDir, settings ?? (isESP32 ? (OpenOCDSettings) new ESP32OpenOCDSettings() : new ESP8266OpenOCDSettings()), context)
        {
            IsESP32             = isESP32;
            Device.SelectedItem = new ScriptSelector <QuickSetupDatabase.TargetDeviceFamily> .Item {
                Script = isESP32 ? "target/esp32.cfg" : "target/esp8266.cfg"
            };
            if (settings == null)
            {
                ExplicitFrequencyEnabled = true;
                if (!isESP32)
                {
                    AutofeedWatchdog        = true;
                    NoInterruptsDuringSteps = true;
                }
            }

            var loadCommand = ProvideLoadCommand();
            var idx         = Settings.StartupCommands.IndexOf("mon reset halt");

            if (idx < 0 || idx > loadCommand)
            {
                Settings.StartupCommands.Insert(loadCommand, "mon reset halt");
            }

            if (Settings.FLASHResources != null)
            {
                foreach (var r in Settings.FLASHResources)
                {
                    FLASHResources.Add(r);
                }
            }

            FLASHResources.CollectionChanged += (s, e) => { Settings.FLASHResources = FLASHResources.ToArray(); OnPropertyChanged(nameof(FLASHResources)); };
        }
Ejemplo n.º 2
0
        public ESPxxGDBStubSettingsEditor(ESPxxGDBStubSettingsBase settings, KnownInterfaceInstance context, IBSPConfiguratorHost host, bool esp32Mode)
        {
            _Context = context;
            _Host    = host;
            IsESP32  = esp32Mode;
            Settings = settings;
            if (Settings == null)
            {
                if (esp32Mode)
                {
                    Settings = new ESP32GDBStubSettings();
                }
                else
                {
                    Settings = new ESP8266GDBStubSettings();
                }
            }

            if (context.COMPortNumber.HasValue)
            {
                Settings.COMPort          = "COM" + context.COMPortNumber;
                COMPortSelectorVisibility = Visibility.Collapsed;
            }

            if (Settings.FLASHResources != null)
            {
                foreach (var r in Settings.FLASHResources)
                {
                    FLASHResources.Add(r);
                }
            }
            FLASHResources.CollectionChanged += (s, e) => { Settings.FLASHResources = FLASHResources.ToArray(); OnSettingsChanged(); };
        }
Ejemplo n.º 3
0
        public ESPxxOpenOCDSettingsEditor(IBSPConfiguratorHost host, string baseDir, ESPxxOpenOCDSettings settings, KnownInterfaceInstance context, bool isESP32)
            : base(host, baseDir, settings ?? (isESP32 ? (OpenOCDSettings) new ESP32OpenOCDSettings() : new ESP8266OpenOCDSettings()), context)
        {
            IsESP32 = isESP32;

            _ESPIDFMode = host.MCU.Configuration.ContainsKey("com.sysprogs.esp32.idf.sdkconfig");

            Device.SelectedItem = new ScriptSelector <QuickSetupDatabase.TargetDeviceFamily> .Item {
                Script = isESP32 ? "target/esp32.cfg" : "target/esp8266.cfg"
            };
            if (settings == null)
            {
                ExplicitFrequencyEnabled = true;
                if (!isESP32)
                {
                    AutofeedWatchdog        = true;
                    NoInterruptsDuringSteps = true;
                }
            }

            var loadCommand = ProvideLoadCommand();
            var idx         = Settings.StartupCommands.IndexOf("mon reset halt");

            if (idx < 0 || idx > loadCommand)
            {
                Settings.StartupCommands.Insert(loadCommand, "mon reset halt");
            }

            if (Settings.SuggestionLogicRevision < SuggestionLogicRevision)
            {
                if (isESP32 && Settings.StartupCommands.IndexOf(BreakpointFixCommand) == -1)
                {
                    Settings.SuggestionLogicRevision = SuggestionLogicRevision;
                    for (int i = 0; i < Settings.StartupCommands.Count; i++)
                    {
                        if (Settings.StartupCommands[i].StartsWith("target "))
                        {
                            Settings.StartupCommands.Insert(i + 1, BreakpointFixCommand);
                            break;
                        }
                    }
                }
            }

            if (Settings.FLASHResources != null)
            {
                foreach (var r in Settings.FLASHResources)
                {
                    FLASHResources.Add(r);
                }
            }

            FLASHResources.CollectionChanged += (s, e) => { Settings.FLASHResources = FLASHResources.ToArray(); OnPropertyChanged(nameof(FLASHResources)); };
        }
Ejemplo n.º 4
0
        public ESPxxGDBStubSettingsEditor(ESPxxGDBStubSettingsBase settings, KnownInterfaceInstance context, IBSPConfiguratorHost host, bool esp32Mode)
        {
            _Context = context;
            _Host    = host;
            IsESP32  = esp32Mode;
            Settings = settings;
            if (Settings == null)
            {
                if (esp32Mode)
                {
                    Settings = new ESP32GDBStubSettings();
                }
                else
                {
                    Settings = new ESP8266GDBStubSettings();
                }
            }

            if (context.COMPortNumber.HasValue)
            {
                Settings.COMPort          = "COM" + context.COMPortNumber;
                COMPortSelectorVisibility = Visibility.Collapsed;
            }
            else if (host.AdvancedModeContext is IExternallyProgrammableProjectDebugContext ectx)
            {
                ExternalCOMPortSelectionHint = ectx.ExternalProgrammingOptionHint;
                if (ExternalCOMPortSelectionHint != null)
                {
                    COMPortSelectorVisibility = DirectFLASHProgrammingOptionVisibility = Visibility.Collapsed;
                }
            }

            if (Settings.FLASHResources != null)
            {
                foreach (var r in Settings.FLASHResources)
                {
                    FLASHResources.Add(r);
                }
            }
            FLASHResources.CollectionChanged += (s, e) => { Settings.FLASHResources = FLASHResources.ToArray(); OnSettingsChanged(); };
        }