1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-19 06:15:13 +03:00

log certain errors to the GUI's log to help with noticing hardware issues

This commit is contained in:
Kyle K 2019-07-08 00:58:32 +00:00
parent 083f3e31b0
commit 85b48b7ac4
2 changed files with 10 additions and 2 deletions

View file

@ -306,6 +306,13 @@
"message": "Show Log" "message": "Show Log"
}, },
"serialErrorFrameError": {
"message": "Serial connection error: bad framing"
},
"serialErrorParityError": {
"message": "Serial connection error: bad parity"
},
"serialPortOpened": { "serialPortOpened": {
"message": "Serial port <span class=\"message-positive\">successfully</span> opened with ID: $1" "message": "Serial port <span class=\"message-positive\">successfully</span> opened with ID: $1"
}, },

View file

@ -114,11 +114,12 @@ var serial = {
// We will do nothing. // We will do nothing.
break; break;
case 'frame_error':
case 'parity_error':
GUI.log(i18n.getMessage('serialError' + inflection.camelize(info.error)));
case 'break': // This seems to be the error that is thrown under NW.js in Windows when the device reboots after typing 'exit' in CLI case 'break': // This seems to be the error that is thrown under NW.js in Windows when the device reboots after typing 'exit' in CLI
case 'disconnected': case 'disconnected':
case 'device_lost': case 'device_lost':
case 'frame_error':
case 'parity_error':
default: default:
console.log("serial disconnecting: " + info.error); console.log("serial disconnecting: " + info.error);
CONFIG.armingDisabled = false; CONFIG.armingDisabled = false;