Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Arduino Core for SAMD21 CPU
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
josc941e
Arduino Core for SAMD21 CPU
Commits
38992c2a
Commit
38992c2a
authored
9 years ago
by
Sandeep Mistry
Committed by
Cristian Maglie
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add availableForStore method to RingBuffer
parent
a32ac8cd
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
cores/arduino/RingBuffer.cpp
+8
-0
8 additions, 0 deletions
cores/arduino/RingBuffer.cpp
cores/arduino/RingBuffer.h
+1
-0
1 addition, 0 deletions
cores/arduino/RingBuffer.h
with
9 additions
and
0 deletions
cores/arduino/RingBuffer.cpp
+
8
−
0
View file @
38992c2a
...
...
@@ -67,6 +67,14 @@ int RingBuffer::available()
return
delta
;
}
int
RingBuffer
::
availableForStore
()
{
if
(
_iHead
>=
_iTail
)
return
SERIAL_BUFFER_SIZE
-
1
-
_iHead
+
_iTail
;
else
return
_iTail
-
_iHead
-
1
;
}
int
RingBuffer
::
peek
()
{
if
(
_iTail
==
_iHead
)
...
...
This diff is collapsed.
Click to expand it.
cores/arduino/RingBuffer.h
+
1
−
0
View file @
38992c2a
...
...
@@ -40,6 +40,7 @@ class RingBuffer
void
clear
();
int
read_char
();
int
available
();
int
availableForStore
();
int
peek
();
bool
isFull
();
...
...
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