File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -270,8 +270,10 @@ const Comms = {
270270 console . log ( `<COMMS> Upload ${ f . name } => ${ JSON . stringify ( f . content . length > 50 ? f . content . substr ( 0 , 50 ) + "..." : f . content ) } (${ f . content . length } b${ uploadPacket ?", binary" :"" } )` ) ;
271271 if ( uploadPacket ) {
272272 Comms . getConnection ( ) . espruinoSendFile ( f . name , f . content , {
273- fs :Const . FILES_IN_FS ,
274- progress :( chunkNo , chunkCount ) => { Progress . show ( { percent : chunkNo * 100 / chunkCount } ) ; }
273+ fs : Const . FILES_IN_FS ,
274+ chunkSize : Const . PACKET_UPLOAD_CHUNKSIZE ,
275+ noACK : Const . PACKET_UPLOAD_NOACK ,
276+ progress : ( chunkNo , chunkCount ) => { Progress . show ( { percent : chunkNo * 100 / chunkCount } ) ; }
275277 } ) . then ( doUploadFiles ) ; // progress?
276278 } else {
277279 Comms . uploadCommandList ( f . cmd , currentBytes , maxBytes ) . then ( doUploadFiles ) ;
Original file line number Diff line number Diff line change @@ -38,6 +38,12 @@ const Const = {
3838 /* How many bytes of code to we attempt to upload in one go? */
3939 UPLOAD_CHUNKSIZE : 1024 ,
4040
41+ /* How many bytes of code to we attempt to upload when uploading via packets? */
42+ PACKET_UPLOAD_CHUNKSIZE : 2048 , // 1024 is the default for UART.js
43+
44+ /* when uploading by packets should we wait for an ack before sending the next packet? Only works if you're fully confident in flow control. */
45+ PACKET_UPLOAD_NOACK : false ,
46+
4147 /* Don't try and reset the device when we're connecting/sending apps */
4248 NO_RESET : false ,
4349
You can’t perform that action at this time.
0 commit comments