Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recommendation is to change ScheduleTable from 1 Dim Array to 2 Dim array #4

Open
MauriceS-gti opened this issue Mar 9, 2020 · 0 comments

Comments

@MauriceS-gti
Copy link

MauriceS-gti commented Mar 9, 2020

The current format of the array in fsw/tables/sch_defsch.c:

SCH_ScheduleEntry_t SCH_DefaultScheduleTable[SCH_TABLE_ENTRIES]
is a one dimensional array slots*entries. It is processed by SCH_ProcessNextSlot as basically a 2D array:
SlotIndex = SCH_AppData.NextSlotNumber * SCH_ENTRIES_PER_SLOT;
NextEntry = &SCH_AppData.ScheduleTable[SlotIndex];
By making a slight change in the definition of the Table - NOT the code, the compiler will be much more helpful in

  • Discovering issues where not enough or too many entries are defined per slot, causing an action to move into the backwards or forwards to the wrong slot
  • Increase readability
  • File can be shorter, because the compiler will set (AFAIK) the undefined entries to 0 anyway

This does not require a change in the code, except for the code generator (which I have some idea's for but not yet done)
sch_def_schtbl.c.gz

Reporter Info
Maurice Smulders, Geneva Technologies Inc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant