Avatar for Dennis

Dennis

Member since Feb 2015 • Last active May 2019
  • 13 conversations
  • 65 comments

Most recent activity

  • in Interfacing
    Avatar for Dennis

    You could name it W25 and have a list of devices that it has been confirmed to work with. I'm currently busy overseas and cannot contribute much, but I can continue to approve pull requests when they look alright. Thank you for these valuable contributions!

  • in Interfacing
    Avatar for Dennis

    I have been absent from Espruino for a while, but these chips are still around. Just recently I was looking for a cheap solution to hook up a non-volatile memory in the megabyte range to a circuit and mouser quickly brought these up again.

    Should I add people to the github repository so you can make the neccessary changes?

  • in Interfacing
    Avatar for Dennis

    Thank you for pointing this out. I don't usually read big chunks, so I never wondered about this. I committed this to the repository for people who may find it useful.

    It seems that function calls are very inefficient (otherwise this wouldn't be much faster than calling the read function in a loop). Do you know any way in Espruino's JavaScript to make it an inline call like it's possible in C?

    Another idea I had was changing the read method like this:

    Flash.prototype.read = this.spi.send;
    

    i.e. making the read property point directly to the property of the spi class. This seems a bit unclean but it may work and actually be faster. I don't have that chip right now, but maybe you can test.

    • 19 comments
    • 16,610 views
  • in General
    Avatar for Dennis

    I will try it! By the way, I see you are communicating over a tty device. I noticed that on my Mac, the tool recognizes only the cu ports but not the corresponding tty ports. The cu ports work, but I cannot have another terminal program connected and reading at the same time because access is exclusive.

  • in General
    Avatar for Dennis

    Cool, thanks :)

    I suppose the reason is that the WebIDE and the command-line tool share common code but they use it in different ways, and when the WebIDE was improved, this common code was changed in a way that breaks only the command-line tool but works for the WebIDE.

  • in General
    Avatar for Dennis

    I fixed another bug (see github discussion with @Gordon about my changes) and now finally I'm talking to Espruino.

    But for some reason I'm not getting the correct return values and console output from Espruino.

    I have a file foo.js:

    a=123;
    console.log(a+1);
    

    Now when I call espruino tool, I get the following:

    $ espruinotool -p /dev/cu.usbmodem1411 foo.js
    espruino-tools
    --------------
    
    Connecting to '/dev/cu.usbmodem1411'
    --]___
    --]|   __|_ -| . |  _| | | |   | . |
    --]|_____|___|  _|_| |___||_|_|___|
    --]          |_| http://espruino.com
    --] 1v81 Copyright 2015 G.Williams
    --]
    --]>
    --]=undefined
    --]>
    --]
    Connected
    --]=undefined
    

    I expected it to return 123 for the first statement, then write 124 to the console and then return undefined for the second statement. The console output is nowhere to be found and undefined is not the correct result. But if I now use WebIDE, I can verify that a really has the value 123, so the code has been executed.

  • in General
    Avatar for Dennis

    @the1laz: Yes!!! This is exactly what I need!

    But it won't run :( After I fixed a few bugs in the code that caused it to crash, espruinotool now at least reports an error that the port was not found. I called espruinotool -p /dev/tty.usbmodem1411 foo.js, but for some reason no ports are found at all (getPorts returns an empty array).

Actions