Skip to content

Commit d6272a3

Browse files
committed
Allow array step to be defined for count 1
Some systems that have configurable length, and clear vmem offsets applied will fail otherwise
1 parent 75d4d09 commit d6272a3

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

include/param/param.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ static const uint16_t node_self = 0;
212212

213213

214214
#define PARAM_DEFINE_STATIC_RAM(_id, _name, _type, _array_count, _array_step, _flags, _callback, _unit, _physaddr, _docstr) \
215-
_Static_assert(((_array_count) <= 1) ? ((_array_step) <= 0) : ((_array_step) >= PARAM_SIZEOF(_type)), "param: array_step invalid for array_count"); \
215+
_Static_assert(((_array_count) <= 1) ? 1 : ((_array_step) >= PARAM_SIZEOF(_type)), "param: array_step invalid for array_count"); \
216216
_Static_assert(((_array_count) <= 1) ? 1 : (((_array_step) % PARAM_ALIGNOF(_type)) == 0U),"param: array_step not aligned to type"); \
217217
PARAM_TYPECHECK(_name, _type, _physaddr); \
218218
PARAM_TIMESTAMP_DECL(_name) \
@@ -236,7 +236,7 @@ static const uint16_t node_self = 0;
236236
}
237237

238238
#define PARAM_DEFINE_STATIC_VMEM(_id, _name, _type, _array_count, _array_step, _flags, _callback, _unit, _vmem_name, _vmem_addr, _docstr) \
239-
_Static_assert(((_array_count) <= 1) ? ((_array_step) <= 0) : ((_array_step) >= PARAM_SIZEOF(_type)), "param: array_step invalid for array_count"); \
239+
_Static_assert(((_array_count) <= 1) ? 1 : ((_array_step) >= PARAM_SIZEOF(_type)), "param: array_step invalid for array_count"); \
240240
_Static_assert(((_array_count) <= 1) ? 1 : (((_array_step) % PARAM_ALIGNOF(_type)) == 0U),"param: array_step not aligned to type"); \
241241
PARAM_TIMESTAMP_DECL(_name) \
242242
__attribute__((section("param." STR(_name)))) \
@@ -261,7 +261,7 @@ static const uint16_t node_self = 0;
261261
#define PARAM_REMOTE_NODE_IGNORE 16382
262262

263263
#define PARAM_DEFINE_REMOTE(_id, _name, _nodeaddr, _type, _array_count, _array_step, _flags, _physaddr, _docstr) \
264-
_Static_assert(((_array_count) <= 1) ? ((_array_step) <= 0) : ((_array_step) >= PARAM_SIZEOF(_type)), "param: array_step invalid for array_count"); \
264+
_Static_assert(((_array_count) <= 1) ? 1 : ((_array_step) >= PARAM_SIZEOF(_type)), "param: array_step invalid for array_count"); \
265265
_Static_assert(((_array_count) <= 1) ? 1 : (((_array_step) % PARAM_ALIGNOF(_type)) == 0U),"param: array_step not aligned to type"); \
266266
PARAM_TYPECHECK(_name, _type, _physaddr); \
267267
PARAM_TIMESTAMP_DECL(_name) \
@@ -283,7 +283,7 @@ static const uint16_t node_self = 0;
283283
};
284284

285285
#define PARAM_DEFINE_REMOTE_DYNAMIC(_id, _name, _node, _type, _array_count, _array_step, _flags, _physaddr, _docstr) \
286-
_Static_assert(((_array_count) <= 1) ? ((_array_step) <= 0) : ((_array_step) >= PARAM_SIZEOF(_type)), "param: array_step invalid for array_count"); \
286+
_Static_assert(((_array_count) <= 1) ? 1 : ((_array_step) >= PARAM_SIZEOF(_type)), "param: array_step invalid for array_count"); \
287287
_Static_assert(((_array_count) <= 1) ? 1 : (((_array_step) % PARAM_ALIGNOF(_type)) == 0U),"param: array_step not aligned to type"); \
288288
PARAM_TYPECHECK(_name, _type, _physaddr); \
289289
PARAM_TIMESTAMP_DECL(_name) \

0 commit comments

Comments
 (0)