Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
marlin-anet-a8
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Leder
marlin-anet-a8
Commits
85da81e6
Commit
85da81e6
authored
13 years ago
by
Bernhard
Browse files
Options
Downloads
Patches
Plain Diff
inlineing of small functions in serial
parent
b9ad0bb2
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Marlin/MarlinSerial.cpp
+1
-27
1 addition, 27 deletions
Marlin/MarlinSerial.cpp
Marlin/MarlinSerial.h
+29
-7
29 additions, 7 deletions
Marlin/MarlinSerial.h
with
30 additions
and
34 deletions
Marlin/MarlinSerial.cpp
+
1
−
27
View file @
85da81e6
...
...
@@ -161,31 +161,9 @@ void MarlinSerial::flush()
/// imports from print.h
/* default implementation: may be overridden */
void
MarlinSerial
::
write
(
const
char
*
str
)
{
while
(
*
str
)
write
(
*
str
++
);
}
/* default implementation: may be overridden */
void
MarlinSerial
::
write
(
const
uint8_t
*
buffer
,
size_t
size
)
{
while
(
size
--
)
write
(
*
buffer
++
);
}
void
MarlinSerial
::
print
(
const
String
&
s
)
{
for
(
int
i
=
0
;
i
<
s
.
length
();
i
++
)
{
write
(
s
[
i
]);
}
}
void
MarlinSerial
::
print
(
const
char
str
[])
{
write
(
str
);
}
void
MarlinSerial
::
print
(
char
c
,
int
base
)
{
...
...
@@ -353,11 +331,7 @@ void MarlinSerial::printFloat(double number, uint8_t digits)
// Preinstantiate Objects //////////////////////////////////////////////////////
#if defined(UBRR0H) && defined(UBRR0L)
MarlinSerial
MSerial
;
#else
#error no serial port defined (port 0)
#endif
MarlinSerial
MSerial
;
#endif // whole file
...
...
This diff is collapsed.
Click to expand it.
Marlin/MarlinSerial.h
+
29
−
7
View file @
85da81e6
...
...
@@ -51,13 +51,15 @@ class MarlinSerial //: public Stream
MarlinSerial
();
void
begin
(
long
);
void
end
();
int
peek
(
void
);
int
read
(
void
);
void
flush
(
void
);
inline
int
available
(
void
)
{
return
(
unsigned
int
)(
RX_BUFFER_SIZE
+
rx_buffer
.
head
-
rx_buffer
.
tail
)
%
RX_BUFFER_SIZE
;
}
int
peek
(
void
);
int
read
(
void
);
void
flush
(
void
);
inline
void
write
(
uint8_t
c
)
{
while
(
!
((
UCSR0A
)
&
(
1
<<
UDRE0
)))
...
...
@@ -91,11 +93,31 @@ class MarlinSerial //: public Stream
public
:
void
write
(
const
char
*
str
);
void
write
(
const
uint8_t
*
buffer
,
size_t
size
);
void
print
(
const
String
&
);
void
print
(
const
char
[]);
inline
void
write
(
const
char
*
str
)
{
while
(
*
str
)
write
(
*
str
++
);
}
inline
void
write
(
const
uint8_t
*
buffer
,
size_t
size
)
{
while
(
size
--
)
write
(
*
buffer
++
);
}
inline
void
print
(
const
String
&
s
)
{
for
(
int
i
=
0
;
i
<
s
.
length
();
i
++
)
{
write
(
s
[
i
]);
}
}
inline
void
print
(
const
char
*
str
)
{
write
(
str
);
}
void
print
(
char
,
int
=
BYTE
);
void
print
(
unsigned
char
,
int
=
BYTE
);
void
print
(
int
,
int
=
DEC
);
...
...
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