Skip to content

Commit

Permalink
fixing default after flash
Browse files Browse the repository at this point in the history
  • Loading branch information
asizon committed Aug 9, 2020
1 parent 1fc9660 commit a254792
Showing 1 changed file with 2 additions and 32 deletions.
34 changes: 2 additions & 32 deletions jsx/blheli_configurator.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,6 @@ var Configurator = React.createClass({
await this.writeSetupImpl(esc);
}
},
writeSetupOne: async function() {
for (var esc = 0; esc < this.state.escSettings.length; ++esc) {
await this.writeSetupImpl(esc);
}
},
writeSetupImpl: async function(esc) {
try {
if (!this.state.escMetainfo[esc].available) {
Expand Down Expand Up @@ -272,29 +267,6 @@ var Configurator = React.createClass({

$('a.connect').removeClass('disabled');
},
writeSetupToOne: async function() {
GUI.log(chrome.i18n.getMessage('writeSetupStarted'));
$('a.connect').addClass('disabled');

// disallow further requests until we're finished
// @todo also disable settings alteration
this.setState({
canRead: false,
canWrite: false,
canFlash: false
});

try {
await this.writeSetupOne();
GUI.log(chrome.i18n.getMessage('writeSetupFinished'));
} catch (error) {
GUI.log(chrome.i18n.getMessage('writeSetupFailed', [ error.stack ]));
}

await this.readSetup();

$('a.connect').removeClass('disabled');
},
resetDefaults: function() {
var newSettings = [];

Expand Down Expand Up @@ -347,9 +319,6 @@ var Configurator = React.createClass({
this.setState({
escSettings: newSettings
});

this.writeSetupToOne()
.catch(error => console.log("Unexpected error while writing default setup", error))
},
flashOne: async function(escIndex) {
this.setState({
Expand Down Expand Up @@ -393,16 +362,17 @@ var Configurator = React.createClass({
var allSettings = self.state.escSettings.slice();
allSettings[escIndex] = newSettings;
self.onUserInput(allSettings);
this.resetPWMFrecuency(escIndex);

GUI.log(chrome.i18n.getMessage('writeSetupStarted'));

try {
await self.writeSetupImpl(escIndex);
GUI.log(chrome.i18n.getMessage('writeSetupFinished'));
this.resetPWMFrecuency();
} catch (error) {
GUI.log(chrome.i18n.getMessage('writeSetupFailed', [ error.message ]));
}
await self.readSetup();
} else {
GUI.log('Will not write settings back due to different MODE\n');

Expand Down

0 comments on commit a254792

Please sign in to comment.