File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -338,12 +338,19 @@ class WebSerial extends EventTarget {
338
338
}
339
339
340
340
async batchWrite ( data ) {
341
+ // AT32 on macOS requires smaller chunks (63 bytes) to work correctly due to
342
+ // USB buffer size limitations in the macOS implementation
341
343
const batchWriteSize = 63 ;
342
344
let remainingData = data ;
343
345
while ( remainingData . byteLength > batchWriteSize ) {
344
346
const sliceData = remainingData . slice ( 0 , batchWriteSize ) ;
345
347
remainingData = remainingData . slice ( batchWriteSize ) ;
346
- await this . writer . write ( sliceData ) ;
348
+ try {
349
+ await this . writer . write ( sliceData ) ;
350
+ } catch ( error ) {
351
+ console . error ( `${ this . logHead } Error writing batch chunk:` , error ) ;
352
+ throw error ; // Re-throw to be caught by the send method
353
+ }
347
354
}
348
355
await this . writer . write ( remainingData ) ;
349
356
}
You can’t perform that action at this time.
0 commit comments