Пример #1
0
def test_read_profile(jsonfile):
    classes = globals()
    XObject.set_classes(classes)
    parser = ProfileParser()
    parser.read_profile(jsonfile)

    boards = Profile.get_boards()
    boards[power_profile['id']] = power_profile

    assert len(Profile.get_extendio()) == 1
    assert len(Profile.get_busswitch()) == 9
    assert len(Profile.get_eeprom()) == 8
    assert len(Profile.get_boards()) == 5
    assert len(Profile.get_buses()) == 8
    assert len(Profile.get_chips()) == 12
Пример #2
0
        time.sleep(1)
        gpio.write_value(0)
        time.sleep(1)


if __name__ == '__main__':
    utility.register_signal_handle()
    ee_daemon = daemon.Daemon("ee")
    ee_daemon.start()
    logger.init("ee.log")
    logger.setLevel('WARNING')
    '''
    解决在xobj模块中引用chip和board类导致相互引用错误
    '''
    classes = globals()
    XObject.set_classes(classes)

    jsonfile = utility.get_profile_path() + "/Hardware_Function_Profile.json"
    parser = ProfileParser()
    ret = parser.read_profile(jsonfile)
    if ret is False:
        #print 'error parser profile fail'
        os._exit(ret)

    ret = ee.initializer.init()
    if ret is False:
        logger.boot("init project fail")
        #os._exit(ret)
    ee = EmbeddedEngine()

    led = Thread(target=led_flicker)