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

Function hard_reboot

LoadFile/teensy_loader_cli.c:311–333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

309}
310
311int hard_reboot()
312{
313 struct libusb_device_handle *rebootor;
314 int r;
315
316 rebootor = open_usb_device( 0x16C0, 0x0477 );
317
318 if (!rebootor)
319 return 0;
320
321 r = libusb_control_transfer( rebootor,
322 0x21, 9, 0x0200, 0,
323 (unsigned char*)"reboot", 6,
324 100 );
325
326 libusb_release_interface( rebootor, 0 );
327 libusb_close( rebootor );
328
329 if (r < 0)
330 return 0;
331
332 return 1;
333}
334
335#endif
336

Callers 1

mainFunction · 0.85

Calls 3

open_usb_deviceFunction · 0.85
close_usb_deviceFunction · 0.85
delayFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…