def easy_batch_write(p3):
    boards = get_boards()
    if len(boards.keys()) == 0:
        print "No boards found"
        return
    set_bootloader_eeprom(boards, p3)
    time.sleep(1.0)
    m3t.load_m3ec_kmod()
    bld = m3.m3_bootloader.M3Bootloader()
    bld.SetVerbose(1)
    boards = batch_startup(bld, boards)
    bords = batch_ping(bld, boards)
    boards = batch_write(bld, boards)
    for k in boards.keys():
        print "Write success", k, " : ", boards[k]["write_success"]
    bld.Shutdown()
    m3t.unload_m3ec_kmod()
    time.sleep(1.0)
    restore_board_eeprom(boards, p3)
Ejemplo n.º 2
0
def easy_batch_write(p3):
    boards = get_boards()
    if len(boards.keys()) == 0:
        print 'No boards found'
        return
    set_bootloader_eeprom(boards, p3)
    time.sleep(1.0)
    m3t.load_m3ec_kmod()
    bld = m3.m3_bootloader.M3Bootloader()
    bld.SetVerbose(1)
    boards = batch_startup(bld, boards)
    bords = batch_ping(bld, boards)
    boards = batch_write(bld, boards)
    for k in boards.keys():
        print 'Write success', k, ' : ', boards[k]['write_success']
    bld.Shutdown()
    m3t.unload_m3ec_kmod()
    time.sleep(1.0)
    restore_board_eeprom(boards, p3)
                ):
                    if c == "d":
                        display_boards(boards)
                    if c == "s":
                        m3t.load_m3ec_kmod()
                        unload = True
                        boards = batch_startup(bld, boards)
                    if c == "l":
                        list_slaves()
                    if c == "e":
                        easy_batch_write(bld, boards)
                        unload = False
                    if c == "w":
                        boards = batch_write(bld, boards)
                    if c == "p":
                        boards = batch_ping(bld, boards)
                    if c == "r":
                        m3t.unload_m3ec_kmod()
                        unload = False
                        restore_board_eeprom(boards, p3)
                    if c == "b":
                        set_bootloader_eeprom(boards, p3)
                    if c == "q":
                        break
                else:
                    print "Invalid command"
        except (KeyboardInterrupt, EOFError):
            pass
        if unload:
            m3t.unload_m3ec_kmod()
Ejemplo n.º 4
0
                if c == 'q' or c == 'w' or c == 'p' or c == 'l' or c == 'r' or c == 'b' or c == 'e' or c == 's' or c == 'd':
                    if c == 'd':
                        display_boards(boards)
                    if c == 's':
                        m3t.load_m3ec_kmod()
                        unload = True
                        boards = batch_startup(bld, boards)
                    if c == 'l':
                        list_slaves()
                    if c == 'e':
                        easy_batch_write(bld, boards)
                        unload = False
                    if c == 'w':
                        boards = batch_write(bld, boards)
                    if c == 'p':
                        boards = batch_ping(bld, boards)
                    if c == 'r':
                        m3t.unload_m3ec_kmod()
                        unload = False
                        restore_board_eeprom(boards, p3)
                    if c == 'b':
                        set_bootloader_eeprom(boards, p3)
                    if c == 'q':
                        break
                else:
                    print 'Invalid command'
        except (KeyboardInterrupt, EOFError):
            pass
        if unload:
            m3t.unload_m3ec_kmod()