All BLE Quiet tests pass!
This commit is contained in:
parent
f367b5ae5b
commit
4cdf1a0ede
2 changed files with 27 additions and 26 deletions
|
@ -343,15 +343,16 @@ SystemKResult_T BLE_Quiet(uint32_t duration_ms)
|
|||
// Already quiet; reset timer with new duration if duration_ms > 0.
|
||||
if (duration_ms > 0)
|
||||
{
|
||||
// Stop and delete existing timer if it exists.
|
||||
// Stop the timer and change the period if it is already running.
|
||||
if (BLEUnquietTimer != NULL)
|
||||
{
|
||||
xTimerStop(BLEUnquietTimer, 0);
|
||||
xTimerDelete(BLEUnquietTimer, 0);
|
||||
BLEUnquietTimer = NULL;
|
||||
xTimerChangePeriod(BLEUnquietTimer, pdMS_TO_TICKS(duration_ms), 0);
|
||||
xTimerStart(BLEUnquietTimer, 0);
|
||||
}
|
||||
|
||||
// Create and start new timer with the new duration.
|
||||
else
|
||||
{
|
||||
// There should already be a timer, but just in case...
|
||||
BLEUnquietTimer = xTimerCreateStatic(
|
||||
"BLEUnquietTimer",
|
||||
pdMS_TO_TICKS(duration_ms),
|
||||
|
@ -374,19 +375,17 @@ SystemKResult_T BLE_Quiet(uint32_t duration_ms)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// If duration_ms is 0, stop and delete the timer to stay quiet indefinitely.
|
||||
// If duration_ms is 0, stop the timer to stay quiet indefinitely.
|
||||
if (BLEUnquietTimer != NULL)
|
||||
{
|
||||
xTimerStop(BLEUnquietTimer, 0);
|
||||
xTimerDelete(BLEUnquietTimer, 0);
|
||||
BLEUnquietTimer = NULL;
|
||||
}
|
||||
}
|
||||
result = SYSTEMK_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
else if (Host_And_Controller_Synced == true)
|
||||
{
|
||||
Is_Quiet = true;
|
||||
|
@ -433,6 +432,8 @@ SystemKResult_T BLE_Unquiet(void)
|
|||
{
|
||||
SystemKResult_T result = SYSTEMK_RESULT_NOT_READY;
|
||||
|
||||
KLOG_INFO(TAG, "BLE_Unquiet()");
|
||||
|
||||
if (Is_Quiet == false)
|
||||
{
|
||||
// Already unquiet; no action needed.
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 88c81dc405ef5d10fcf67d80d349bc1a7924e6f9
|
||||
Subproject commit e0e7fdf1aef151390c1e82d95e89e39038206bca
|
Loading…
Add table
Add a link
Reference in a new issue