Skip to content

Commit

Permalink
Merge pull request #2031 from jphickey:fix-2030-es-perf-array-len
Browse files Browse the repository at this point in the history
Fix #2030, array length calculation for perf structs
  • Loading branch information
astrogeco committed Jan 19, 2022
2 parents 5cc196e + f598216 commit f8661cf
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions modules/es/fsw/src/cfe_es_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,16 @@
/*
** Defines
*/
#define CFE_ES_PERF_MASK_ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))

#define CFE_ES_PERF_TRIGGERMASK_INT_SIZE \
(sizeof(CFE_ES_Global.ResetDataPtr->Perf.MetaData.TriggerMask) / sizeof(uint32))
CFE_ES_PERF_MASK_ARRAY_SIZE(CFE_ES_Global.ResetDataPtr->Perf.MetaData.TriggerMask)
#define CFE_ES_PERF_TRIGGERMASK_EXT_SIZE \
(sizeof(CFE_ES_Global.TaskData.HkPacket.Payload.PerfTriggerMask) / sizeof(uint32))
#define CFE_ES_PERF_FILTERMASK_INT_SIZE (sizeof(CFE_ES_Global.ResetDataPtr->Perf.MetaData.FilterMask) / sizeof(uint32))
CFE_ES_PERF_MASK_ARRAY_SIZE(CFE_ES_Global.TaskData.HkPacket.Payload.PerfTriggerMask)
#define CFE_ES_PERF_FILTERMASK_INT_SIZE \
CFE_ES_PERF_MASK_ARRAY_SIZE(CFE_ES_Global.ResetDataPtr->Perf.MetaData.FilterMask)
#define CFE_ES_PERF_FILTERMASK_EXT_SIZE \
(sizeof(CFE_ES_Global.TaskData.HkPacket.Payload.PerfFilterMask) / sizeof(uint32))
CFE_ES_PERF_MASK_ARRAY_SIZE(CFE_ES_Global.TaskData.HkPacket.Payload.PerfFilterMask)

/*
** This define should be put in the OS API headers -- Right now it matches what the OS API uses
Expand Down

0 comments on commit f8661cf

Please sign in to comment.