Skip to content

Commit

Permalink
Fix minor mistakes. Typeless Actions still not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
erlingrj committed Oct 18, 2024
1 parent 606585c commit 3851ac4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set(BOARD frdm_k64f)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(reactor-uc-zephyr)

set(NETWORK_POSIX_TCP ON)
set(NETWORK_POSIX_TCP ON CACHE BOOL "blah")
set(PLATFORM "ZEPHYR" CACHE STRING "Platform to target")
add_subdirectory(../../../../ reactor-uc)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(reactor-uc-zephyr)


set(NETWORK_POSIX_TCP ON)
set(NETWORK_POSIX_TCP ON CACHE BOOL "blah")
set(PLATFORM "ZEPHYR" CACHE STRING "Platform to target")
add_subdirectory(../../../../ reactor-uc)

Expand Down
7 changes: 4 additions & 3 deletions examples/zephyr/basic_federated/federated_sender/src/sender.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Action *action_ptr = NULL;

void button_pressed(const struct device *dev, struct gpio_callback *cb, uint32_t pins) {
printk("Button pressed!\n");
action_ptr->schedule(action_ptr, 0, NULL);
action_ptr->schedule(action_ptr, 0, true);
}

void setup_button() {
Expand Down Expand Up @@ -55,7 +55,7 @@ typedef struct {
char msg[32];
} msg_t;

DEFINE_PHYSICAL_ACTION(Action1, 1, 0, void *, 1, 0, 0)
DEFINE_PHYSICAL_ACTION(Action1, 1, 0, bool, 1, 0, 0)
DEFINE_REACTION(Sender, 0, 0)
DEFINE_OUTPUT_PORT(Out, 1)

Expand Down Expand Up @@ -138,10 +138,11 @@ void MainSender_ctor(MainSender *self, Environment *env) {
self->_bundles[0] = &self->bundle.super;
}

ENTRY_POINT_FEDERATED(MainSender, FOREVER, true, false, 1)
ENTRY_POINT_FEDERATED(MainSender, FOREVER, true, true, 1)

int main() {
setup_button();
setup_led();
action_ptr = &MainSender_main.sender.action;
lf_MainSender_start();
}
4 changes: 2 additions & 2 deletions include/reactor-uc/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,11 @@ typedef struct FederatedInputConnection FederatedInputConnection;
Environment *env = &FederateName##_env; \
FederateName *main = &FederateName##_main; \
Environment_ctor(env, (Reactor *)main); \
env->enter_critical_section(env); \
FederateName##_ctor(main, env); \
env->scheduler.set_timeout(&env->scheduler, Timeout); \
env->scheduler.keep_alive = KeepAlive; \
env->has_async_events = HasInputs; \
env->enter_critical_section(env); \
FederateName##_ctor(main, env); \
env->net_bundles_size = NumBundles; \
env->net_bundles = (FederatedConnectionBundle **)&main->_bundles; \
env->assemble(env); \
Expand Down

0 comments on commit 3851ac4

Please sign in to comment.