@@ -140,6 +140,7 @@ function loadPropeller(sock, portName, action, payload, debug) {
140
140
updatePort ( port , { mode : "programming" , bSocket : sock } ) ;
141
141
connect = function ( ) { return Promise . resolve ( ) } ;
142
142
}
143
+ // let startTime = Date.now();
143
144
// Use connection to download application to the Propeller
144
145
connect ( )
145
146
. then ( function ( ) { listen ( port , true ) } ) //Enable listener
@@ -168,7 +169,9 @@ function loadPropeller(sock, portName, action, payload, debug) {
168
169
. catch ( function ( e ) { log ( e . message , mAll , sock , - 1 ) } )
169
170
. then ( function ( ) { if ( port . isWireless ) return closePort ( port , false ) } )
170
171
. catch ( function ( e ) { log ( e . message , mAll , sock , - 1 ) } )
172
+ // .then(function() {let stopTime = Date.now(); log('Processing time: ' + (stopTime-startTime).toString().slice(-5));})
171
173
. 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));})
172
175
. catch ( function ( ) { resumeTimedEvents ( ) } ) ;
173
176
} else {
174
177
// Port not found
@@ -825,7 +828,7 @@ function generateLoaderPacket(loaderType, packetId, clockSpeed, clockMode) {
825
828
fBitTime . setUint32 ( 0 , Math . round ( clockSpeed / finalBaudrate ) , true ) ; //Final Bit Time (baudrate in clock cycles)
826
829
bitTime1_5 . setUint32 ( 0 , Math . round ( ( ( 1.5 * clockSpeed ) / finalBaudrate ) - maxRxSenseError ) , true ) ; //1.5x Final Bit Time minus maximum start bit sense error
827
830
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)
829
832
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 }
830
833
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
831
834
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