Add chFifoObjectInitAligned
Posted: Mon Jul 16, 2018 5:47 pm
Hello,
I have recently begun using ChibiOS and have noticed something that I believe may be a design inconsistency. Guarded and unguarded memory pools both provide a chXyzObjectInit and chXyzObjectInitAligned function so that the user can specify their own memory alignment if necessary. However, chFifo provides only chFifoObjectInit, which requires a memory alignment despite a function name that (if consistent with memory pools) implies the internal use of PORT_NATURAL_ALIGN when this is not the case.
I suggest changing the existing function to chFifoObjectInitAligned, and writing another chFifoObjectInit that uses PORT_NATURAL_ALIGN to call chFifoObjectInitAligned.
Please let me know if I have misunderstood something (and thanks for your time).
I have recently begun using ChibiOS and have noticed something that I believe may be a design inconsistency. Guarded and unguarded memory pools both provide a chXyzObjectInit and chXyzObjectInitAligned function so that the user can specify their own memory alignment if necessary. However, chFifo provides only chFifoObjectInit, which requires a memory alignment despite a function name that (if consistent with memory pools) implies the internal use of PORT_NATURAL_ALIGN when this is not the case.
I suggest changing the existing function to chFifoObjectInitAligned, and writing another chFifoObjectInit that uses PORT_NATURAL_ALIGN to call chFifoObjectInitAligned.
Please let me know if I have misunderstood something (and thanks for your time).