You are reading a single comment by @possmann and its replies. Click here to read the full conversation.
  • Just a little enhancement to reduce the code size: i guess its unnecessary to define the var fault. You stored the information in the object (see line 17.) why not use the object as default?

    trtn.fault = (d.charCodeAt(3) & 7);
        switch (trtn.fault) { ... }
    

    and you can combine these lines:

    var trtn={};
    trtn.temp=(d.charCodeAt(0)<<6 | d.charCodeAt(1)>>2)*0.25;
    trtn.fault=0;
    -------------------------
    var trtn={
        temp: (d.charCodeAt(0)<<6 | d.charCodeAt(1)>>2)*0.25
        fault: 0
    };
    

    Sorry, to be a little bit niggling :-) Memory is a limited resource! (it's hard to say this in a time of 2014)

About

Avatar for possmann @possmann started