Skip to content

Commit c7c49b9

Browse files
committed
Add global init variable for stdlib stateful POUs
If not for these changes, using a stdlib stateful POU inside a function would not compile
1 parent 7f125b3 commit c7c49b9

File tree

5 files changed

+438
-1
lines changed

5 files changed

+438
-1
lines changed

libs/stdlib/src/bistable_functionblocks.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ pub struct EmptyVTable;
1919
#[no_mangle]
2020
#[used]
2121
pub static __vtable_SR: EmptyVTable = EmptyVTable {};
22+
23+
#[allow(non_upper_case_globals)]
24+
#[no_mangle]
25+
#[used]
26+
pub static __SR__init: SetResetParams =
27+
SetResetParams { __vtable: 0, set: false, reset: false, output: false };
2228
///.
2329
/// Bistable function, set dominant
2430
///
@@ -32,6 +38,13 @@ pub extern "C" fn SR(params: &mut SetResetParams) {
3238
#[no_mangle]
3339
#[used]
3440
pub static __vtable_RS: EmptyVTable = EmptyVTable {};
41+
42+
#[allow(non_upper_case_globals)]
43+
#[no_mangle]
44+
#[used]
45+
pub static __RS__init: SetResetParams =
46+
SetResetParams { __vtable: 0, set: false, reset: false, output: false };
47+
3548
///.
3649
/// Bistable function, reset dominant
3750
///

0 commit comments

Comments
 (0)