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
0eca3bd6
Commit
0eca3bd6
authored
10 years ago
by
Jonathan BAUDIN
Browse files
Options
Downloads
Patches
Plain Diff
Use new IRQ functions
parent
3c6f9b55
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
cores/arduino/Uart.cpp
+21
-6
21 additions, 6 deletions
cores/arduino/Uart.cpp
cores/arduino/Uart.h
+2
-1
2 additions, 1 deletion
cores/arduino/Uart.h
libraries/Wire/Wire.cpp
+2
-2
2 additions, 2 deletions
libraries/Wire/Wire.cpp
libraries/Wire/Wire.h
+0
-2
0 additions, 2 deletions
libraries/Wire/Wire.h
with
25 additions
and
11 deletions
cores/arduino/Uart.cpp
+
21
−
6
View file @
0eca3bd6
...
...
@@ -66,15 +66,25 @@ int Uart::read()
return
rxBuffer
.
read_char
();
}
size_t
Uart
::
write
(
uint8_t
data
)
size_t
Uart
::
write
(
const
uint8_t
data
)
{
if
(
txBuffer
.
isFull
())
return
0
;
txBuffer
.
store_char
(
data
);
sercom
->
writeDataUART
(
data
);
return
1
;
}
size_t
Uart
::
write
(
const
char
*
data
)
{
size_t
writed
=
0
;
while
(
*
data
!=
'\0'
)
{
writed
+=
write
(
*
data
);
++
data
;
}
return
writed
;
}
SercomNumberStopBit
Uart
::
extractNbStopBit
(
uint8_t
config
)
{
switch
(
config
&
HARDSER_STOP_BIT_MASK
)
...
...
@@ -124,4 +134,9 @@ SercomParityMode Uart::extractParity(uint8_t config)
}
}
Uart
Serial
=
Uart
(
SERCOM
::
sercom0
);
\ No newline at end of file
Uart
Serial
=
Uart
(
SERCOM
::
sercom0
);
void
SERCOM0_Handler
()
{
Serial
.
IrqHandler
();
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
cores/arduino/Uart.h
+
2
−
1
View file @
0eca3bd6
...
...
@@ -19,7 +19,8 @@ class Uart : public HardwareSerial
int
peek
();
int
read
();
void
flush
();
size_t
write
(
const
uint8_t
c
);
size_t
write
(
const
uint8_t
data
);
size_t
write
(
const
char
*
data
);
void
IrqHandler
();
...
...
This diff is collapsed.
Click to expand it.
libraries/Wire/Wire.cpp
+
2
−
2
View file @
0eca3bd6
...
...
@@ -347,9 +347,9 @@ void TwoWire::onService(void)
}*/
TwoWire
Wire
=
TwoWire
(
SERCOM
::
sercom3
);
TwoWire
Wire
(
SERCOM
::
sercom3
);
void
WIRE_ISR_HANDLER
(
void
)
{
void
SERCOM3_Handler
(
void
)
{
Wire
.
onService
();
}
...
...
This diff is collapsed.
Click to expand it.
libraries/Wire/Wire.h
+
0
−
2
View file @
0eca3bd6
...
...
@@ -99,8 +99,6 @@ class TwoWire : public Stream {
//static const uint32_t XMIT_TIMEOUT = 100000;
};
#if WIRE_INTERFACES_COUNT > 0
extern
TwoWire
Wire
;
#endif
#endif
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