Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pico-sdk
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Microcontroller
pico-sdk
Commits
2d5789ec
Commit
2d5789ec
authored
4 years ago
by
graham sanderson
Committed by
Graham Sanderson
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
remove static order dependency
parent
8a4e21bd
Branches
Branches containing commit
Tags
1.0.1
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
tools/pioasm/main.cpp
+3
-3
3 additions, 3 deletions
tools/pioasm/main.cpp
tools/pioasm/output_format.h
+6
-2
6 additions, 2 deletions
tools/pioasm/output_format.h
tools/pioasm/pio_assembler.cpp
+1
-2
1 addition, 2 deletions
tools/pioasm/pio_assembler.cpp
with
10 additions
and
7 deletions
tools/pioasm/main.cpp
+
3
−
3
View file @
2d5789ec
...
@@ -18,7 +18,7 @@ void usage() {
...
@@ -18,7 +18,7 @@ void usage() {
std
::
cerr
<<
"
\n
"
;
std
::
cerr
<<
"
\n
"
;
std
::
cerr
<<
"options:
\n
"
;
std
::
cerr
<<
"options:
\n
"
;
std
::
cerr
<<
" -o <output_format> select output_format (default '"
<<
DEFAULT_OUTPUT_FORMAT
<<
"'); available options are:
\n
"
;
std
::
cerr
<<
" -o <output_format> select output_format (default '"
<<
DEFAULT_OUTPUT_FORMAT
<<
"'); available options are:
\n
"
;
for
(
const
auto
&
f
:
output_format
::
output_formats
)
{
for
(
const
auto
&
f
:
output_format
::
all
()
)
{
std
::
cerr
<<
" "
<<
f
->
name
<<
std
::
endl
;
std
::
cerr
<<
" "
<<
f
->
name
<<
std
::
endl
;
std
::
cerr
<<
" "
<<
f
->
get_description
()
<<
std
::
endl
;
std
::
cerr
<<
" "
<<
f
->
get_description
()
<<
std
::
endl
;
}
}
...
@@ -79,11 +79,11 @@ int main(int argc, char *argv[]) {
...
@@ -79,11 +79,11 @@ int main(int argc, char *argv[]) {
}
}
std
::
shared_ptr
<
output_format
>
oformat
;
std
::
shared_ptr
<
output_format
>
oformat
;
if
(
!
res
)
{
if
(
!
res
)
{
const
auto
&
e
=
std
::
find_if
(
output_format
::
output_formats
.
begin
(),
output_format
::
output_formats
.
end
(),
const
auto
&
e
=
std
::
find_if
(
output_format
::
all
()
.
begin
(),
output_format
::
all
()
.
end
(),
[
&
](
const
std
::
shared_ptr
<
output_format
>
&
f
)
{
[
&
](
const
std
::
shared_ptr
<
output_format
>
&
f
)
{
return
f
->
name
==
format
;
return
f
->
name
==
format
;
});
});
if
(
e
==
output_format
::
output_formats
.
end
())
{
if
(
e
==
output_format
::
all
()
.
end
())
{
std
::
cerr
<<
"error: unknown output format '"
<<
format
<<
"'"
<<
std
::
endl
;
std
::
cerr
<<
"error: unknown output format '"
<<
format
<<
"'"
<<
std
::
endl
;
res
=
1
;
res
=
1
;
}
else
{
}
else
{
...
...
This diff is collapsed.
Click to expand it.
tools/pioasm/output_format.h
+
6
−
2
View file @
2d5789ec
...
@@ -77,13 +77,12 @@ struct compiled_source {
...
@@ -77,13 +77,12 @@ struct compiled_source {
};
};
struct
output_format
{
struct
output_format
{
static
std
::
vector
<
std
::
shared_ptr
<
output_format
>>
output_formats
;
static
std
::
string
default_name
;
static
std
::
string
default_name
;
std
::
string
name
;
std
::
string
name
;
static
void
add
(
output_format
*
lang
)
{
static
void
add
(
output_format
*
lang
)
{
output_formats
.
push_back
(
std
::
shared_ptr
<
output_format
>
(
lang
));
all
()
.
push_back
(
std
::
shared_ptr
<
output_format
>
(
lang
));
}
}
virtual
int
output
(
std
::
string
destination
,
std
::
vector
<
std
::
string
>
output_options
,
virtual
int
output
(
std
::
string
destination
,
std
::
vector
<
std
::
string
>
output_options
,
...
@@ -93,6 +92,11 @@ struct output_format {
...
@@ -93,6 +92,11 @@ struct output_format {
FILE
*
open_single_output
(
std
::
string
destination
);
FILE
*
open_single_output
(
std
::
string
destination
);
virtual
~
output_format
()
=
default
;
virtual
~
output_format
()
=
default
;
static
std
::
vector
<
std
::
shared_ptr
<
output_format
>>&
all
()
{
static
std
::
vector
<
std
::
shared_ptr
<
output_format
>>
output_formats
;
return
output_formats
;
}
protected
:
protected
:
output_format
(
std
::
string
name
)
:
name
(
std
::
move
(
name
))
{}
output_format
(
std
::
string
name
)
:
name
(
std
::
move
(
name
))
{}
};
};
...
...
This diff is collapsed.
Click to expand it.
tools/pioasm/pio_assembler.cpp
+
1
−
2
View file @
2d5789ec
...
@@ -15,7 +15,6 @@
...
@@ -15,7 +15,6 @@
using
syntax_error
=
yy
::
parser
::
syntax_error
;
using
syntax_error
=
yy
::
parser
::
syntax_error
;
std
::
vector
<
std
::
shared_ptr
<
output_format
>>
output_format
::
output_formats
;
std
::
string
output_format
::
default_name
=
"c-sdk"
;
std
::
string
output_format
::
default_name
=
"c-sdk"
;
pio_assembler
::
pio_assembler
()
{
pio_assembler
::
pio_assembler
()
{
...
@@ -324,7 +323,7 @@ std::vector<compiled_source::symbol> pio_assembler::public_symbols(program &prog
...
@@ -324,7 +323,7 @@ std::vector<compiled_source::symbol> pio_assembler::public_symbols(program &prog
int
pio_assembler
::
write_output
()
{
int
pio_assembler
::
write_output
()
{
std
::
set
<
std
::
string
>
known_output_formats
;
std
::
set
<
std
::
string
>
known_output_formats
;
std
::
transform
(
output_format
::
output_formats
.
begin
(),
output_format
::
output_formats
.
end
(),
std
::
transform
(
output_format
::
all
()
.
begin
(),
output_format
::
all
()
.
end
(),
std
::
inserter
(
known_output_formats
,
known_output_formats
.
begin
()),
std
::
inserter
(
known_output_formats
,
known_output_formats
.
begin
()),
[
&
](
std
::
shared_ptr
<
output_format
>
&
f
)
{
[
&
](
std
::
shared_ptr
<
output_format
>
&
f
)
{
return
f
->
name
;
return
f
->
name
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment