Skip to content

Commit

Permalink
* Fixed addresses error (nodemcu#3) and checkbox bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
vowstar committed Jan 5, 2015
1 parent ca9fabf commit 23b7ef6
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 35 deletions.
2 changes: 1 addition & 1 deletion ESP8266Flasher.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<MainSource>ESP8266Flasher.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Release</Config>
<Platform Condition="'$(Platform)'==''">Win64</Platform>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
<TargetedPlatforms>3</TargetedPlatforms>
<AppType>Application</AppType>
</PropertyGroup>
Expand Down
Binary file modified ESP8266Flasher.res
Binary file not shown.
Binary file modified Resource.res
Binary file not shown.
Binary file modified Resources/Binaries/eagle.app.v6.flash.bin
Binary file not shown.
Binary file modified Resources/Binaries/eagle.app.v6.irom0text.bin
Binary file not shown.
31 changes: 20 additions & 11 deletions UnitFormMain.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ object FormMain: TFormMain
end>
ExplicitWidth = 546
inherited CheckBoxEnable: TCheckBox
OnClick = FrameConfigLineChange
OnMouseLeave = FrameConfigLineChange
end
inherited ComboBoxPath: TComboBox
Width = 394
Expand Down Expand Up @@ -410,7 +410,7 @@ object FormMain: TFormMain
end>
ExplicitWidth = 546
inherited CheckBoxEnable: TCheckBox
OnClick = FrameConfigLineChange
OnMouseLeave = FrameConfigLineChange
end
inherited ComboBoxPath: TComboBox
Width = 394
Expand Down Expand Up @@ -473,7 +473,7 @@ object FormMain: TFormMain
ExplicitHeight = 30
inherited CheckBoxEnable: TCheckBox
Height = 28
OnClick = FrameConfigLineChange
OnMouseLeave = FrameConfigLineChange
ExplicitHeight = 28
end
inherited ComboBoxPath: TComboBox
Expand Down Expand Up @@ -539,7 +539,7 @@ object FormMain: TFormMain
ExplicitHeight = 30
inherited CheckBoxEnable: TCheckBox
Height = 28
OnClick = FrameConfigLineChange
OnMouseLeave = FrameConfigLineChange
ExplicitHeight = 28
end
inherited ComboBoxPath: TComboBox
Expand Down Expand Up @@ -605,7 +605,7 @@ object FormMain: TFormMain
ExplicitHeight = 30
inherited CheckBoxEnable: TCheckBox
Height = 28
OnClick = FrameConfigLineChange
OnMouseLeave = FrameConfigLineChange
ExplicitHeight = 28
end
inherited ComboBoxPath: TComboBox
Expand Down Expand Up @@ -671,7 +671,7 @@ object FormMain: TFormMain
ExplicitHeight = 30
inherited CheckBoxEnable: TCheckBox
Height = 28
OnClick = FrameConfigLineChange
OnMouseLeave = FrameConfigLineChange
ExplicitHeight = 28
end
inherited ComboBoxPath: TComboBox
Expand Down Expand Up @@ -737,7 +737,7 @@ object FormMain: TFormMain
ExplicitHeight = 30
inherited CheckBoxEnable: TCheckBox
Height = 28
OnClick = FrameConfigLineChange
OnMouseLeave = FrameConfigLineChange
ExplicitHeight = 28
end
inherited ComboBoxPath: TComboBox
Expand Down Expand Up @@ -778,7 +778,7 @@ object FormMain: TFormMain
end
object LabelFlashSize: TLabel
Left = 16
Top = 83
Top = 69
Width = 96
Height = 28
Caption = 'Flash size'
Expand All @@ -791,7 +791,7 @@ object FormMain: TFormMain
end
object LabelFlashSpeed: TLabel
Left = 16
Top = 136
Top = 111
Width = 118
Height = 28
Caption = 'Flash speed'
Expand Down Expand Up @@ -837,7 +837,7 @@ object FormMain: TFormMain
end
object ComboBoxFlashSize: TComboBox
Left = 140
Top = 80
Top = 66
Width = 162
Height = 36
Style = csDropDownList
Expand Down Expand Up @@ -867,7 +867,7 @@ object FormMain: TFormMain
end
object ComboBoxFlashSpeed: TComboBox
Left = 140
Top = 133
Top = 108
Width = 162
Height = 36
Style = csDropDownList
Expand All @@ -893,6 +893,15 @@ object FormMain: TFormMain
'20MHz'
'80MHz')
end
object ButtonRestoreDefault: TButton
Left = 16
Top = 150
Width = 286
Height = 68
Caption = 'Restore default'
TabOrder = 3
OnClick = ButtonRestoreDefaultClick
end
end
object TabSheetIntroduction: TTabSheet
Caption = 'About'
Expand Down
98 changes: 75 additions & 23 deletions UnitFormMain.pas
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ TFormMain = class(TForm)
ComboBoxFlashSize: TComboBox;
ComboBoxFlashSpeed: TComboBox;
LabelFlashSpeed: TLabel;
ButtonRestoreDefault: TButton;
procedure FormCreate(Sender: TObject);
procedure ActionBurnExecute(Sender: TObject);
procedure FormDestroy(Sender: TObject);
Expand All @@ -76,6 +77,7 @@ TFormMain = class(TForm)
procedure LabelIntroductionClick(Sender: TObject);
procedure TimerCodeTimer(Sender: TObject);
procedure FrameConfigLineChange(Sender: TObject);
procedure ButtonRestoreDefaultClick(Sender: TObject);
private
SerailBufferA: AnsiString;
BurnOK: Boolean;
Expand Down Expand Up @@ -130,6 +132,12 @@ implementation

{$R *.dfm}

procedure TFormMain.ButtonRestoreDefaultClick(Sender: TObject);
begin
InitDataChest;
// LoadDataChest;
end;

procedure TFormMain.ChangeIconFail;
var
Image: TPngImage;
Expand Down Expand Up @@ -500,7 +508,7 @@ procedure TFormMain.FormDestroy(Sender: TObject);

procedure TFormMain.FrameConfigLineChange(Sender: TObject);
begin
SaveDataChest;
SaveDataChest;
end;

function TFormMain.SendByte(const Data: Byte): Boolean;
Expand Down Expand Up @@ -728,23 +736,66 @@ procedure TFormMain.InitDataChest;
TStringChest[FrameConfigLine7.Name + '.FilePath'];
TStringChest[FrameConfigLine1.Name + '.Offset'] := '0x00000';
TStringChest[FrameConfigLine2.Name + '.Offset'] := '0x10000';
TStringChest[FrameConfigLine3.Name + '.Offset'] := '0xfc000';
TStringChest[FrameConfigLine4.Name + '.Offset'] := '0xfe000';
TStringChest[FrameConfigLine3.Name + '.Offset'] := '0x7C000';
TStringChest[FrameConfigLine4.Name + '.Offset'] := '0x7E000';
TStringChest[FrameConfigLine5.Name + '.Offset'];
TStringChest[FrameConfigLine6.Name + '.Offset'];
TStringChest[FrameConfigLine7.Name + '.Offset'];
TBooleanChest[FrameConfigLine1.Name + '.Checked'] := True;
TBooleanChest[FrameConfigLine1.Name + '.Checked'] := True;
TBooleanChest[FrameConfigLine1.Name + '.Checked'] := True;
TBooleanChest[FrameConfigLine1.Name + '.Checked'] := True;
TBooleanChest[FrameConfigLine1.Name + '.Checked'];
TBooleanChest[FrameConfigLine1.Name + '.Checked'];
TBooleanChest[FrameConfigLine1.Name + '.Checked'];
TBooleanChest[FrameConfigLine2.Name + '.Checked'] := True;
TBooleanChest[FrameConfigLine3.Name + '.Checked'] := True;
TBooleanChest[FrameConfigLine4.Name + '.Checked'] := True;
TBooleanChest[FrameConfigLine5.Name + '.Checked'];
TBooleanChest[FrameConfigLine6.Name + '.Checked'];
TBooleanChest[FrameConfigLine7.Name + '.Checked'];
TStringChest[ComboBoxFlashBaudrate.Name + '.Text'] := '115200';
TIntChest[ComboBoxFlashSize.Name + '.ItemIndex'] := 1;
TIntChest[ComboBoxFlashSpeed.Name + '.ItemIndex'] := 0;
TStringChest.Publisher := 'NodeMCU Team. http://www.nodemcu.com';
TStringChest.SaveToXMLFile(ConfigFileName);
// TStringChest.SaveToXMLFile(ConfigFileName);
FrameConfigLine1.FilePath := TStringChest
[FrameConfigLine1.Name + '.FilePath'];
FrameConfigLine2.FilePath := TStringChest
[FrameConfigLine2.Name + '.FilePath'];
FrameConfigLine3.FilePath := TStringChest
[FrameConfigLine3.Name + '.FilePath'];
FrameConfigLine4.FilePath := TStringChest
[FrameConfigLine4.Name + '.FilePath'];
FrameConfigLine5.FilePath := TStringChest
[FrameConfigLine5.Name + '.FilePath'];
FrameConfigLine6.FilePath := TStringChest
[FrameConfigLine6.Name + '.FilePath'];
FrameConfigLine7.FilePath := TStringChest
[FrameConfigLine7.Name + '.FilePath'];
FrameConfigLine1.Offset := TStringChest[FrameConfigLine1.Name + '.Offset'];
FrameConfigLine2.Offset := TStringChest[FrameConfigLine2.Name + '.Offset'];
FrameConfigLine3.Offset := TStringChest[FrameConfigLine3.Name + '.Offset'];
FrameConfigLine4.Offset := TStringChest[FrameConfigLine4.Name + '.Offset'];
FrameConfigLine5.Offset := TStringChest[FrameConfigLine5.Name + '.Offset'];
FrameConfigLine6.Offset := TStringChest[FrameConfigLine6.Name + '.Offset'];
FrameConfigLine7.Offset := TStringChest[FrameConfigLine7.Name + '.Offset'];
FrameConfigLine1.CheckBoxEnable.Checked := True;
TBooleanChest[FrameConfigLine1.Name + '.Checked'];
FrameConfigLine2.CheckBoxEnable.Checked := True;
TBooleanChest[FrameConfigLine2.Name + '.Checked'];
FrameConfigLine3.CheckBoxEnable.Checked := True;
TBooleanChest[FrameConfigLine3.Name + '.Checked'];
FrameConfigLine4.CheckBoxEnable.Checked := True;
TBooleanChest[FrameConfigLine4.Name + '.Checked'];
FrameConfigLine5.CheckBoxEnable.Checked :=
TBooleanChest[FrameConfigLine5.Name + '.Checked'];
FrameConfigLine6.CheckBoxEnable.Checked :=
TBooleanChest[FrameConfigLine6.Name + '.Checked'];
FrameConfigLine7.CheckBoxEnable.Checked :=
TBooleanChest[FrameConfigLine7.Name + '.Checked'];
ComboBoxFlashBaudrate.Text := TStringChest
[ComboBoxFlashBaudrate.Name + '.Text'];
ComboBoxFlashSize.ItemIndex :=
TIntChest[ComboBoxFlashSize.Name + '.ItemIndex'];
ComboBoxFlashSpeed.ItemIndex :=
TIntChest[ComboBoxFlashSpeed.Name + '.ItemIndex'];
SyncDataChest;
SaveDataChest;
end;

procedure TFormMain.SyncDataChest;
Expand Down Expand Up @@ -772,17 +823,17 @@ procedure TFormMain.SyncDataChest;
TStringChest[FrameConfigLine7.Name + '.Offset'] := FrameConfigLine7.Offset;
TBooleanChest[FrameConfigLine1.Name + '.Checked'] :=
FrameConfigLine1.CheckBoxEnable.Checked;
TBooleanChest[FrameConfigLine1.Name + '.Checked'] :=
TBooleanChest[FrameConfigLine2.Name + '.Checked'] :=
FrameConfigLine2.CheckBoxEnable.Checked;
TBooleanChest[FrameConfigLine1.Name + '.Checked'] :=
TBooleanChest[FrameConfigLine3.Name + '.Checked'] :=
FrameConfigLine3.CheckBoxEnable.Checked;
TBooleanChest[FrameConfigLine1.Name + '.Checked'] :=
TBooleanChest[FrameConfigLine4.Name + '.Checked'] :=
FrameConfigLine4.CheckBoxEnable.Checked;
TBooleanChest[FrameConfigLine1.Name + '.Checked'] :=
TBooleanChest[FrameConfigLine5.Name + '.Checked'] :=
FrameConfigLine5.CheckBoxEnable.Checked;
TBooleanChest[FrameConfigLine1.Name + '.Checked'] :=
TBooleanChest[FrameConfigLine6.Name + '.Checked'] :=
FrameConfigLine6.CheckBoxEnable.Checked;
TBooleanChest[FrameConfigLine1.Name + '.Checked'] :=
TBooleanChest[FrameConfigLine7.Name + '.Checked'] :=
FrameConfigLine7.CheckBoxEnable.Checked;
TStringChest[ComboBoxFlashBaudrate.Name + '.Text'] :=
ComboBoxFlashBaudrate.Text;
Expand Down Expand Up @@ -819,17 +870,17 @@ procedure TFormMain.LoadDataChest;
FrameConfigLine1.CheckBoxEnable.Checked :=
TBooleanChest[FrameConfigLine1.Name + '.Checked'];
FrameConfigLine2.CheckBoxEnable.Checked :=
TBooleanChest[FrameConfigLine1.Name + '.Checked'];
TBooleanChest[FrameConfigLine2.Name + '.Checked'];
FrameConfigLine3.CheckBoxEnable.Checked :=
TBooleanChest[FrameConfigLine1.Name + '.Checked'];
TBooleanChest[FrameConfigLine3.Name + '.Checked'];
FrameConfigLine4.CheckBoxEnable.Checked :=
TBooleanChest[FrameConfigLine1.Name + '.Checked'];
TBooleanChest[FrameConfigLine4.Name + '.Checked'];
FrameConfigLine5.CheckBoxEnable.Checked :=
TBooleanChest[FrameConfigLine1.Name + '.Checked'];
TBooleanChest[FrameConfigLine5.Name + '.Checked'];
FrameConfigLine6.CheckBoxEnable.Checked :=
TBooleanChest[FrameConfigLine1.Name + '.Checked'];
TBooleanChest[FrameConfigLine6.Name + '.Checked'];
FrameConfigLine7.CheckBoxEnable.Checked :=
TBooleanChest[FrameConfigLine1.Name + '.Checked'];
TBooleanChest[FrameConfigLine7.Name + '.Checked'];
ComboBoxFlashBaudrate.Text := TStringChest
[ComboBoxFlashBaudrate.Name + '.Text'];
ComboBoxFlashSize.ItemIndex :=
Expand All @@ -841,6 +892,7 @@ procedure TFormMain.LoadDataChest;
procedure TFormMain.SaveDataChest;
begin
SyncDataChest;
TStringChest.Publisher := 'NodeMCU Team. http://www.nodemcu.com';
TStringChest.SaveToXMLFile(ConfigFileName);
end;

Expand Down Expand Up @@ -931,7 +983,7 @@ procedure TFormMain.LoadSettings;
// FrameConfigLine4.CheckBoxEnable.Checked := True;

InitDataChest;
LoadDataChest;
// LoadDataChest;
end;

InitRichEdit;
Expand Down
Binary file modified Win32/Release/ESP8266Flasher.exe
Binary file not shown.
Binary file modified Win64/Release/ESP8266Flasher.exe
Binary file not shown.

0 comments on commit 23b7ef6

Please sign in to comment.