Skip to content

Commit 6fab39c

Browse files
Merge branch 'master' into mac_release_3
Local mac_release_2 branch was never merged back into mainline master. Master progressed with many critical improvements. Now it's time to merge mac work back in and build a release of v1.0.1 for macOS.
2 parents b2bbaed + 5bec301 commit 6fab39c

File tree

14 files changed

+326
-149
lines changed

14 files changed

+326
-149
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ chromestore/* filter=lfs diff=lfs merge=lfs -text
22
*.ico filter=lfs diff=lfs merge=lfs -text
33
*.icns filter=lfs diff=lfs merge=lfs -text
44
*.bmp filter=lfs diff=lfs merge=lfs -text
5+
*.png filter=lfs diff=lfs merge=lfs -text
56
*.psd filter=lfs diff=lfs merge=lfs -text
67
*.exe filter=lfs diff=lfs merge=lfs -text
78
package/win-resources/nwjs/nwjs-v*.exe filter=lfs diff=lfs merge=lfs -text

assets/BlocklyProp-Splash.png

95.3 KB
Loading

chromestore/icon_beta_128.png

Lines changed: 3 additions & 0 deletions
Loading

index.css

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,6 @@ body {
122122
font-size: 20px;
123123
}
124124

125-
.button-label-small {
126-
font-size: 14px;
127-
}
128-
129125
.button {
130126
width: 150px;
131127
border: none;
@@ -262,9 +258,15 @@ body {
262258
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
263259
}
264260

265-
/*-------------*/
266-
/* App version */
267-
/*-------------*/
261+
/*--------------------*/
262+
/* App OS and version */
263+
/*--------------------*/
264+
265+
.os {
266+
color: #999999;
267+
font-size: 16px;
268+
font-weight: bold;
269+
}
268270

269271
.version {
270272
color: #999999;

index.html

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
</tr>
3535
<tr>
3636
<td>Verbose Logging:</td>
37-
<td colspan="2"><input type="checkbox" id="bpc-trace"/></td>
37+
<td colspan="2"><input type="checkbox" id="verbose-logging"/></td>
3838
</tr>
3939
<tr>
4040
<td colspan="3"><div id="log" class="con"></div></td>
@@ -68,37 +68,32 @@
6868
</table>
6969
</div>
7070

71-
<div style="top:70px;" class="button-label">
71+
<div style="top:95px;" class="button-label">
7272
Open Browser:
7373
</div>
74-
<div style="position:absolute; top:100px; left:325px;">
74+
<div style="position:absolute; top:125px; left:325px;">
7575
<button id="open-blocklypropsolo" class="button button-open">BlocklyProp Solo<span class="tooltip">No login required</span></button>
7676
</div>
77-
<div style="top:142px;" class="button-label button-label-small">
78-
--or--
79-
</div>
80-
<div style="position:absolute; top:162px; left:325px;">
81-
<button id="open-blocklyprop" class="button button-open">BlocklyProp<span class="tooltip">Login required</span></button>
82-
</div>
83-
<div style="top:220px;" class="button-label">
77+
<div style="top:195px;" class="button-label">
8478
Status:
8579
</div>
86-
<div style="position:absolute; top:250px; left:325px;">
80+
<div style="position:absolute; top:225px; left:325px;">
8781
<div>
8882
<span id="sys-connected" class="status status-green" style="opacity:0.0;">&#10004; Connected</span>
8983
<span id="sys-waiting" class="status status-clear" style="opacity:1.0; position:absolute; top: 0px; left: 0px;">Waiting to<br>connect...<span class="tooltip">To connect:<br>Open browser to desired<br>site, then navigate to<br>View/Edit project code</span></span>
9084
</div>
9185
</div>
92-
<div style="position:absolute; top:380px; left:240px;">
86+
<div style="position:absolute; top:377px; left:149px;">
87+
<span id="for-os" class="os">for Windows</span>
88+
</div>
89+
<div style="position:absolute; top:356px; left:262px;">
9390
<span id="version-text" class="version">v0.0.0</span>
9491
</div>
9592
<div style="position:absolute; top:350px; left:435px;">
9693
<button id="open-settings" class="button settings">
9794
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-100 -350 1650 1700" width="20" height="20" style="fill:#ddd;"><path d="m1024 640q0 106-75 181-75 75-181 75-106 0-181-75-75-75-75-181 0-106 75-181 75-75 181-75 106 0 181 75 75 75 75 181zm512 109V527q0-12-8-23-8-11-20-13l-185-28q-19-54-39-91 35-50 107-138 10-12 10-25 0-13-9-23-27-37-99-108-72-71-94-71-12 0-26 9l-138 108q-44-23-91-38-16-136-29-186-7-28-36-28H657q-14 0-24 9Q622-111 621-98L593 86q-49 16-90 37L362 16Q352 7 337 7 323 7 312 18 186 132 147 186q-7 10-7 23 0 12 8 23 15 21 51 67 36 46 54 71-27 50-41 99L29 495Q16 497 8 508 0 518 0 531v222q0 12 8 23 8 11 19 13l186 28q14 46 39 92-40 57-107 138-10 12-10 24 0 10 9 23 26 36 99 108 73 72 95 72 13 0 26-10l138-107q44 23 91 38 16 136 29 186 7 28 36 28h222q14 0 25-8Q914 1391 915 1378l28-184q49-16 90-37l142 107q9 9 24 9 13 0 25-10 129-119 165-170 7-8 7-22 0-12-8-23-15-21-51-66-36-45-54-70 26-50 41-98l183-28q13-2 21-12 8-10 8-23z"/></svg>
9895
</button>
9996
</div>
100-
101-
10297

10398
</body>
10499
</html>

index.js

Lines changed: 235 additions & 74 deletions
Large diffs are not rendered by default.

loader.js

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ function loadPropeller(sock, portName, action, payload, debug) {
120120
let connect;
121121
let originalBaudrate;
122122

123+
// Halt timed events that may interfere with download
124+
haltTimedEvents();
125+
123126
if (port.isWired) {
124127
if (port.connId) {
125128
// Connection exists, prep to reuse it
@@ -140,34 +143,37 @@ function loadPropeller(sock, portName, action, payload, debug) {
140143
// Use connection to download application to the Propeller
141144
connect()
142145
.then(function() {listen(port, true)}) //Enable listener
143-
.then(function() {log(notice(000, ["Scanning port " + portName]), mUser, sock)}) //Notify what port we're using
146+
.then(function() {log(notice(000, ["Scanning port " + portName]), mUser, sock, -1)}) //Notify what port we're using
144147
.then(function() {return talkToProp(sock, port, binImage, action === 'EEPROM')}) //Download user application to RAM or EEPROM
145148
.then(function() {return changeBaudrate(port, originalBaudrate)}) //Restore original baudrate
146149
.then(function() { //Success! Open terminal or graph if necessary
147150
listen(port, false); //Disable listener
148151
port.mode = (debug !== "none") ? "debug" : "programming";
149-
log(notice(nsDownloadSuccessful), mAll, sock);
152+
log(notice(nsDownloadSuccessful), mAll, sock, -1);
150153
if (sock && debug !== "none") { //If debug needed, open terminal/graph
151154
sock.send(JSON.stringify({type:"ui-command", action:(debug === "term") ? "open-terminal" : "open-graph"}));
152155
sock.send(JSON.stringify({type:"ui-command", action:"close-compile"}));
153156
} else { //Else
154157
updatePort(port, {mode: "none"}); // Clear port mode
155-
if (port.isWireless) closePort(port, false).catch(function(e) {log(e.message, mAll, sock);}) // Close Telnet port (if wireless)
158+
if (port.isWireless) closePort(port, false).catch(function(e) {log(e.message, mAll, sock, -1);})// Close Telnet port (if wireless)
156159
}
157160
}) //Error? Disable listener and display error
158161
.catch(function(e) {
159162
listen(port, false);
160-
log(e.message, mAll, sock);
161-
log(notice(neDownloadFailed), mAll, sock);
163+
log(e.message, mAll, sock, -1);
164+
log(notice(neDownloadFailed), mAll, sock, -1);
162165
updatePort(port, {mode: "none"});
163166
if ((port.isWired && port.connId) || port.isWireless) {return changeBaudrate(port, originalBaudrate)}
164167
})
165-
.catch(function(e) {log(e.message, mAll, sock)})
168+
.catch(function(e) {log(e.message, mAll, sock, -1)})
166169
.then(function() {if (port.isWireless) return closePort(port, false)})
167-
.catch(function(e) {log(e.message, mAll, sock);});
170+
.catch(function(e) {log(e.message, mAll, sock, -1)})
171+
.then(function() {resumeTimedEvents()}) // Resume timed events that were halted earlier
172+
.catch(function() {resumeTimedEvents()});
168173
} else {
169174
// Port not found
170-
log(notice(neCanNotFindPort, [portName]), mAll, sock);
175+
log(notice(neCanNotFindPort, [portName]), mAll, sock, -1);
176+
log(notice(neDownloadFailed), mAll, sock, -1);
171177
}
172178
}
173179

@@ -274,15 +280,15 @@ function talkToProp(sock, port, binImage, toEEPROM) {
274280
}
275281
//Prep for expected packetID:transmissionId response (Micro-Boot-Loader's "Ready" signal)
276282
propComm.mblEPacketId[0] = packetId;
277-
propComm.mblETransId[0] = 0; //MBL transmission's Id is always 0
283+
propComm.mblETransId[0] = 0; //MBL transmission's Id is always 0
278284
//Send Micro Boot Loader package and get response; if wired port, unpause (may be auto-paused by incoming data error); wireless ports, carry on immediately
279285
log("Transmitting Micro Boot Loader package", mDeep);
280286
send(port, txData, true)
281-
.then(function() {if (port.isWired) {return unPause(port)}}) //Unpause port (if wired)
282-
.then(function() {return propComm.response}) //Wait for response (may timeout with rejection)
283-
.then(function() {log(notice(000, ["Found Propeller"]), mUser+mDbug, sock)}) //Succeeded!
287+
.then(function() {if (port.isWired) {return unPause(port)}}) //Unpause port (if wired)
288+
.then(function() {return propComm.response}) //Wait for response (may timeout with rejection)
289+
.then(function() {log(notice(000, ["Found Propeller"]), mUser+mDbug, sock, -1)}) //Succeeded!
284290
.then(function() {return resolve()})
285-
.catch(function(e) {return reject(e)}); //Failed!
291+
.catch(function(e) {return reject(e)}); //Failed!
286292
});
287293
}
288294

@@ -320,16 +326,17 @@ function talkToProp(sock, port, binImage, toEEPROM) {
320326

321327
return new Promise(function(resolve, reject) {
322328
log((totalPackets-packetId+1) + " of " + totalPackets, mDbug);
323-
log(notice(nsDownloading), mUser, sock);
329+
log(notice(nsDownloading), mUser, sock, -1);
324330
prepForMBLResponse(userDeliveryTime, notice(neCommunicationLost));
325331
var txPacketLength = 2 + //Determine packet length (in longs); header + packet limit or remaining data length
326332
Math.min(Math.trunc(maxDataSize / 4) - 2, Math.trunc(binImage.byteLength / 4) - pIdx);
327-
txData = new ArrayBuffer(txPacketLength * 4); //Set packet length (in longs)}
333+
txData = new ArrayBuffer(txPacketLength * 4); //Set packet length (in longs)}
328334
txView = new Uint8Array(txData);
329335
propComm.mblEPacketId[0] = packetId-1; //Set next expected packetId
330-
propComm.mblETransId[0] = Math.floor(Math.random()*4294967296); //Set next random Transmission ID
336+
propComm.mblETransId[0] = Math.floor(Math.random()*4294967296); //Set next random Transmission ID
331337
(new DataView(txData, 0, 4)).setUint32(0, packetId, true); //Store Packet ID
332338
(new DataView(txData, 4, 4)).setUint32(0, propComm.mblETransId[0], true); //Store random Transmission ID
339+
//log('Sending PID/TID: '+txView.subarray(0, 4)+'/'+txView.subarray(4, 8), mDeep);
333340
txView.set((new Uint8Array(binImage)).slice(pIdx * 4, pIdx * 4 + (txPacketLength - 2) * 4), 8); //Store section of binary image
334341
send(port, txData, false) //Transmit packet
335342
.then(function() {pIdx += txPacketLength - 2; packetId--; resolve();}); //Increment image index, decrement Packet ID (to next packet), resolve
@@ -361,7 +368,7 @@ function talkToProp(sock, port, binImage, toEEPROM) {
361368
function sendInstructionPacket() {
362369
return new Promise(function(resolve, reject) {
363370
next = instPacket.next();
364-
log(next.value.sendLog, mAll, sock);
371+
log(next.value.sendLog, mAll, sock, -1);
365372

366373
generateLoaderPacket(next.value.type, packetId); //Generate next executable packet
367374

@@ -390,7 +397,7 @@ function talkToProp(sock, port, binImage, toEEPROM) {
390397
}
391398

392399
//Set up continuous progress indicator during this phase
393-
progress = setInterval(function() {log(notice(nsDownloading), mUser, sock)}, 1000);
400+
progress = setInterval(log, 1000, notice(nsDownloading), mUser, sock);
394401

395402
sendInstructionPacket()
396403
.then(function() {clearInterval(progress); return resolve();})
@@ -454,8 +461,7 @@ function hearFromProp(info) {
454461

455462
// Parse HTTP-command responses into proper object, or treat wired and Telnet-wireless streams as an unformatted array
456463
let stream = (dataSource === dsHTTP) ? parseHTTP(info.data) : new Uint8Array(info.data)
457-
log("Received " + info.data.byteLength + " bytes", mDeep);
458-
// console.log(stream);
464+
//log("Received " + info.data.byteLength + " bytes:" + ((info.data.byteLength < 9) ? " " : "\n") + stream.toString(), mDeep);
459465

460466
var sIdx = 0;
461467

@@ -819,7 +825,7 @@ function generateLoaderPacket(loaderType, packetId, clockSpeed, clockMode) {
819825
fBitTime.setUint32(0, Math.round(clockSpeed / finalBaudrate), true); //Final Bit Time (baudrate in clock cycles)
820826
bitTime1_5.setUint32(0, Math.round(((1.5 * clockSpeed) / finalBaudrate) - maxRxSenseError), true); //1.5x Final Bit Time minus maximum start bit sense error
821827
failsafe.setUint32(0, 2 * Math.trunc(clockSpeed / (3 * 4)), true); //Failsafe Timeout (seconds-worth of Loader's Receive loop iterations)
822-
endOfPacket.setUint32(0, Math.round(2 * clockSpeed / finalBaudrate * 10 / 12), true); //EndOfPacket Timeout (2 bytes worth of Loader's Receive loop iterations)
828+
endOfPacket.setUint32(0, Math.round(500 * clockSpeed / finalBaudrate * 10 / 12), true); //EndOfPacket Timeout (500 bytes worth of Loader's Receive loop iterations)
823829
sTime.setUint32(0, Math.max(Math.round(clockSpeed * 0.0000006), 14), true); //Minimum EEPROM Start/Stop Condition setup/hold time (400 KHz = 1/0.6 µS); Minimum 14 cycles}
824830
sclHighTime.setUint32(0, Math.max(Math.round(clockSpeed * 0.0000006), 14), true); //Minimum EEPROM SCL high time (400 KHz = 1/0.6 µS); Minimum 14 cycles
825831
sclLowTime.setUint32(0, Math.max(Math.round(clockSpeed * 0.0000013), 14), true); //Minimum EEPROM SCL low time (400 KHz = 1/1.3 µS); Minimum 26 cycles

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.11.2",
4+
"version": "1.0.1",
55
"manifest_version": 2,
66
"minimum_chrome_version": "45",
77

package/blocklyproplauncher-installer.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#define MyAppName "BlocklyProp Launcher"
55
#define MyAppStartMenuName "BlocklyProp"
6-
#define MyAppVersion "0.11.2"
6+
#define MyAppVersion "1.0.1"
77
#define MyAppPublisher "Parallax Inc."
88
#define MyAppStartMenu "Parallax Inc"
99
#define MyAppURL "http://blockly.parallax.com/"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:842021cf8e254bff1df280818013ad936d132d3d028749a78532dabbaaea2858
2+
oid sha256:8c6656cce46e85dc9a4014e869fced1227d4154cfc76e53ac93bebf3af1d8f8b
33
size 2087424

0 commit comments

Comments
 (0)