On Fri, Sep 9, 2022 at 7:44 AM TimH <t...@jti.uk.com.invalid> wrote: > >From: TimH <t...@jti.uk.com> > >Sent: 07 September 2022 12:14 > > > >A quick dabble with DMA for the SAMA5D2 chip I'm using suggests the native > >NuttX support for this is incorrect and probably applies to SAMA5D3 chips > etc. > >There are refences in sam_xdmac.c to PIDS that simply don't exist in the > >SAMA5D2. > > > On further inspection it seems sam_xdmac.h is only describing the > configuration of a SAMA5D4. The SAMA5D3 and SAMA5D2 have different numbers > of channels and different channel definitions > > Rather than clutter sam_xdmac.h with loads of #if defined (SAMA5D2) stuff > would it be better to deal with this in the same way as the memory and > pinmap files, etc, and have: > > _sama5d2x_xdmac.h > _sama5d3x_xdmac.h > _sama5d4x_xdmac.h > > Then change sam_xdmac.h to have the more easy to follow > > #if defined(SAMA5D2) > # include "hardware/_sama5d2x_xdmac.h" > #elif > etc > > I think that's neater?
I think so. The #if defined stuff makes sense when parts are mostly identical but if there's so much of it that it makes the file hard to read, then splitting it up makes more sense. Cheers Nathan