unsafe public static bool flash(byte[] program, bool fastmode = false, int timeout = 10, bool run = false) { Managed_USB foo = new Managed_USB(); fixed(byte *x = &program[0]) { return(foo.Flash(x, program.Length, fastmode, timeout, run)); } }
unsafe static private bool flash(byte[] program) { Managed_USB musb = new Managed_USB(); Managed_USB.ProgressChanged += onUpdate; Managed_USB.TextUpdate += onUpdateText; fixed(byte *x = &program[0]) { return(musb.Flash(x, program.Length, FastMode, TimeOut, Run)); } }