-
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.
[Telink] Use common main & apptask for chef app (#29995)
* [Telink][Chef] Add common file structure for Chef app Signed-off-by: Dima Horbenko <[email protected]> * Clean-up code Signed-off-by: Dima Horbenko <[email protected]> * Restyled by clang-format * Add board to build command Signed-off-by: Dima Horbenko <[email protected]> * Fix build issue Signed-off-by: Dima Horbenko <[email protected]> --------- Signed-off-by: Dima Horbenko <[email protected]> Co-authored-by: Dima Horbenko <[email protected]> Co-authored-by: Restyled.io <[email protected]> Co-authored-by: Dima Horbenko <[email protected]>
- Loading branch information
1 parent
28de696
commit 8998cae
Showing
8 changed files
with
130 additions
and
156 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
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,28 @@ | ||
/* | ||
* | ||
* Copyright (c) 2023 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 | ||
|
||
// ---- Chef Example App Config ---- | ||
|
||
#define APP_USE_EXAMPLE_START_BUTTON 0 | ||
#define APP_USE_BLE_START_BUTTON 1 | ||
#define APP_USE_THREAD_START_BUTTON 1 | ||
#define APP_SET_DEVICE_INFO_PROVIDER 1 | ||
#define APP_SET_NETWORK_COMM_ENDPOINT_SEC 0 | ||
#define APP_USE_IDENTIFY_PWM 0 |
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,38 @@ | ||
/* | ||
* | ||
* Copyright (c) 2023 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 "AppTaskCommon.h" | ||
|
||
class AppTask : public AppTaskCommon | ||
{ | ||
public: | ||
private: | ||
friend AppTask & GetAppTask(void); | ||
friend class AppTaskCommon; | ||
|
||
CHIP_ERROR Init(void); | ||
|
||
static AppTask sAppTask; | ||
}; | ||
|
||
inline AppTask & GetAppTask(void) | ||
{ | ||
return AppTask::sAppTask; | ||
} |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* | ||
* Copyright (c) 2023 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 "AppTask.h" | ||
#include <app/server/Server.h> | ||
|
||
LOG_MODULE_DECLARE(app, CONFIG_CHIP_APP_LOG_LEVEL); | ||
|
||
AppTask AppTask::sAppTask; | ||
|
||
CHIP_ERROR AppTask::Init(void) | ||
{ | ||
InitCommonParts(); | ||
|
||
#if CONFIG_CHIP_LIB_SHELL | ||
int rc = Engine::Root().Init(); | ||
if (rc != 0) | ||
{ | ||
ChipLogError(AppServer, "Streamer initialization failed: %d", rc); | ||
return 1; | ||
} | ||
|
||
cmd_misc_init(); | ||
cmd_otcli_init(); | ||
#endif | ||
|
||
#if CHIP_SHELL_ENABLE_CMD_SERVER | ||
cmd_app_server_init(); | ||
#endif | ||
|
||
#if CONFIG_CHIP_LIB_SHELL | ||
Engine::Root().RunMainLoop(); | ||
#endif | ||
|
||
return CHIP_NO_ERROR; | ||
} |
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