-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BL602]1. add the support of pw_rpc; 2. enable buttons on dev board t…
…o do factory reset and control light (#20212) * [BL602]add the support of pw_rpc * enable Button to do factory reset and toggle LED * [BL602]fix restyled issue * add new line at end of file * fix restyle issues * continue fix restlye issues * continue fix restlye issues * continue fix restlye issues * trigger restyled check
- Loading branch information
1 parent
482469b
commit 1662476
Showing
28 changed files
with
807 additions
and
416 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
examples/common/pigweed/bouffalolab/bl602/PigweedLoggerMutex.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* | ||
* Copyright (c) 2021 Project CHIP Authors | ||
* All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#include "PigweedLoggerMutex.h" | ||
|
||
namespace chip { | ||
namespace rpc { | ||
|
||
PigweedLoggerMutex logger_mutex; | ||
|
||
} // namespace rpc | ||
} // namespace chip |
54 changes: 54 additions & 0 deletions
54
examples/common/pigweed/bouffalolab/bl602/PigweedLoggerMutex.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* | ||
* Copyright (c) 2021 Project CHIP Authors | ||
* All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "PigweedLogger.h" | ||
#include "pigweed/RpcService.h" | ||
#include "semphr.h" | ||
#include <FreeRTOS.h> | ||
|
||
namespace chip { | ||
namespace rpc { | ||
class PigweedLoggerMutex : public ::chip::rpc::Mutex | ||
{ | ||
|
||
public: | ||
PigweedLoggerMutex() {} | ||
void Lock() override | ||
{ | ||
SemaphoreHandle_t * sem = PigweedLogger::GetSemaphore(); | ||
if (sem) | ||
{ | ||
xSemaphoreTake(*sem, portMAX_DELAY); | ||
} | ||
} | ||
void Unlock() override | ||
{ | ||
SemaphoreHandle_t * sem = PigweedLogger::GetSemaphore(); | ||
if (sem) | ||
{ | ||
xSemaphoreGive(*sem); | ||
} | ||
} | ||
}; | ||
|
||
extern PigweedLoggerMutex logger_mutex; | ||
|
||
} // namespace rpc | ||
} // namespace chip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.