-
-
-
-
-
-
Hi Jscot,
Any news on your project ? In my projects i allways fighting against the memory usage. I wonder if Gorden could produce a board with this or another CPU to at leased double the memory. I'm sure that Gorden will address advanced users who likes a supported board with more memory. I also think that this premium could have it's price. This could help building more income.
Without such an option projects/users with more memory need will tend to tessel.
Happy Easter
Sacha
-
-
Hi Espruinos,
I used the flash memory module 'STM32F1Flash' successfull on the second attempt ;-). Take care about it. I bricked one espruino because of a typo. Ereased wrong memory. Is there some documentation how to install the bootloader ?
@Gordon Is there a reason why we do not have a minified version of this module ?
Happy Easter
Sacha
-
-
As i understand it, the connect function has to return a new object like this:
exports.connect = function(arg) {
return new Date(arg);
};
var Date=function(arg) {
this.value=arg;console.log('Its alle about Date: '+this.value);
};
Then you are able to create it like this:
var d1=require('date').connect('Object_1');
var d2=require('date').connect('Object_2');your output should be like this:
Its alle about Date: Object_1
Its alle about Date: Object_2Sacha
-
-
-
-
Hi Espruinos,
I just searching a proper way to detect if a variable is defined/exists without loosing memory. Yes it's all about memory....
I tried it in two ways:
if(variable !==undefined)
and
if(typeof variable !=='undefined')
Here is the memory loosing code:
test={}; console.log(process.memory()); for(i=0;i<1000;i++) { if(test['hello'+i]!==undefined) { console.log('hello'+i+' is defined'); } } console.log(process.memory()); Output: {"free":1780,"usage":20,"total":1800,"history":5,"stackEndAddress":536909512,"flash_start":134217728,"flash_binary_end":134432224,"flash_code_start":134443008,"flash_length":262144} {"free":778,"usage":1022,"total":1800,"history":18,"stackEndAddress":536909512,"flash_start":134217728,"flash_binary_end":134432224,"flash_code_start":134443008,"flash_length":262144}
Each test if the variable exists creates the variable as undefined and uses memory.
You will see it when you output the array like this:console.log(test);
Output:
{"hello0":undefined,"hello1":undefined,"hello2":undefined,"hello3"...........
Many thanks for your help
Sacha
-
Hi all,
I just want to let you know that the XBee module is rewritten, it uses now in most cases Uint8Array instead of simply arrays. Saves a lot of memory.
Consult the actual API documentation:
http://www.espruino.com/XBee-API1
Sacha
-
-
-
Hi Gordon,
I just run into "out of memory". I tried to figure out where it happend and what can i optimise to prevent this. I saw that i had around 300 units (Junks of 20 bytes) free before i called a few cascaded functions that converts a string into an array of bytes, calculates checksums length and returns it.
To understand the usage in general i run the following test:
console.log(process.memory());
str='Hi Gordon, a string with 80 characters, that will be converted to an array of B';
console.log(process.memory());Output:
{"free":1782,"usage":18,"total":1800,"history":3,"stackEndAddress":536909496,"flash_start":134217728,"flash_binary_end":134435552,"flash_code_start":134443008,"flash_length":262144}
{"free":1775,"usage":25,"total":1800,"history":14,"stackEndAddress":536909496,"flash_start":134217728,"flash_binary_end":134435552,"flash_code_start":134443008,"flash_length":262144}7*20 bytes=140 bytes for a string of 80 chars. Nothing special.
Now i created an array of 80 bytes this way:
console.log(process.memory());
bytes=[];
for (var i = 0; i < 80; ++i) { bytes.push(i); }
console.log(process.memory());The output:
{"free":1782,"usage":18,"total":1800,"history":3,"stackEndAddress":536909496,"flash_start":134217728,"flash_binary_end":134435552,"flash_code_start":134443008,"flash_length":262144}
{"free":1618,"usage":182,"total":1800,"history":15,"stackEndAddress":536909496,"flash_start":134217728,"flash_binary_end":134435552,"flash_code_start":134443008,"flash_length":262144}That array needs 164 chunks of 20 bytes = 3280 bytes, nearly 10% of the available memory!?
Is this as expected ?
Thanks
Sacha
-
-
Hi Gordon,
Proberly i found out and isolated why in WebIDE minify was not working. This code works without minify:
var ha=function(){ this.ok={}; self=this; };
Google Closure compiler fires an error:
JSC_CONSTANT_REASSIGNED_VALUE_ERROR: constant self assigned a value more than once at line 4 character 4 self=this;
The propper code should be:
var ha=function(){ this.ok={}; var self=this; };
Now minify is working in WebIDE too. We do not see if the minify process had some problem. Is there a way to see the log/output of the built in minifier ?
Thx
Sacha
-
Another small but nice feature from the old IDE was the "reload" source code button. If i changed the code in an external editor, it was reloaded that way pretty fast.
What makes it very hard, is that reloading the same file does not update it at all !
I have to load a different file and switch back to the first one to force a reload.Sacha
-
In the old IDE we saw to what COM port we are connected. If you have more than one Espruino connected at the same time, this feature was great. BTW multiconnection would be great. I wish we had "tabs" on the left side for each connected espruino.
EDIT: I now see the com port note "connected to port COMX". Maybe i did not saw this, sorry.
EDIT2: It will be overwritten, after uploading code.Sacha
-
I follow the tessel blog. There you can read that they are working on:
'Improving Wireless communications'
It could be that tessel has also some difficulties with the C3300.
Best regards
Sacha