Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
card10
firmware
Commits
b6368279
Commit
b6368279
authored
3 years ago
by
schneider
Browse files
Options
Downloads
Plain Diff
Merge branch 'rahix/fix-broken-shutdown' into 'master'
Make sleep work again when BLE is disabled Closes
#231
See merge request
!466
parents
a35e4ac9
01fb427e
No related branches found
No related tags found
1 merge request
!466
Make sleep work again when BLE is disabled
Pipeline
#5188
passed
3 years ago
Stage: build
Stage: deploy
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
epicardium/ble/ble.c
+16
-7
16 additions, 7 deletions
epicardium/ble/ble.c
epicardium/main.c
+1
-1
1 addition, 1 deletion
epicardium/main.c
epicardium/modules/modules.h
+1
-1
1 addition, 1 deletion
epicardium/modules/modules.h
epicardium/modules/sleep.c
+3
-1
3 additions, 1 deletion
epicardium/modules/sleep.c
with
21 additions
and
10 deletions
epicardium/ble/ble.c
+
16
−
7
View file @
b6368279
...
...
@@ -269,17 +269,26 @@ void RSV11_IRQHandler(void)
notify
();
}
/*************************************************************************************************/
bool
ble_
shall_start
(
void
)
bool
ble_
is_enabled
(
void
)
{
bool
ble_enabled
=
config_get_boolean_with_default
(
"ble_enable"
,
false
);
/*
* 0 = unknown, check config
* 1 = disabled
* 2 = enabled
*/
static
int
ble_state
=
0
;
if
(
ble_enabled
)
{
LOG_INFO
(
"ble"
,
"BLE is enabled."
);
}
else
{
LOG_INFO
(
"ble"
,
"BLE is disabled."
);
if
(
ble_state
==
0
)
{
if
(
config_get_boolean_with_default
(
"ble_enable"
,
false
))
{
ble_state
=
2
;
LOG_INFO
(
"ble"
,
"BLE is enabled."
);
}
else
{
ble_state
=
1
;
LOG_INFO
(
"ble"
,
"BLE is disabled."
);
}
}
return
ble_
enabled
;
return
ble_
state
==
2
;
}
/*************************************************************************************************/
static
void
scheduleTimer
(
void
)
...
...
This diff is collapsed.
Click to expand it.
epicardium/main.c
+
1
−
1
View file @
b6368279
...
...
@@ -156,7 +156,7 @@ int main(void)
}
/* BLE */
if
(
ble_
shall_start
())
{
if
(
ble_
is_enabled
())
{
if
(
xTaskCreate
(
vBleTask
,
(
const
char
*
)
"BLE"
,
...
...
This diff is collapsed.
Click to expand it.
epicardium/modules/modules.h
+
1
−
1
View file @
b6368279
...
...
@@ -93,7 +93,7 @@ int pmic_read_amux(enum pmic_amux_signal sig, float *result);
/* ---------- BLE ---------------------------------------------------------- */
void
vBleTask
(
void
*
pvParameters
);
bool
ble_
shall_start
(
void
);
bool
ble_
is_enabled
(
void
);
void
ble_uart_write
(
uint8_t
*
pValue
,
uint8_t
len
);
/* ---------- Hardware (Peripheral) Locks ---------------------------------- */
...
...
This diff is collapsed.
Click to expand it.
epicardium/modules/sleep.c
+
3
−
1
View file @
b6368279
...
...
@@ -190,7 +190,9 @@ void sleep_deepsleep(void)
core1_stop
();
MAX77650_getINT_GLBL
();
gpio_low_power
();
BbDrvDisable
();
if
(
ble_is_enabled
())
{
BbDrvDisable
();
}
turnOffClocks
();
old_clkcn
=
MXC_GCR
->
clkcn
;
switchToHIRC
();
...
...
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