Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BikeBeam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan Grewe
BikeBeam
Commits
0fb0ede2
Commit
0fb0ede2
authored
Aug 1, 2020
by
Jan Grewe
Browse files
Options
Downloads
Patches
Plain Diff
more cleanup
parent
2a2de99d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/power.h
+2
-1
2 additions, 1 deletion
include/power.h
src/main.cpp
+1
-33
1 addition, 33 deletions
src/main.cpp
src/power.cpp
+35
-1
35 additions, 1 deletion
src/power.cpp
with
38 additions
and
35 deletions
include/power.h
+
2
−
1
View file @
0fb0ede2
...
...
@@ -6,3 +6,4 @@ void powerSetOutput(uint8_t channel, bool enabled);
void
powerStatus
();
void
powerSetup
();
void
powerSleep
();
void
powerBootInfo
();
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/main.cpp
+
1
−
33
View file @
0fb0ede2
...
...
@@ -7,7 +7,6 @@
#include
<CayenneLPP.h>
int
state
;
RTC_DATA_ATTR
int
bootCount
=
0
;
CayenneLPP
payload
(
55
);
void
createPayload
()
...
...
@@ -27,42 +26,11 @@ void printPayload() {
Serial
.
println
(
"
\n
#########################
\n
"
);
}
static
void
bootInfo
()
{
++
bootCount
;
Serial
.
printf
(
"Boot number: %d
\n
"
,
bootCount
);
esp_sleep_wakeup_cause_t
wakeup_reason
;
wakeup_reason
=
esp_sleep_get_wakeup_cause
();
switch
(
wakeup_reason
)
{
case
ESP_SLEEP_WAKEUP_EXT0
:
Serial
.
println
(
"Wakeup caused by external signal using RTC_IO"
);
break
;
case
ESP_SLEEP_WAKEUP_EXT1
:
Serial
.
println
(
"Wakeup caused by external signal using RTC_CNTL"
);
break
;
case
ESP_SLEEP_WAKEUP_TIMER
:
Serial
.
println
(
"Wakeup caused by timer"
);
break
;
case
ESP_SLEEP_WAKEUP_TOUCHPAD
:
Serial
.
println
(
"Wakeup caused by touchpad"
);
break
;
case
ESP_SLEEP_WAKEUP_ULP
:
Serial
.
println
(
"Wakeup caused by ULP program"
);
break
;
default:
Serial
.
printf
(
"Wakeup was not caused by deep sleep: %d
\n
"
,
wakeup_reason
);
break
;
}
}
void
setup
()
{
Serial
.
begin
(
115200
);
Wire
.
begin
(
21
,
22
);
b
ootInfo
();
powerB
ootInfo
();
powerSetup
();
gpsSetup
();
loraSetup
();
...
...
This diff is collapsed.
Click to expand it.
src/power.cpp
+
35
−
1
View file @
0fb0ede2
#include
"config.h"
#include
<axp20x.h>
RTC_DATA_ATTR
int
bootCount
=
0
;
AXP20X_Class
axp
;
void
powerLed
(
axp_chgled_mode_t
mode
)
...
...
@@ -84,3 +86,35 @@ void powerSleep()
Serial
.
println
(
"
\n
### END ###"
);
esp_deep_sleep_start
();
}
void
powerBootInfo
()
{
++
bootCount
;
Serial
.
printf
(
"Boot number: %d
\n
"
,
bootCount
);
esp_sleep_wakeup_cause_t
wakeup_reason
;
wakeup_reason
=
esp_sleep_get_wakeup_cause
();
switch
(
wakeup_reason
)
{
case
ESP_SLEEP_WAKEUP_EXT0
:
Serial
.
println
(
"Wakeup caused by external signal using RTC_IO"
);
break
;
case
ESP_SLEEP_WAKEUP_EXT1
:
Serial
.
println
(
"Wakeup caused by external signal using RTC_CNTL"
);
break
;
case
ESP_SLEEP_WAKEUP_TIMER
:
Serial
.
println
(
"Wakeup caused by timer"
);
break
;
case
ESP_SLEEP_WAKEUP_TOUCHPAD
:
Serial
.
println
(
"Wakeup caused by touchpad"
);
break
;
case
ESP_SLEEP_WAKEUP_ULP
:
Serial
.
println
(
"Wakeup caused by ULP program"
);
break
;
default:
Serial
.
printf
(
"Wakeup was not caused by deep sleep: %d
\n
"
,
wakeup_reason
);
break
;
}
}
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