MCPcopy Create free account
hub / github.com/kiibohd/controller / teensy_write

Function teensy_write

LoadFile/teensy_loader_cli.c:276–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

274}
275
276int teensy_write( void *buf, int len, double timeout )
277{
278 int r;
279
280 if ( !libusb_teensy_handle )
281 return 0;
282
283 while ( timeout > 0 ) {
284 r = libusb_control_transfer( libusb_teensy_handle,
285 0x21, 9, 0x0200, 0,
286 (unsigned char *)buf, len,
287 (int)(timeout * 1000.0) );
288
289 if ( r >= 0 )
290 return 1;
291
292 //printf("teensy_write, r=%d\n", r);
293 usleep( 10000 );
294 timeout -= 0.01; // TODO: subtract actual elapsed time
295 }
296
297 return 0;
298}
299
300void teensy_close()
301{

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…