Skip to content

Commit

Permalink
signals: be more explicit with pointers
Browse files Browse the repository at this point in the history
  • Loading branch information
willeccles committed Mar 31, 2023
1 parent 1218403 commit e7dcc88
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions examples/examplemodel1/src/model.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Auto-generated VeriStand model interface code for my_new_model.
*
* Generated Thu Sep 08 12:07:35 2022
* Generated Fri Mar 31 11:00:09 2023
*
* You almost certainly do NOT want to edit this file, as it may be overwritten
* at any time!
Expand Down Expand Up @@ -116,7 +116,7 @@ double USER_GetValueByDataType(void* ptr, int32_t idx, int32_t type) {

int32_t USER_Initialize(void) {
/* Populate pointers to signal values */
rtSignalAttribs[0].addr = (uintptr_t)rtSignal.i32_vec_sig;
rtSignalAttribs[0].addr = (uintptr_t)&*rtSignal.i32_vec_sig;
rtSignalAttribs[1].addr = (uintptr_t)&rtSignal.double_sig;

return my_new_model_Initialize();
Expand Down
2 changes: 1 addition & 1 deletion examples/examplemodel1/src/model.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Auto-generated VeriStand model types for my_new_model.
*
* Generated Thu Sep 08 12:07:35 2022
* Generated Fri Mar 31 11:00:09 2023
*
* You almost certainly do NOT want to edit this file, as it may be overwritten
* at any time!
Expand Down
4 changes: 2 additions & 2 deletions genvsmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,9 +714,9 @@ def FmtSignalInit(signals) -> str:
if sig["dimX"] == 1 and sig["dimY"] == 1:
prefix = '&'
elif sig["dimX"] > 1 and sig["dimY"] == 1:
prefix = ''
prefix = '&*'
elif sig["dimX"] > 1 and sig["dimY"] > 1:
prefix = '*'
prefix = '&**'
catname = '' if cat == ':default' else '.' + cat
outstr += f'{prefix}rtSignal{catname}.{sig["name"]};\n'
i += 1
Expand Down

0 comments on commit e7dcc88

Please sign in to comment.