-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implements zbus topic hz/info/echo, improve sched.
This schedules a listener once to echo the topic. Autocomplete works on the zephyr shell for topics. Also adds topic info and hz commmands. While checking topic hz, found scheduling issues and resolved using work queues. Switched estimator and control to polling. Remove synapse uart node. Closes #93, Closes #96, Closes #97, Closes #98 Closes #99, Closes #100 Co-authored-by: Benjamin Perseghetti <[email protected]> Signed-off-by: James Goppert <[email protected]>
- Loading branch information
1 parent
bee6f1a
commit 64327a6
Showing
43 changed files
with
1,107 additions
and
469 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
add_subdirectory_ifdef(CONFIG_CORE_WORKQUEUES workqueues) |
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,8 @@ | ||
# Copyright (c) 2023 CogniPilot Foundation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
menu "Core" | ||
|
||
rsource "workqueues/Kconfig" | ||
|
||
endmenu |
5 changes: 2 additions & 3 deletions
5
lib/synapse/uart/CMakeLists.txt → lib/core/workqueues/CMakeLists.txt
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 |
---|---|---|
@@ -1,13 +1,12 @@ | ||
# Copyright (c) 2023, CogniPilot Foundation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
zephyr_library_named(synapse_uart) | ||
zephyr_library_named(core_workqueues) | ||
|
||
|
||
# we need to be able to include generated header files | ||
zephyr_include_directories() | ||
|
||
zephyr_library_sources( | ||
main.c | ||
) | ||
|
||
add_dependencies(synapse_uart synapse_protobuf) |
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,15 @@ | ||
# Copyright (c) 2023, CogniPilot Foundation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
menuconfig CORE_WORKQUEUES | ||
bool "Enable core work queues" | ||
default y | ||
help | ||
This option enables the system work queues | ||
|
||
if CORE_WORKQUEUES | ||
|
||
module = CORE_WORKQUEUES | ||
module-str = core_workqueues | ||
source "subsys/logging/Kconfig.template.log_config" | ||
|
||
endif # CORE_WORKQUEUES |
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,58 @@ | ||
/* | ||
* Copyright CogniPilot Foundation 2023 | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
#include <zephyr/kernel.h> | ||
#include <zephyr/logging/log.h> | ||
|
||
LOG_MODULE_REGISTER(core_workqueues, CONFIG_CORE_WORKQUEUES_LOG_LEVEL); | ||
|
||
#define THREAD_STACK_SIZE 2048 | ||
#define THREAD_PRIORITY 6 | ||
|
||
#define LOW_PRIORITY_STACK_SIZE 2048 | ||
#define LOW_PRIORITY_PRIORITY 0 | ||
|
||
#define HIGH_PRIORITY_STACK_SIZE 2048 | ||
#define HIGH_PRIORITY_PRIORITY -1 | ||
|
||
K_THREAD_STACK_DEFINE(high_priority_stack_area, HIGH_PRIORITY_STACK_SIZE); | ||
K_THREAD_STACK_DEFINE(low_priority_stack_area, LOW_PRIORITY_STACK_SIZE); | ||
|
||
struct k_work_q g_high_priority_work_q, g_low_priority_work_q; | ||
|
||
int core_workqueues_entry_point(void) | ||
{ | ||
// high priority | ||
k_work_queue_init(&g_high_priority_work_q); | ||
struct k_work_queue_config high_priority_cfg = { | ||
.name = "high_priority_q", | ||
.no_yield = true | ||
}; | ||
k_work_queue_start( | ||
&g_high_priority_work_q, | ||
high_priority_stack_area, | ||
K_THREAD_STACK_SIZEOF(high_priority_stack_area), | ||
HIGH_PRIORITY_PRIORITY, | ||
&high_priority_cfg); | ||
|
||
// high priority | ||
k_work_queue_init(&g_low_priority_work_q); | ||
struct k_work_queue_config low_priority_cfg = { | ||
.name = "low_priority_q", | ||
.no_yield = false | ||
}; | ||
k_work_queue_start( | ||
&g_low_priority_work_q, | ||
low_priority_stack_area, | ||
K_THREAD_STACK_SIZEOF(low_priority_stack_area), | ||
LOW_PRIORITY_PRIORITY, | ||
&low_priority_cfg); | ||
return 0; | ||
} | ||
|
||
K_THREAD_DEFINE(core_workqueues, THREAD_STACK_SIZE, | ||
core_workqueues_entry_point, NULL, NULL, NULL, | ||
THREAD_PRIORITY, 0, 0); | ||
|
||
// vi: ts=4 sw=4 et |
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.