Skip to content

Commit 7bc018a

Browse files
committed
Added support for choosing debug interface and FLASH programming mode via settings
1 parent cf80c0d commit 7bc018a

File tree

7 files changed

+287
-18
lines changed

7 files changed

+287
-18
lines changed

BSPEngine.dll

0 Bytes
Binary file not shown.

DebugPackages/ESP8266DebugPackage/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
[assembly: AssemblyCulture("")]
1717
[assembly: ComVisible(false)]
1818

19-
[assembly: AssemblyVersion("2.0.1600.0")]
20-
[assembly: AssemblyFileVersion("2.0.1600.0")]
19+
[assembly: AssemblyVersion("2.0.1602.0")]
20+
[assembly: AssemblyFileVersion("2.0.1602.0")]

DebugPackages/RenesasDebugPackage/GUI/RenesasDebugSettingsControl.xaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,82 @@
44
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
66
xmlns:local="clr-namespace:RenesasDebugPackage.GUI"
7+
xmlns:bspe="clr-namespace:BSPEngine;assembly=BSPEngine"
8+
xmlns:sys="clr-namespace:System;assembly=mscorlib"
9+
xmlns:coll="clr-namespace:System.Collections;assembly=mscorlib"
710
mc:Ignorable="d"
811
d:DesignHeight="450" d:DesignWidth="800">
912
<Grid>
1013
<Grid.Resources>
1114
<local:MaxWidthConverter x:Key="MaxWidthConverter"/>
15+
<ItemsPanelTemplate x:Key="HorizontalItemsPanel">
16+
<StackPanel Orientation="Horizontal"/>
17+
</ItemsPanelTemplate>
18+
<Thickness x:Key="TableElementMargin">0 2 0 2</Thickness>
1219
</Grid.Resources>
20+
<Grid.RowDefinitions>
21+
<RowDefinition Height="Auto"/>
22+
<RowDefinition Height="Auto"/>
23+
<RowDefinition Height="Auto"/>
24+
<RowDefinition Height="Auto"/>
25+
<RowDefinition Height="Auto"/>
26+
<RowDefinition Height="Auto"/>
27+
<RowDefinition Height="Auto"/>
28+
<RowDefinition Height="Auto"/>
29+
<RowDefinition Height="Auto"/>
30+
<RowDefinition Height="Auto"/>
31+
</Grid.RowDefinitions>
32+
<Grid.ColumnDefinitions>
33+
<ColumnDefinition Width="Auto"/>
34+
<ColumnDefinition Width="*"/>
35+
</Grid.ColumnDefinitions>
36+
37+
<Label Content="Programming interface:" Grid.Row="0"/>
38+
<ListBox Grid.Row="0" Grid.Column="1" SelectedItem="{Binding ProgrammingInterface}" Margin="{StaticResource TableElementMargin}" ItemsPanel="{StaticResource HorizontalItemsPanel}">
39+
<ListBox.ItemsSource>
40+
<coll:ArrayList>
41+
<local:KnownProgrammingInterface>E1</local:KnownProgrammingInterface>
42+
<local:KnownProgrammingInterface>E2</local:KnownProgrammingInterface>
43+
<local:KnownProgrammingInterface>E2LITE</local:KnownProgrammingInterface>
44+
<local:KnownProgrammingInterface>EZ</local:KnownProgrammingInterface>
45+
<local:KnownProgrammingInterface>IECUBE</local:KnownProgrammingInterface>
46+
</coll:ArrayList>
47+
</ListBox.ItemsSource>
48+
</ListBox>
49+
50+
<Label Content="Program FLASH memory:" Grid.Row="1"/>
51+
<ListBox Grid.Row="1" Grid.Column="1" SelectedItem="{Binding ProgramMode}" Margin="{StaticResource TableElementMargin}" ItemsPanel="{StaticResource HorizontalItemsPanel}">
52+
<ListBox.ItemsSource>
53+
<coll:ArrayList>
54+
<bspe:ProgramMode>Enabled</bspe:ProgramMode>
55+
<bspe:ProgramMode>Disabled</bspe:ProgramMode>
56+
<bspe:ProgramMode>Auto</bspe:ProgramMode>
57+
</coll:ArrayList>
58+
</ListBox.ItemsSource>
59+
<ListBox.ItemTemplate>
60+
<DataTemplate>
61+
<TextBlock>
62+
<TextBlock.Style>
63+
<Style TargetType="TextBlock">
64+
<Style.Triggers>
65+
<DataTrigger Binding="{Binding}" Value="Enabled">
66+
<Setter Property="Text" Value="Always"/>
67+
</DataTrigger>
68+
<DataTrigger Binding="{Binding}" Value="Disabled">
69+
<Setter Property="Text" Value="Never"/>
70+
</DataTrigger>
71+
<DataTrigger Binding="{Binding}" Value="Auto">
72+
<Setter Property="Text" Value="If rebuilt since last load"/>
73+
</DataTrigger>
74+
</Style.Triggers>
75+
<Setter Property="Foreground" Value="{Binding Foreground, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:RenesasDebugSettingsControl}}"/>
76+
</Style>
77+
</TextBlock.Style>
78+
</TextBlock>
79+
</DataTemplate>
80+
</ListBox.ItemTemplate>
81+
</ListBox>
82+
1383
<Expander Grid.ColumnSpan="2" MinHeight="64" Grid.Row="14" Header="Advanced settings" IsExpanded="False">
1484
<Grid MinHeight="80" Margin="20 0 5 5">
1585
<Grid.RowDefinitions>

DebugPackages/RenesasDebugPackage/GUI/RenesasDebugSettingsControl.xaml.cs

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ public RenesasDebugSettingsControl(LoadedBSP.LoadedDebugMethod method, IBSPConfi
3232

3333
public class ControllerImpl : ICustomDebugMethodConfigurator, INotifyPropertyChanged
3434
{
35-
void OnPropertyChanged(string name) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
35+
void OnPropertyChanged(string name)
36+
{
37+
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
38+
SettingsChanged?.Invoke(this, EventArgs.Empty);
39+
}
3640

3741
RenesasGDBServerCommandLine _CommandLine;
3842

@@ -43,6 +47,34 @@ public ControllerImpl(RenesasDebugSettingsControl control, LoadedBSP.LoadedDebug
4347
_CommandLine = new RenesasGDBServerCommandLine(new RenesasDebugSettings().CommandLineArguments);
4448
}
4549

50+
ProgramMode _ProgramMode;
51+
public ProgramMode ProgramMode
52+
{
53+
get => _ProgramMode;
54+
set
55+
{
56+
_ProgramMode = value;
57+
OnPropertyChanged(nameof(ProgramMode));
58+
}
59+
}
60+
61+
public KnownProgrammingInterface ProgrammingInterface
62+
{
63+
get
64+
{
65+
var iface = _CommandLine.DebugInterface ?? "EZ";
66+
if (Enum.TryParse<KnownProgrammingInterface>(iface, out var val))
67+
return val;
68+
return KnownProgrammingInterface.EZ;
69+
}
70+
set
71+
{
72+
_CommandLine.DebugInterface = value.ToString();
73+
OnCommandLineChanged();
74+
}
75+
}
76+
77+
4678
public string CommandLine
4779
{
4880
get => _CommandLine.CommandLine;
@@ -56,11 +88,12 @@ public string CommandLine
5688
void OnCommandLineChanged()
5789
{
5890
OnPropertyChanged(nameof(CommandLine));
91+
OnPropertyChanged(nameof(ProgrammingInterface));
5992
}
6093

6194
public object Control { get; }
6295

63-
public object Configuration => new RenesasDebugSettings { CommandLineArguments = _CommandLine.CommandLine };
96+
public object Configuration => new RenesasDebugSettings { CommandLineArguments = _CommandLine.CommandLine, ProgramMode = ProgramMode };
6497

6598
public ICustomSettingsTypeProvider TypeProvider { get; }
6699

@@ -71,7 +104,9 @@ void OnCommandLineChanged()
71104

72105
public void SetConfiguration(object configuration, KnownInterfaceInstance context)
73106
{
74-
_CommandLine = new RenesasGDBServerCommandLine(((configuration as RenesasDebugSettings) ?? new RenesasDebugSettings()).CommandLineArguments);
107+
var settings = (configuration as RenesasDebugSettings) ?? new RenesasDebugSettings();
108+
_CommandLine = new RenesasGDBServerCommandLine(settings.CommandLineArguments);
109+
ProgramMode = settings.ProgramMode;
75110
}
76111

77112
public bool TryFixSettingsFromStubError(IGDBStubInstance stub)
@@ -101,4 +136,13 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu
101136
throw new NotImplementedException();
102137
}
103138
}
139+
140+
public enum KnownProgrammingInterface
141+
{
142+
E1,
143+
E2,
144+
E2LITE,
145+
EZ,
146+
IECUBE
147+
}
104148
}

0 commit comments

Comments
 (0)