def int2str(val, max_dec=1024):
    """Make string from int. Hexademical representaion will be used if input value greater that 'max_dec'."""
    if val > max_dec:
        return "0x%x" % val
    else:
        return "%d" % val