def use_module(bld):
    bld.env.XCC_FLAGS = bld.env.XCC_FLAGS + [
        '-O3', '-DREF_CLK_FREQ=100', '-fasm-linenum', '-fcomment-asm',
        '-fsubword-select', '-DXUD_FULL_PIDTABLE=1'
    ]
    
    source = bld.path.ant_glob(
        [
            'src/**/*.xc', 'src/**/*.c', 'src/**/*.S'
        ],
        excl=[
            '**/descriptors_2.rst'
        ])
        
    depends_on = [
        'lib_logging(>=2.0.0)', 'lib_xassert(>=2.0.0)', 'lib_xud(>=1.0.0)'
    ]
    

    bld.env['XCC_FLAGS_endpoint0.c'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue']
    bld.env['XCC_FLAGS_dbcalc.xc'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue']
    bld.env['XCC_FLAGS_audiorequests.xc'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue']
    bld.env['XCC_FLAGS_flashlib_user.c'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue']
    bld.env['XCC_FLAGS_audioports.c'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue']
    bld.env['XCC_FLAGS_audioports.xc'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue']
    bld.env['XCC_FLAGS_dfu.xc'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue']
    bld.env['XCC_FLAGS_flash_interface.c'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue']

    
    bld.module(
        source=source,
        depends_on=depends_on,
        includes=['api'],
        optional_headers='xua_conf.h',
        version='1.0.0')
