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
a65838b4
Commit
a65838b4
authored
7 years ago
by
Martino Facchin
Committed by
Cristian Maglie
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
remove pmic defaults from initVariant()
parent
c933a7d1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
variants/mkrgsm1400/variant.cpp
+5
-18
5 additions, 18 deletions
variants/mkrgsm1400/variant.cpp
with
5 additions
and
18 deletions
variants/mkrgsm1400/variant.cpp
+
5
−
18
View file @
a65838b4
...
...
@@ -180,20 +180,6 @@ SERCOM sercom5(SERCOM5);
#define VOLTAGE_LIMIT_4V36 (0x6 << 3)
#define VOLTAGE_LIMIT_4V04 (0x2 << 3)
static
inline
void
set_pmic_safe_defaults
()
{
PERIPH_WIRE
.
initMasterWIRE
(
100000
);
PERIPH_WIRE
.
enableWIRE
();
pinPeripheral
(
PIN_WIRE_SDA
,
g_APinDescription
[
PIN_WIRE_SDA
].
ulPinType
);
pinPeripheral
(
PIN_WIRE_SCL
,
g_APinDescription
[
PIN_WIRE_SCL
].
ulPinType
);
PERIPH_WIRE
.
startTransmissionWIRE
(
PMIC_ADDRESS
,
WIRE_WRITE_FLAG
);
PERIPH_WIRE
.
sendDataMasterWIRE
(
PMIC_REG02
);
PERIPH_WIRE
.
sendDataMasterWIRE
(
0
);
PERIPH_WIRE
.
prepareCommandBitsWire
(
WIRE_MASTER_ACT_STOP
);
PERIPH_WIRE
.
disableWIRE
();
}
static
inline
void
disable_battery_charging
()
{
PERIPH_WIRE
.
initMasterWIRE
(
100000
);
PERIPH_WIRE
.
enableWIRE
();
...
...
@@ -210,18 +196,19 @@ static inline void disable_battery_charging() {
#else
static
inline
void
set_pmic_safe_defaults
()
{}
static
inline
void
disable_battery_charging
()
{}
#endif
void
initVariant
()
{
pinMode
(
32
,
INPUT_PULLDOWN
);
pinMode
(
32
,
OUTPUT
);
digitalWrite
(
32
,
LOW
);
pinMode
(
32
,
INPUT
);
if
(
analogRead
(
32
)
<
800
)
{
disable_battery_charging
();
}
else
{
set_pmic_safe_defaults
();
}
// Workaround for RTS not being controlled correctly
pinMode
(
28
,
OUTPUT
);
digitalWrite
(
28
,
LOW
);
...
...
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