File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed
Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,21 @@ namespace user_interface_base {
8181 }
8282 }
8383
84+ public static tryToSend ( buf : Buffer ) {
85+ let received = false ;
86+ radio . onReceivedString ( ( _ : String ) => {
87+ received = true ;
88+ } )
89+
90+ let timePassed = 0 ;
91+ while ( ! received ) {
92+ if ( timePassed % 99 == 0 )
93+ radio . sendBuffer ( buf ) ;
94+ timePassed += 3 ;
95+ basic . pause ( 3 )
96+ }
97+ }
98+
8499
85100 public static getBuffer ( bitmap : Bitmap , chunkIndex : number , chunkSize : number ) : Buffer {
86101 const width = bitmap . width
@@ -129,9 +144,8 @@ namespace user_interface_base {
129144 // Send a chunk of the bitmap and wait for ACK, RX will rebuild the bitmap:
130145 for ( let j = 0 ; j < numberOfChunks ; j ++ ) {
131146 const rowBuffer = this . getBuffer ( bitmap , j , maxPacketBufferSize ) ;
132- radio . sendBuffer ( rowBuffer ) ;
133-
134- this . waitForAck ( ) ;
147+ // radio.sendBuffer(rowBuffer);
148+ this . tryToSend ( rowBuffer ) ;
135149 }
136150 this . bitmapCache . push ( bitmap ) ;
137151 }
You can’t perform that action at this time.
0 commit comments