Merge remote-tracking branch 'multiwii/master'

Conflicts:
	_locales/en/messages.json
	changelog.html
	js/data_storage.js
	js/protocols/stm32.js
	manifest.json
	tabs/auxiliary_configuration.js
	tabs/default.css
	tabs/default.html
	tabs/firmware_flasher.js
	tabs/servos.js
10.3.x-maintenance
Dominic Clifton 2014-09-04 01:40:24 +01:00
commit bf13a11dc2
11 changed files with 110 additions and 67 deletions

View File

@ -136,7 +136,7 @@
"message": "Request Optional Permissions"
},
"defaultWelcomeText": {
"message": "This application is a configuration utility for cleanflight, a 32 bit fork of the popular open source RC flight control firmware project <a href=\"http://www.multiwii.org/\" title=\"www.multiwii.org\" target=\"_blank\">MultiWii</a>.<br /><br />Application supports hardware that run cleanflight (acro naze, naze, afromini, flip32, flip32+, chebuzz f3, stm32f3discovery, naze32pro, etc)<br /><br />The firmware source code can be downloaded from <a href=\"https://github.com/hydra/cleanflight\" title=\"www.github.com\" target=\"_blank\">here</a><br />The newest binary firmware image is available <a href=\"https://github.com/hydra/cleanflight/tree/master/obj\" title=\"www.github.com\" target=\"_blank\">here</a><br /><br />Latest <strong>CP210x Drivers</strong> can be downloaded from <a href=\"http://www.silabs.com/products/mcu/pages/usbtouartbridgevcpdrivers.aspx\" title=\"http://www.silabs.com/\" target=\"_blank\">here</a><br />"
"message": "Welcome to <strong>Cleanflight - Configurator</strong>, utility designed to simplify updating, configuring and tuning of your flight controller.<br /><br />Application supports hardware that run cleanflight (acro naze, naze, afromini, flip32, flip32+, chebuzz f3, stm32f3discovery, naze32pro, etc)<br /><br />The firmware source code can be downloaded from <a href=\"https://github.com/hydra/cleanflight\" title=\"www.github.com\" target=\"_blank\">here</a><br />The newest binary firmware image is available <a href=\"https://github.com/hydra/cleanflight/tree/master/obj\" title=\"www.github.com\" target=\"_blank\">here</a><br /><br />Latest <strong>CP210x Drivers</strong> can be downloaded from <a href=\"http://www.silabs.com/products/mcu/pages/usbtouartbridgevcpdrivers.aspx\" title=\"http://www.silabs.com/\" target=\"_blank\">here</a><br />"
},
"defaultChangelogHead": {
"message": "Configurator - Changelog"
@ -524,7 +524,7 @@
"message": "Progress:"
},
"firmwareFlasherNote": {
"message": "If you are flashing board with bootloader pins <strong>shorted/connected</strong>, check <strong>No reboot sequence</strong>.<br />If you want configuration data to be wiped, check <strong>Full Chip Erase</strong><br />"
"message": "If you are flashing board with bootloader pins <strong>shorted/connected</strong>, check <strong>No reboot sequence</strong>.<br />If you want configuration data to be wiped, check <strong>Full Chip Erase</strong><br />If you are flashing via bluetooth adapter or using external usb to serial adapter, check <strong>Flash slowly</strong><br />"
},
"firmwareFlasherNoReboot": {
"message": "No reboot sequence"
@ -535,6 +535,12 @@
"firmwareFlasherFullChipErase": {
"message": "Full Chip Erase"
},
"firmwareFlasherFlashSlowly": {
"message": "Flash slowly"
},
"firmwareFlasherFlashSlowlyTitle": {
"message": "Use 115200 baudrate for flashing"
},
"firmwareFlasherButtonLoadLocal": {
"message": "Load Firmware [Local]"
},
@ -566,19 +572,16 @@
"message": "Leave Firmware Flasher"
},
"firmwareFlasherFirmwareNotLoaded": {
"message": "<span style=\"color: red\">Firmware not loaded</span>"
},
"firmwareFlasherLocalFirmwareLoaded": {
"message": "<span style=\"color: green\">Local Firmware loaded, ready for flashing</span>"
"message": "Firmware not loaded"
},
"firmwareFlasherHexCorrupted": {
"message": "<span style=\"color: red\">HEX file appears to be corrupted</span>"
"message": "HEX file appears to be corrupted"
},
"firmwareFlasherRemoteFirmwareLoaded": {
"message": "<span style=\"color: green\">Remote Firmware loaded, ready for flashing</span>"
},
"firmwareFlasherFailedToLoadOnlineFirmware": {
"message": "<span style=\"color: red\">Failed to load remote firmware</span>"
"message": "Failed to load remote firmware"
},
"firmwareFlasherWaitForFinish": {
"message": "You <span style=\"color: red\">can't</span> do this right now, please wait for current operation to finish ..."

View File

@ -1,6 +1,8 @@
<span>08.25.2014 - 0.49.2 cleanflight</span>
<span>08.31.2014 - 0.50</span>
<p>
- Disable sponsors panel.
- Small UI revamp for Firmware Flasher<br />
- Added "Flash slowly" mode (bluetooth friendly)<br />
- Bugfixes<br />
</p>
<span>08.25.2014 - 0.49.1 cleanflight</span>
<p>

View File

@ -1,7 +1,7 @@
'use strict';
var CONFIGURATOR = {
'releaseDate': 1408379746980, // 08.18.2014 - new Date().getTime()
'releaseDate': 1409496670288, // 08.31.2014 - new Date().getTime()
'firmwareVersionAccepted': 2.3,
'connectionValid': false,
'mspPassThrough': false,

View File

@ -256,7 +256,7 @@ STM32DFU_protocol.prototype.upload_procedure = function (step) {
case 2:
// full chip erase
console.log('Executing global chip erase');
GUI.log('Erasing ...');
$('span.progressLabel').text('Erasing ...');
self.controlTransfer('out', self.request.DNLOAD, 0, 0, 0, [0x41], function () {
self.controlTransfer('in', self.request.GETSTATUS, 0, 0, 6, 0, function (data) {
@ -284,7 +284,7 @@ STM32DFU_protocol.prototype.upload_procedure = function (step) {
// upload
// we dont need to clear the state as we are already using DFU_DNLOAD
console.log('Writing data ...');
GUI.log('Flashing ...');
$('span.progressLabel').text('Flashing ...');
var blocks = self.hex.data.length - 1;
var flashing_block = 0;
@ -355,7 +355,7 @@ STM32DFU_protocol.prototype.upload_procedure = function (step) {
case 5:
// verify
console.log('Verifying data ...');
GUI.log('Verifying ...');
$('span.progressLabel').text('Verifying ...');
var blocks = self.hex.data.length - 1;
var reading_block = 0;
@ -422,7 +422,7 @@ STM32DFU_protocol.prototype.upload_procedure = function (step) {
if (verify) {
console.log('Programming: SUCCESSFUL');
GUI.log('Programming: <strong style="color: green">SUCCESSFUL</strong>');
$('span.progressLabel').text('Programming: SUCCESSFUL');
googleAnalytics.sendEvent('Flashing', 'Programming', 'success');
// update progress bar
@ -432,7 +432,7 @@ STM32DFU_protocol.prototype.upload_procedure = function (step) {
self.upload_procedure(6);
} else {
console.log('Programming: FAILED');
GUI.log('Programming: <strong style="color: red">FAILED</strong>');
$('span.progressLabel').text('Programming: FAILED');
googleAnalytics.sendEvent('Flashing', 'Programming', 'fail');
// update progress bar

View File

@ -1,8 +1,7 @@
{
"manifest_version": 2,
"minimum_chrome_version": "36",
"version": "0.49.2",
"version": "0.50",
"author": "Hydra",
"name": "Cleanflight - Configurator",
"short_name": "cleanflight",

View File

@ -125,7 +125,7 @@ TABS.auxiliary_configuration.initialize = function (callback) {
AUX_val_buffer_out.push(highByte((AUX_CONFIG_values[i] >> 16) & 0xFFF));
}
}
MSP.send_message(MSP_codes.MSP_SET_BOX, AUX_val_buffer_out, false, save_to_eeprom);
function save_to_eeprom() {

View File

@ -146,9 +146,6 @@
.firmware_flasher:hover {
background-color: #dedcdc;
}
.tab-default .sponsors {
display: none;
}
.tab-default .sponsors {
margin-top: 10px;
border: 1px solid silver;

View File

@ -11,7 +11,7 @@
<div class="title" i18n="defaultDonateHead"></div>
<p i18n="defaultDonateText">
</p>
<div class="buttons">
<div class="buttons">
<ul>
<li><p i18n="defaultDonateFirmwareText"></p><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=TSQKVT6UYKGL6" target="_blank" title="Donate for cleanflight firmware"><img src="./images/btn_donate_SM.gif" alt="Paypal" /></a></li>
<li><p i18n="defaultDonateConfiguratorText"></p><a href="http://goo.gl/xQMKN" target="_blank" title="Donate for configurator"><img src="./images/btn_donate_SM.gif" alt="Paypal" /></a></li>
@ -21,8 +21,7 @@
<div class="sponsors">
<div class="title">Sponsors</div>
<p>
&bull; <a href="http://www.abusemark.com/store/" title="www.abusemark.com" target="_blank">AbuseMark</a><br />
&bull; <a href="http://www.multirotorsuperstore.com/" title="www.multirotorsuperstore.com" target="_blank">Multirotor Superstore</a><br />
&bull; <a href="http://www.massiverc.com" title="www.massiverc.com" target="_blank">MassiveRC</a><br />
</p>
</div>
</div>

View File

@ -1,22 +1,50 @@
.tab-firmware_flasher .info {
margin: 0 0 10px 0;
position: relative;
}
.tab-firmware_flasher .info strong {
margin-right: 5px;
.tab-firmware_flasher .info .progressLabel {
position: absolute;
width: 100%;
height: 26px;
top: 0;
left: 0;
text-align: center;
line-height: 24px;
color: white;
font-weight: bold;
/* text-shadow: 1px 0px 2px rgba(0, 0, 0, 0.9);*/
}
.tab-firmware_flasher .info .progress {
width: 25%;
width: 100%;
height: 26px;
border: 1px solid silver;
}
.tab-firmware_flasher .info .progress::-webkit-progress-value {
background-color: #f4af4d;
.tab-firmware_flasher .info .progress {
-webkit-appearance: none;
}
.tab-firmware_flasher .info .progress::-webkit-progress-bar {
background-color: #343434;
}
.tab-firmware_flasher .info .progress::-webkit-progress-value {
background-color: #F86008;
}
.tab-firmware_flasher .info .progress.valid::-webkit-progress-bar {
background-color: #73BE45;
}
.tab-firmware_flasher .info .progress.valid::-webkit-progress-value {
background-color: #43c232;
background-color: #73BE45;
}
.tab-firmware_flasher .info .progress.invalid::-webkit-progress-bar {
background-color: #A62E32;
}
.tab-firmware_flasher .info .progress.invalid::-webkit-progress-value {
background-color: #cf2222;
background-color: #A62E32;
}
.tab-firmware_flasher .note {
margin-bottom: 10px;

View File

@ -1,8 +1,7 @@
<div class="tab-firmware_flasher">
<div class="info">
<strong i18n="firmwareFlasherPath"></strong><span class="path">empty</span><br />
<strong i18n="firmwareFlasherSize"></strong><span class="size">0 bytes</span><br />
<strong i18n="firmwareFlasherProgress"></strong><progress class="progress" value="0" min="0" max="100"></progress>
<progress class="progress" value="0" min="0" max="100"></progress>
<span class="progressLabel">Please load firmware file</span>
</div>
<div class="note">
<p i18n="firmwareFlasherNote">
@ -22,6 +21,11 @@
<span i18n="firmwareFlasherFullChipErase"></span>
</label>
<div class="clear-both"></div>
<label i18n_title="firmwareFlasherFlashSlowlyTitle">
<input class="flash_slowly" type="checkbox" />
<span i18n="firmwareFlasherFlashSlowly"></span>
</label>
<div class="clear-both"></div>
</div>
<div class="clear-both"></div>
<div class="git_info">

View File

@ -6,8 +6,8 @@ TABS.firmware_flasher.initialize = function (callback) {
GUI.active_tab = 'firmware_flasher';
googleAnalytics.sendAppView('Firmware Flasher');
var intel_hex = false; // standard intel hex in string format
var parsed_hex = false; // parsed raw hex in array format
var intel_hex = false, // standard intel hex in string format
parsed_hex = false; // parsed raw hex in array format
$('#content').load("./tabs/firmware_flasher.html", function () {
// translate to user-selected language
@ -27,7 +27,6 @@ TABS.firmware_flasher.initialize = function (callback) {
chrome.fileSystem.getDisplayPath(fileEntry, function (path) {
console.log('Loading file from: ' + path);
$('span.path').html(path);
fileEntry.file(function (file) {
var reader = new FileReader();
@ -50,13 +49,12 @@ TABS.firmware_flasher.initialize = function (callback) {
parsed_hex = data;
if (parsed_hex) {
GUI.log(chrome.i18n.getMessage('firmwareFlasherLocalFirmwareLoaded'));
googleAnalytics.sendEvent('Flashing', 'Firmware', 'local');
$('a.flash_firmware').removeClass('locked');
$('span.size').html(parsed_hex.bytes_total + ' bytes');
$('span.progressLabel').text('Loaded Local Firmware: (' + parsed_hex.bytes_total + ' bytes)');
} else {
GUI.log(chrome.i18n.getMessage('firmwareFlasherHexCorrupted'));
$('span.progressLabel').text(chrome.i18n.getMessage('firmwareFlasherHexCorrupted'));
}
});
}
@ -68,41 +66,39 @@ TABS.firmware_flasher.initialize = function (callback) {
});
});
$('a.load_remote_file').click(function() {
$.get('https://raw.githubusercontent.com/hydra/cleanflight/master/obj/cleanflight_NAZE.hex', function (data) {
$('a.load_remote_file').click(function () {
$.get('https://raw.githubusercontent.com/multiwii/baseflight/master/obj/baseflight.hex', function (data) {
intel_hex = data;
parse_hex(intel_hex, function (data) {
parsed_hex = data;
if (parsed_hex) {
GUI.log(chrome.i18n.getMessage('firmwareFlasherRemoteFirmwareLoaded'));
googleAnalytics.sendEvent('Flashing', 'Firmware', 'online');
$('span.progressLabel').text('Loaded Online Firmware: (' + parsed_hex.bytes_total + ' bytes)');
$('a.flash_firmware').removeClass('locked');
$('span.path').text('Using remote Firmware');
$('span.size').text(parsed_hex.bytes_total + ' bytes');
$.get('https://api.github.com/repos/multiwii/baseflight/commits?page=1&per_page=1&path=obj/baseflight.hex', function (data) {
var data = data[0],
d = new Date(data.commit.author.date),
date = ('0' + (d.getMonth() + 1)).slice(-2) + '.' + ('0' + (d.getDate() + 1)).slice(-2) + '.' + d.getFullYear();
date += ' @ ' + ('0' + d.getHours()).slice(-2) + ':' + ('0' + d.getMinutes()).slice(-2);
$('div.git_info .committer').text(data.commit.author.name);
$('div.git_info .date').text(date);
$('div.git_info .message').text(data.commit.message);
$('div.git_info').slideDown();
});
} else {
GUI.log(chrome.i18n.getMessage('firmwareFlasherHexCorrupted'));
$('span.progressLabel').text(chrome.i18n.getMessage('firmwareFlasherHexCorrupted'));
}
});
}).fail(function () {
GUI.log(chrome.i18n.getMessage('firmwareFlasherFailedToLoadOnlineFirmware'));
$('span.progressLabel').text(chrome.i18n.getMessage('firmwareFlasherFailedToLoadOnlineFirmware'));
$('a.flash_firmware').addClass('locked');
});
$.get('https://api.github.com/repos/hydra/cleanflight/commits?page=1&per_page=1&path=obj/cleanflight_NAZE.hex', function (data) {
var data = data[0];
var d = new Date(data.commit.author.date);
var date = ('0' + (d.getMonth() + 1)).slice(-2) + '.' + ('0' + (d.getDate() + 1)).slice(-2) + '.' + d.getFullYear();
date += ' @ ' + ('0' + d.getHours()).slice(-2) + ':' + ('0' + d.getMinutes()).slice(-2);
$('div.git_info .committer').text(data.commit.author.name);
$('div.git_info .date').text(date);
$('div.git_info .message').text(data.commit.message);
$('div.git_info').slideDown();
});
});
$('a.flash_firmware').click(function () {
@ -111,9 +107,9 @@ TABS.firmware_flasher.initialize = function (callback) {
if (parsed_hex != false) {
if (String($('div#port-picker #port').val()) != 'DFU') {
if (String($('div#port-picker #port').val()) != '0') {
var options = {};
var port = String($('div#port-picker #port').val());
var baud;
var options = {},
port = String($('div#port-picker #port').val()),
baud;
switch (GUI.operating_system) {
case 'Windows':
@ -138,6 +134,10 @@ TABS.firmware_flasher.initialize = function (callback) {
options.erase_chip = true;
}
if ($('input.flash_slowly').is(':checked')) {
options.flash_slowly = true;
}
STM32.connect(port, baud, parsed_hex, options);
} else {
console.log('Please select valid serial port');
@ -147,7 +147,7 @@ TABS.firmware_flasher.initialize = function (callback) {
STM32DFU.connect(usbDevices.STM32DFU, parsed_hex);
}
} else {
GUI.log(chrome.i18n.getMessage('firmwareFlasherFirmwareNotLoaded'));
$('span.progressLabel').text(chrome.i18n.getMessage('firmwareFlasherFirmwareNotLoaded'));
}
}
}
@ -241,9 +241,20 @@ TABS.firmware_flasher.initialize = function (callback) {
// bind UI hook so the status is saved on change
$('input.erase_chip').change(function () {
var status = $(this).is(':checked');
chrome.storage.local.set({'erase_chip': $(this).is(':checked')});
});
});
chrome.storage.local.set({'erase_chip': status});
chrome.storage.local.get('flash_slowly', function (result) {
if (result.flash_slowly) {
$('input.flash_slowly').prop('checked', true);
} else {
$('input.flash_slowly').prop('checked', false);
}
// bind UI hook so the status is saved on change
$('input.flash_slowly').change(function () {
chrome.storage.local.set({'flash_slowly': $(this).is(':checked')});
});
});