Select Git revision
-
Dean Camera authored
Fixed MassStorage based demos and projects resetting the SCSI sense values before the command is executed, leading to missed SCSI sense values when the host retrieves the sense key (thanks to Martin Degelsegger). Added missing DataflashManager_CheckDataflashOperation() function to the MassStorageKeyboard demo, removed redundant SCSI_Codes.h file as these values are part of the MassStorage Class Driver.
Dean Camera authoredFixed MassStorage based demos and projects resetting the SCSI sense values before the command is executed, leading to missed SCSI sense values when the host retrieves the sense key (thanks to Martin Degelsegger). Added missing DataflashManager_CheckDataflashOperation() function to the MassStorageKeyboard demo, removed redundant SCSI_Codes.h file as these values are part of the MassStorage Class Driver.
worker.js 1.70 KiB
/**
* Created by aghassaei on 1/12/15.
*/
function myWorker(){
//local variables
var localEnv = null;//local variables passed in from outside
var working = false;//boolean that says whether I'm busy or not
var arg = null;//main data we are crunching
var modelMesh = null;//hold on to this so we don't have to keep passing it in
self.onmessage = function(e) {
var data = e.data;
if (data.url) {
var url = data.url;
var index = url.indexOf('index.html');//url of landing page
if (index != -1) {
url = url.substring(0, index);
}
//load all scripts
// importScripts(url + 'dependencies/three.js');
// importScripts(url + 'js/models/dmaBeam.js');
}
//
if (data.model){
//var material = new THREE.MeshBasicMaterial({side:THREE.DoubleSide});
//modelMesh = new THREE.Mesh(JSON.parse(data.model), material);
}
if (data.executable){
if (data.localEnv){//be sure to get local environment vars before executable runs
localEnv = JSON.parse(data.localEnv);
}
if (data.arg){//be sure to get arg before executable runs
arg = data.arg;
}
if (working) {
console.log("problem here, already working on something else");
return;
}
working = true;
eval(data.executable);
var result = executable(arg);
working = false;
postMessage({result:result, isWorking:working});
}
if (data.isWorking){
postMessage({isWorking:working});
}
};
}