Compare commits

...

2 Commits

Author SHA1 Message Date
Thomas Boyer-Chammard
b3694b28c1
Update new component to catch top-level namespace (#285) 2025-09-03 15:35:34 -07:00
M Starch
e09c2fd23d
Modify cookiecutter LinuxTimer interface for nasa/fprime#4087 (#286) 2025-09-02 16:09:38 -07:00
3 changed files with 8 additions and 4 deletions

View File

@ -95,12 +95,12 @@ void setupTopology(const TopologyState& state) {
{%- endif %}
}
void startRateGroups(Fw::TimeInterval interval) {
void startRateGroups(const Fw::TimeInterval& interval) {
// The timer component drives the fundamental tick rate of the system.
// Svc::RateGroupDriver will divide this down to the slower rate groups.
// This call will block until the stopRateGroups() call is made.
// For this Linux demo, that call is made from a signal handler.
timer.startTimer(interval.getSeconds()*1000+interval.getUSeconds()/1000);
timer.startTimer(interval);
}
void stopRateGroups() {

View File

@ -71,7 +71,7 @@ void teardownTopology(const TopologyState& state);
* This loop is stopped via a stopRateGroups call.
*
*/
void startRateGroups(Fw::TimeInterval interval = Fw::TimeInterval(1,0));
void startRateGroups(const Fw::TimeInterval& interval = Fw::TimeInterval(1,0));
/**
* \brief stop the rate groups

View File

@ -119,7 +119,11 @@ def new_component(build: Build, parsed_args: "argparse.Namespace"):
# Use current working directory name as default namespace, unless at project root
extra_context = {}
if not proj_root.samefile(Path.cwd()):
extra_context["component_namespace"] = Path.cwd().name
cwd = Path.cwd()
# If in default Components directory, use parent directory name, which should be the top level namespace directory
extra_context["component_namespace"] = (
cwd.parent.name if cwd.name == "Components" else cwd.name
)
gen_path = Path(cookiecutter(source, extra_context=extra_context)).resolve()