Skip to content

Commit 6bb3ccf

Browse files
authored
some minor pioasm fixes for #1950 (#2056)
1 parent 8970241 commit 6bb3ccf

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

tools/pioasm/c_sdk_output.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ struct c_sdk_output : public output_format {
109109
fprintf(out, " .instructions = %sprogram_instructions,\n", prefix.c_str());
110110
fprintf(out, " .length = %d,\n", (int) program.instructions.size());
111111
fprintf(out, " .origin = %d,\n", program.origin.get());
112-
fprintf(out, " .pio_version = %d,\n", program.pio_version);
112+
fprintf(out, " .pio_version = %spio_version,\n", prefix.c_str());
113113
fprintf(out, "#if PICO_PIO_VERSION > 0\n");
114114
fprintf(out, " .used_gpio_ranges = 0x%x\n", program.used_gpio_ranges);
115115
fprintf(out, "#endif\n");

tools/pioasm/gen/parser.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,15 +1127,15 @@ namespace yy {
11271127
break;
11281128

11291129
case 22: // directive: ".in" value direction autop threshold
1130-
{ pioasm.get_current_program(yystack_[4].location, ".out", true).set_in(yylhs.location, yystack_[3].value.as < std::shared_ptr<resolvable> > (), yystack_[2].value.as < bool > (), yystack_[1].value.as < bool > (), yystack_[0].value.as < std::shared_ptr<resolvable> > ()); }
1130+
{ pioasm.get_current_program(yystack_[4].location, ".in", true).set_in(yylhs.location, yystack_[3].value.as < std::shared_ptr<resolvable> > (), yystack_[2].value.as < bool > (), yystack_[1].value.as < bool > (), yystack_[0].value.as < std::shared_ptr<resolvable> > ()); }
11311131
break;
11321132

11331133
case 23: // directive: ".out" value direction autop threshold
11341134
{ pioasm.get_current_program(yystack_[4].location, ".out", true).set_out(yylhs.location, yystack_[3].value.as < std::shared_ptr<resolvable> > (), yystack_[2].value.as < bool > (), yystack_[1].value.as < bool > (), yystack_[0].value.as < std::shared_ptr<resolvable> > ()); }
11351135
break;
11361136

11371137
case 24: // directive: ".set" value
1138-
{ pioasm.check_version(1, yylhs.location, ".in"); pioasm.get_current_program(yystack_[1].location, ".out", true).set_set_count(yylhs.location, yystack_[0].value.as < std::shared_ptr<resolvable> > ()); }
1138+
{ pioasm.get_current_program(yystack_[1].location, ".set", true).set_set_count(yylhs.location, yystack_[0].value.as < std::shared_ptr<resolvable> > ()); }
11391139
break;
11401140

11411141
case 25: // directive: ".wrap_target"

tools/pioasm/parser.yy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,9 @@ directive:
199199
| SIDE_SET value OPTIONAL { pioasm.get_current_program(@1, ".side_set", true).set_sideset(@$, $2, true, false); }
200200
| SIDE_SET value PINDIRS { pioasm.get_current_program(@1, ".side_set", true).set_sideset(@$, $2, false, true); }
201201
| SIDE_SET value { pioasm.get_current_program(@1, ".side_set", true).set_sideset(@$, $2, false, false); }
202-
| DOT_IN value direction autop threshold { pioasm.get_current_program(@1, ".out", true).set_in(@$, $2, $3, $4, $5); }
202+
| DOT_IN value direction autop threshold { pioasm.get_current_program(@1, ".in", true).set_in(@$, $2, $3, $4, $5); }
203203
| DOT_OUT value direction autop threshold { pioasm.get_current_program(@1, ".out", true).set_out(@$, $2, $3, $4, $5); }
204-
| DOT_SET value { pioasm.check_version(1, @$, ".in"); pioasm.get_current_program(@1, ".out", true).set_set_count(@$, $2); }
204+
| DOT_SET value { pioasm.get_current_program(@1, ".set", true).set_set_count(@$, $2); }
205205
| WRAP_TARGET { pioasm.get_current_program(@1, ".wrap_target").set_wrap_target(@$); }
206206
| WRAP { pioasm.get_current_program(@1, ".wrap").set_wrap(@$); }
207207
| WORD value { pioasm.get_current_program(@1, "instruction").add_instruction(std::shared_ptr<instruction>(new instr_word(@$, $2))); }

0 commit comments

Comments
 (0)