pico-sdk icon indicating copy to clipboard operation
pico-sdk copied to clipboard

pioasm: .set not allowed for pio version 0

Open magy00 opened this issue 1 year ago • 0 comments

Resubmission of #1860:

test.pio:

.program test
.out 1 right 32
.set 1
$ ~/.pico-sdk/tools/2.0.0/pioasm/pioasm -v 0 test.pio
test.pio:3.1-6: PIO version 1 is required for '.in'
    3 | .set 1
      | ^~~~~~

Since .out also requires SDK 2.0, .set should probably also be allowed.

$ ~/.pico-sdk/tools/2.0.0/pioasm/pioasm -v 1 test.pio
// -------------------------------------------------- //
// This file is autogenerated by pioasm; do not edit! //
// -------------------------------------------------- //

#pragma once

#if !PICO_NO_HARDWARE
#include "hardware/pio.h"
#endif

// ---- //
// test //
// ---- //

#define test_wrap_target 0
#define test_wrap 0
#define test_pio_version 1

static const uint16_t test_program_instructions[] = {
};

#if !PICO_NO_HARDWARE
static const struct pio_program test_program = {
    .instructions = test_program_instructions,
    .length = 0,
    .origin = -1,
    .pio_version = 1,
#if PICO_PIO_VERSION > 0
    .used_gpio_ranges = 0x0
#endif
};

static inline pio_sm_config test_program_get_default_config(uint offset) {
    pio_sm_config c = pio_get_default_sm_config();
    sm_config_set_wrap(&c, offset + test_wrap_target, offset + test_wrap);
    sm_config_set_out_pin_count(&c, 1);
    sm_config_set_out_shift(&c, 1, 0, 32);
    sm_config_set_set_pin_count(&c, 1);
    return c;
}
#endif

And here

.pio_version = 1,

could possibly be

.pio_version = test_pio_version,

magy00 avatar Sep 25 '24 13:09 magy00