@@ -140,6 +140,7 @@ function loadPropeller(sock, portName, action, payload, debug) {
140140            updatePort ( port ,  { mode : "programming" ,  bSocket : sock } ) ; 
141141            connect  =  function ( )  { return  Promise . resolve ( ) } ; 
142142        } 
143+   //      let startTime = Date.now(); 
143144        // Use connection to download application to the Propeller 
144145        connect ( ) 
145146            . then ( function ( )  { listen ( port ,  true ) } )                                                                   //Enable listener 
@@ -168,7 +169,9 @@ function loadPropeller(sock, portName, action, payload, debug) {
168169            . catch ( function ( e )  { log ( e . message ,  mAll ,  sock ,  - 1 ) } ) 
169170            . then ( function ( )  { if  ( port . isWireless )  return  closePort ( port ,  false ) } ) 
170171            . catch ( function ( e )  { log ( e . message ,  mAll ,  sock ,  - 1 ) } ) 
172+ //            .then(function() {let stopTime = Date.now(); log('Processing time: ' + (stopTime-startTime).toString().slice(-5));}) 
171173            . then ( function ( )  { resumeTimedEvents ( ) } )                                                                  // Resume timed events that were halted earlier 
174+ //            .catch(function() {let stopTime = Date.now(); log('Processing time: ' + (stopTime-startTime).toString().slice(-5));}) 
172175            . catch ( function ( )  { resumeTimedEvents ( ) } ) ; 
173176    }  else  { 
174177        // Port not found 
@@ -825,7 +828,7 @@ function generateLoaderPacket(loaderType, packetId, clockSpeed, clockMode) {
825828        fBitTime . setUint32 ( 0 ,  Math . round ( clockSpeed  /  finalBaudrate ) ,  true ) ;                    //Final Bit Time (baudrate in clock cycles) 
826829        bitTime1_5 . setUint32 ( 0 ,  Math . round ( ( ( 1.5  *  clockSpeed )  /  finalBaudrate )  -  maxRxSenseError ) ,  true ) ;   //1.5x Final Bit Time minus maximum start bit sense error 
827830        failsafe . setUint32 ( 0 ,  2  *  Math . trunc ( clockSpeed  /  ( 3  *  4 ) ) ,  true ) ;                      //Failsafe Timeout (seconds-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) 
831+         endOfPacket . setUint32 ( 0 ,  Math . round ( 1000  *  clockSpeed  /  finalBaudrate  *  10  /  12 ) ,  true ) ;   //EndOfPacket Timeout (1000  bytes worth of Loader's Receive loop iterations) 
829832        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 } 
830833        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 
831834        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 
0 commit comments