Skip to content

Commit eceaec5

Browse files
committed
Module is not failed when output exists.
When input does not exists, but the output with same module address is marked as ative, mark the module as active. This allows hJOP to set output as outputs are always enabled. Close #25.
1 parent b869f86 commit eceaec5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/lib-api.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,11 @@ unsigned int GetMaxModuleAddr() { return std::max(IO_IN_MODULES_COUNT, IO_OUT_MO
243243

244244
bool IsModuleFailure(unsigned int module) {
245245
try {
246-
return (rx.started == RcsStartState::started && module < IO_IN_MODULES_COUNT &&
247-
rx.user_active_in[module] && !rx.real_active_in[module]);
246+
// Output module is always marked as active - so outputs
247+
// could be set even if input module is absent.
248+
if (module < IO_OUT_MODULES_COUNT && rx.user_active_out[module])
249+
return false;
250+
return (rx.started == RcsStartState::started && module < IO_IN_MODULES_COUNT && rx.user_active_in[module] && !rx.real_active_in[module]);
248251
} catch (...) { return false; }
249252
}
250253

0 commit comments

Comments
 (0)