Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-nRF5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-nRF5
Commits
edc3e314
Commit
edc3e314
authored
Sep 06, 2016
by
Sandeep Mistry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check WIRE_INTERFACES_COUNT and SPI_INTERFACES_COUNT
parent
9a56aec0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
2 deletions
+10
-2
libraries/SPI/SPI.cpp
libraries/SPI/SPI.cpp
+2
-0
libraries/SPI/SPI.h
libraries/SPI/SPI.h
+2
-2
libraries/Wire/Wire.h
libraries/Wire/Wire.h
+2
-0
libraries/Wire/Wire_nRF51.cpp
libraries/Wire/Wire_nRF51.cpp
+2
-0
libraries/Wire/Wire_nRF52.cpp
libraries/Wire/Wire_nRF52.cpp
+2
-0
No files found.
libraries/SPI/SPI.cpp
View file @
edc3e314
...
...
@@ -244,4 +244,6 @@ void SPIClass::detachInterrupt() {
// Should be disableInterrupt()
}
#if SPI_INTERFACES_COUNT > 0
SPIClass
SPI
(
NRF_SPI0
,
PIN_SPI_MISO
,
PIN_SPI_SCK
,
PIN_SPI_MOSI
);
#endif
libraries/SPI/SPI.h
View file @
edc3e314
...
...
@@ -133,9 +133,9 @@ void SPIClass::transfer(void *buf, size_t count)
buffer
[
i
]
=
transfer
(
buffer
[
i
]);
}
#if SPI_INTERFACES_COUNT > 0
extern
SPIClass
SPI
;
extern
SPIClass
SPI1
;
extern
SPIClass
SPI2
;
#endif
// For compatibility with sketches designed for AVR @ 16 MHz
// New programs should use SPI.beginTransaction to set the SPI clock
...
...
libraries/Wire/Wire.h
View file @
edc3e314
...
...
@@ -103,6 +103,8 @@ class TwoWire : public Stream
static
const
uint32_t
TWI_CLOCK
=
100000
;
};
#if WIRE_INTERFACES_COUNT > 0
extern
TwoWire
Wire
;
#endif
#endif
libraries/Wire/Wire_nRF51.cpp
View file @
edc3e314
...
...
@@ -281,6 +281,7 @@ void TwoWire::onService(void)
{
}
#if WIRE_INTERFACES_COUNT > 0
TwoWire
Wire
(
NRF_TWI1
,
SPI1_TWI1_IRQn
,
PIN_WIRE_SDA
,
PIN_WIRE_SCL
);
extern
"C"
...
...
@@ -290,5 +291,6 @@ extern "C"
Wire
.
onService
();
}
}
#endif
#endif
libraries/Wire/Wire_nRF52.cpp
View file @
edc3e314
...
...
@@ -386,6 +386,7 @@ void TwoWire::onService(void)
TwoWire
Wire
(
NRF_TWIM1
,
NRF_TWIS1
,
SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQn
,
PIN_WIRE_SDA
,
PIN_WIRE_SCL
);
#if WIRE_INTERFACES_COUNT > 0
extern
"C"
{
void
SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQHandler
(
void
)
...
...
@@ -393,5 +394,6 @@ extern "C"
Wire
.
onService
();
}
}
#endif
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment