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
203dfcc1
Commit
203dfcc1
authored
7 years ago
by
Martino Facchin
Committed by
Cristian Maglie
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Rewrite PMIC initialization using Sercom (no error checking)
parent
70eff4b8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
variants/mkrgsm1400/linker_scripts/gcc/flash_with_bootloader.ld
+0
-3
0 additions, 3 deletions
...ts/mkrgsm1400/linker_scripts/gcc/flash_with_bootloader.ld
variants/mkrgsm1400/variant.cpp
+15
-13
15 additions, 13 deletions
variants/mkrgsm1400/variant.cpp
with
15 additions
and
16 deletions
variants/mkrgsm1400/linker_scripts/gcc/flash_with_bootloader.ld
+
0
−
3
View file @
203dfcc1
...
@@ -69,9 +69,6 @@ SECTIONS
...
@@ -69,9 +69,6 @@ SECTIONS
KEEP(*(.sketch_boot))
KEEP(*(.sketch_boot))
/* After the constructors, call PMIC handling stuff (precompiled) */
KEEP(*(.init_pmic_variant))
. = ALIGN(0x2000);
. = ALIGN(0x2000);
KEEP(*(.isr_vector))
KEEP(*(.isr_vector))
*(.text*)
*(.text*)
...
...
This diff is collapsed.
Click to expand it.
variants/mkrgsm1400/variant.cpp
+
15
−
13
View file @
203dfcc1
...
@@ -168,26 +168,28 @@ SERCOM sercom5(SERCOM5);
...
@@ -168,26 +168,28 @@ SERCOM sercom5(SERCOM5);
#if defined(USE_BQ24195L_PMIC)
#if defined(USE_BQ24195L_PMIC)
#i
f 0
#i
nclude
"wiring_private.h"
/* generate .o out of this function and attach it to the linker */
#define PMIC_ADDRESS 0x6B
#define PMIC_ADDRESS 0x6B
#define PMIC_REG02 0x02
#define PMIC_REG02 0x02
static
inline
void
set_pmic_safe_defaults
()
{
static
inline
void
set_pmic_safe_defaults
()
{
Wire.begin();
PERIPH_WIRE
.
initMasterWIRE
(
100000
);
Wire.beginTransmission(PMIC_ADDRESS);
PERIPH_WIRE
.
enableWIRE
();
Wire.write(PMIC_REG02);
pinPeripheral
(
PIN_WIRE_SDA
,
g_APinDescription
[
PIN_WIRE_SDA
].
ulPinType
);
Wire.write(0);
pinPeripheral
(
PIN_WIRE_SCL
,
g_APinDescription
[
PIN_WIRE_SCL
].
ulPinType
);
Wire.endTransmission();
Wire.end();
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
();
}
}
#else
void
initVariant
()
{
__attribute__
((
section
(
".__init_pmic_variant"
)))
set_pmic_safe_defaults
();
unsigned
char
init_pmic
[
0x4000
]
=
{
}
};
#endif
#endif
#endif
// Serial1
// Serial1
...
...
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