Skip to content

Commit 2bc20cc

Browse files
authored
Merge pull request #46 from PropGit/Programming_Opti2
Programming Optimization and Reliability Enhancements
2 parents bad3626 + 0dc9408 commit 2bc20cc

File tree

3 files changed

+281
-196
lines changed

3 files changed

+281
-196
lines changed

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "BlocklyProp Launcher",
33
"description": "A Chrome application that connects your Propeller-Powered Hardware to the BlocklyProp website.",
4-
"version": "0.7.5",
4+
"version": "0.8.0",
55
"manifest_version": 2,
66
"minimum_chrome_version": "45",
77

messages.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,16 @@ notices = {
7979
[neRAMChecksumFailed] : "RAM checksum failed",
8080
[neEEPROMVerifyFailed] : "EEPROM verify failed",
8181
[neCommunicationLost] : "Communication lost", /*No response*/
82-
[neLoaderFailed] : "Loader failed",
82+
[neLoaderFailed] : "Loader failed", /*Response invalid*/
8383
[neCommunicationFailed] : "Communication failed" /*Response unexpected*/
8484
};
8585

8686
function notice(noticeId = 0, values = []) {
8787
/* Notice (message) retriever. Returns textual message indicated by the noticeId, inserts the optional values into it, and prepends with the noticeId value
8888
in the form ###-<message>.
8989
noticeId is the identifier of the notice; ex: nsDownloading.
90-
values is an optional array of values to stuff into notice.*/
91-
//Retrieve notice; if undefined,
90+
values is an optional array of values to stuff into notice, or if noticeId = 0, is a custom message.*/
91+
//Retrieve notice; if defined
9292
nMsg = notices[noticeId];
9393
//Fill in variables if needed; if notice undefined, use first values element as notice.
9494
values.forEach(function(x){nMsg = (nMsg) ? nMsg.replace(/%s/, x) : x;});
@@ -97,3 +97,8 @@ function notice(noticeId = 0, values = []) {
9797
nMsg = noticeId.substr(noticeId.length-3) + '-' + nMsg;
9898
return nMsg;
9999
}
100+
101+
function noticeCode(msg) {
102+
/*Extracts and returns notice code from msg formatted in the form ###-<message>. Returns "000" if none.*/
103+
return Number((results = msg.match(/[0-9]+/)) ? results[0] : "000");
104+
}

0 commit comments

Comments
 (0)