Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
flow3r firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
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
dos
flow3r firmware
Commits
d7a7a30a
Commit
d7a7a30a
authored
11 years ago
by
Damien
Browse files
Options
Downloads
Patches
Plain Diff
Make pfenv's const so they go in .text section.
parent
1595f325
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
stm/printf.c
+6
-6
6 additions, 6 deletions
stm/printf.c
with
6 additions
and
6 deletions
stm/printf.c
+
6
−
6
View file @
d7a7a30a
...
@@ -19,9 +19,9 @@ typedef struct _pfenv_t {
...
@@ -19,9 +19,9 @@ typedef struct _pfenv_t {
static
void
print_str_dummy
(
void
*
data
,
const
char
*
str
,
unsigned
int
len
)
{
static
void
print_str_dummy
(
void
*
data
,
const
char
*
str
,
unsigned
int
len
)
{
}
}
pfenv_t
pfenv_dummy
=
{
0
,
print_str_dummy
};
const
pfenv_t
pfenv_dummy
=
{
0
,
print_str_dummy
};
static
int
pfenv_print_strn
(
pfenv_t
*
pfenv
,
const
char
*
str
,
unsigned
int
len
,
int
flags
,
int
width
)
{
static
int
pfenv_print_strn
(
const
pfenv_t
*
pfenv
,
const
char
*
str
,
unsigned
int
len
,
int
flags
,
int
width
)
{
int
pad
=
width
-
len
;
int
pad
=
width
-
len
;
if
(
pad
>
0
&&
(
flags
&
PF_FLAG_LEFT_ADJUST
)
==
0
)
{
if
(
pad
>
0
&&
(
flags
&
PF_FLAG_LEFT_ADJUST
)
==
0
)
{
while
(
pad
>
0
)
{
while
(
pad
>
0
)
{
...
@@ -46,7 +46,7 @@ static int pfenv_print_strn(pfenv_t *pfenv, const char *str, unsigned int len, i
...
@@ -46,7 +46,7 @@ static int pfenv_print_strn(pfenv_t *pfenv, const char *str, unsigned int len, i
// enough room for 32 signed number
// enough room for 32 signed number
#define INT_BUF_SIZE (12)
#define INT_BUF_SIZE (12)
static
int
pfenv_print_int
(
pfenv_t
*
pfenv
,
unsigned
int
x
,
int
sgn
,
int
base
,
int
base_char
,
int
flags
,
int
width
)
{
static
int
pfenv_print_int
(
const
pfenv_t
*
pfenv
,
unsigned
int
x
,
int
sgn
,
int
base
,
int
base_char
,
int
flags
,
int
width
)
{
char
sign
=
0
;
char
sign
=
0
;
if
(
sgn
)
{
if
(
sgn
)
{
if
((
int
)
x
<
0
)
{
if
((
int
)
x
<
0
)
{
...
@@ -84,11 +84,11 @@ static int pfenv_print_int(pfenv_t *pfenv, unsigned int x, int sgn, int base, in
...
@@ -84,11 +84,11 @@ static int pfenv_print_int(pfenv_t *pfenv, unsigned int x, int sgn, int base, in
return
pfenv_print_strn
(
pfenv
,
b
,
buf
+
INT_BUF_SIZE
-
b
,
flags
,
width
);
return
pfenv_print_strn
(
pfenv
,
b
,
buf
+
INT_BUF_SIZE
-
b
,
flags
,
width
);
}
}
void
pfenv_prints
(
pfenv_t
*
pfenv
,
const
char
*
str
)
{
void
pfenv_prints
(
const
pfenv_t
*
pfenv
,
const
char
*
str
)
{
pfenv
->
print_strn
(
pfenv
->
data
,
str
,
strlen
(
str
));
pfenv
->
print_strn
(
pfenv
->
data
,
str
,
strlen
(
str
));
}
}
int
pfenv_printf
(
pfenv_t
*
pfenv
,
const
char
*
fmt
,
va_list
args
)
{
int
pfenv_printf
(
const
pfenv_t
*
pfenv
,
const
char
*
fmt
,
va_list
args
)
{
int
chrs
=
0
;
int
chrs
=
0
;
for
(;;)
{
for
(;;)
{
{
{
...
@@ -217,7 +217,7 @@ void stdout_print_strn(void *data, const char *str, unsigned int len) {
...
@@ -217,7 +217,7 @@ void stdout_print_strn(void *data, const char *str, unsigned int len) {
usb_vcp_send
(
str
,
len
);
usb_vcp_send
(
str
,
len
);
}
}
pfenv_t
pfenv_stdout
=
{
0
,
stdout_print_strn
};
static
const
pfenv_t
pfenv_stdout
=
{
0
,
stdout_print_strn
};
int
printf
(
const
char
*
fmt
,
...)
{
int
printf
(
const
char
*
fmt
,
...)
{
va_list
args
;
va_list
args
;
...
...
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