Changeset cb59276 in rtems


Ignore:
Timestamp:
Dec 15, 2016, 5:15:13 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
d1c771c
Parents:
fd12159
git-author:
Sebastian Huber <sebastian.huber@…> (12/15/16 05:15:13)
git-committer:
Sebastian Huber <sebastian.huber@…> (12/15/16 10:05:08)
Message:

bsp/atsam: Use _Assert() instead of assert()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/atsam/libraries/libchip/include/xdmac.h

    rfd12159 rcb59276  
    7979#endif /* __rtems__ */
    8080#include <stdint.h>
    81 #include <assert.h>
     81#include <rtems/score/assert.h>
    8282
    8383/*------------------------------------------------------------------------------
     
    131131static inline uint32_t XDMAC_GetType(Xdmac *pXdmac)
    132132{
    133         assert(pXdmac);
     133        _Assert(pXdmac);
    134134        return pXdmac->XDMAC_GTYPE;
    135135}
     
    142142static inline uint32_t XDMAC_GetConfig(Xdmac *pXdmac)
    143143{
    144         assert(pXdmac);
     144        _Assert(pXdmac);
    145145        return pXdmac->XDMAC_GCFG;
    146146}
     
    153153static inline uint32_t XDMAC_GetArbiter(Xdmac *pXdmac)
    154154{
    155         assert(pXdmac);
     155        _Assert(pXdmac);
    156156        return pXdmac->XDMAC_GWAC;
    157157}
     
    165165static inline void XDMAC_EnableGIt (Xdmac *pXdmac, uint8_t dwInteruptMask)
    166166{
    167         assert(pXdmac);
     167        _Assert(pXdmac);
    168168        pXdmac->XDMAC_GIE = (XDMAC_GIE_IE0 << dwInteruptMask);
    169169}
     
    177177static inline void XDMAC_DisableGIt (Xdmac *pXdmac, uint8_t dwInteruptMask)
    178178{
    179         assert(pXdmac);
     179        _Assert(pXdmac);
    180180        pXdmac->XDMAC_GID = (XDMAC_GID_ID0 << dwInteruptMask);
    181181}
     
    188188static inline uint32_t XDMAC_GetGItMask(Xdmac *pXdmac)
    189189{
    190         assert(pXdmac);
     190        _Assert(pXdmac);
    191191        return (pXdmac->XDMAC_GIM);
    192192}
     
    199199static inline uint32_t XDMAC_GetGIsr(Xdmac *pXdmac)
    200200{
    201         assert(pXdmac);
     201        _Assert(pXdmac);
    202202        return (pXdmac->XDMAC_GIS);
    203203}
     
    211211{
    212212        uint32_t _dwStatus;
    213         assert(pXdmac);
     213        _Assert(pXdmac);
    214214        _dwStatus = pXdmac->XDMAC_GIS;
    215215        _dwStatus &= pXdmac->XDMAC_GIM;
     
    225225static inline void XDMAC_EnableChannel(Xdmac *pXdmac, uint8_t channel)
    226226{
    227         assert(pXdmac);
    228         assert(channel < XDMAC_CHANNEL_NUM);
     227        _Assert(pXdmac);
     228        _Assert(channel < XDMAC_CHANNEL_NUM);
    229229        pXdmac->XDMAC_GE = (XDMAC_GE_EN0 << channel);
    230230}
     
    238238static inline void XDMAC_EnableChannels(Xdmac *pXdmac, uint32_t bmChannels)
    239239{
    240         assert(pXdmac);
     240        _Assert(pXdmac);
    241241        pXdmac->XDMAC_GE = bmChannels;
    242242}
     
    250250static inline void XDMAC_DisableChannel(Xdmac *pXdmac, uint8_t channel)
    251251{
    252         assert(pXdmac);
    253         assert(channel < XDMAC_CHANNEL_NUM);
     252        _Assert(pXdmac);
     253        _Assert(channel < XDMAC_CHANNEL_NUM);
    254254        pXdmac->XDMAC_GD = (XDMAC_GD_DI0 << channel);
    255255}
     
    263263static inline void XDMAC_DisableChannels(Xdmac *pXdmac, uint32_t bmChannels)
    264264{
    265         assert(pXdmac);
     265        _Assert(pXdmac);
    266266        pXdmac->XDMAC_GD = bmChannels;
    267267}
     
    277277static inline uint32_t XDMAC_GetGlobalChStatus(Xdmac *pXdmac)
    278278{
    279         assert(pXdmac);
     279        _Assert(pXdmac);
    280280        return pXdmac->XDMAC_GS;
    281281}
     
    289289static inline void XDMAC_SuspendReadChannel(Xdmac *pXdmac, uint8_t channel)
    290290{
    291         assert(pXdmac);
    292         assert(channel < XDMAC_CHANNEL_NUM);
     291        _Assert(pXdmac);
     292        _Assert(channel < XDMAC_CHANNEL_NUM);
    293293        pXdmac->XDMAC_GRS |= XDMAC_GRS_RS0 << channel;
    294294}
     
    302302static inline void XDMAC_SuspendWriteChannel(Xdmac *pXdmac, uint8_t channel)
    303303{
    304         assert(pXdmac);
    305         assert(channel < XDMAC_CHANNEL_NUM);
     304        _Assert(pXdmac);
     305        _Assert(channel < XDMAC_CHANNEL_NUM);
    306306        pXdmac->XDMAC_GWS |= XDMAC_GWS_WS0 << channel;
    307307}
     
    315315static inline void XDMAC_SuspendReadWriteChannel(Xdmac *pXdmac, uint8_t channel)
    316316{
    317         assert(pXdmac);
    318         assert(channel < XDMAC_CHANNEL_NUM);
     317        _Assert(pXdmac);
     318        _Assert(channel < XDMAC_CHANNEL_NUM);
    319319        pXdmac->XDMAC_GRWS = (XDMAC_GRWS_RWS0 << channel);
    320320}
     
    328328static inline void XDMAC_ResumeReadWriteChannel(Xdmac *pXdmac, uint8_t channel)
    329329{
    330         assert(pXdmac);
    331         assert(channel < XDMAC_CHANNEL_NUM);
     330        _Assert(pXdmac);
     331        _Assert(channel < XDMAC_CHANNEL_NUM);
    332332        pXdmac->XDMAC_GRWR = (XDMAC_GRWR_RWR0 << channel);
    333333}
     
    342342{
    343343
    344         assert(pXdmac);
    345         assert(channel < XDMAC_CHANNEL_NUM);
     344        _Assert(pXdmac);
     345        _Assert(channel < XDMAC_CHANNEL_NUM);
    346346        pXdmac->XDMAC_GSWR = (XDMAC_GSWR_SWREQ0 << channel);
    347347}
     
    355355{
    356356
    357         assert(pXdmac);
     357        _Assert(pXdmac);
    358358        return pXdmac->XDMAC_GSWS;
    359359}
     
    367367static inline uint32_t XDMAC_GetChannelIsr (Xdmac *pXdmac, uint8_t channel)
    368368{
    369         assert(pXdmac);
    370         assert(channel < XDMAC_CHANNEL_NUM);
     369        _Assert(pXdmac);
     370        _Assert(channel < XDMAC_CHANNEL_NUM);
    371371        return pXdmac->XDMAC_CHID[channel].XDMAC_CIS;
    372372}
     
    381381static inline void XDMAC_SoftwareFlushReq(Xdmac *pXdmac, uint8_t channel)
    382382{
    383         assert(pXdmac);
    384         assert(channel < XDMAC_CHANNEL_NUM);
     383        _Assert(pXdmac);
     384        _Assert(channel < XDMAC_CHANNEL_NUM);
    385385        pXdmac->XDMAC_GSWF = (XDMAC_GSWF_SWF0 << channel);
    386386
     
    398398                                                        uint8_t dwInteruptMask)
    399399{
    400         assert(pXdmac);
    401         assert(channel < XDMAC_CHANNEL_NUM);
     400        _Assert(pXdmac);
     401        _Assert(channel < XDMAC_CHANNEL_NUM);
    402402        pXdmac->XDMAC_CHID[channel].XDMAC_CIE = dwInteruptMask;
    403403}
     
    413413                                                         uint8_t dwInteruptMask)
    414414{
    415         assert(pXdmac);
    416         assert(channel < XDMAC_CHANNEL_NUM);
     415        _Assert(pXdmac);
     416        _Assert(channel < XDMAC_CHANNEL_NUM);
    417417        pXdmac->XDMAC_CHID[channel].XDMAC_CID = dwInteruptMask;
    418418}
     
    426426static inline uint32_t XDMAC_GetChannelItMask (Xdmac *pXdmac, uint8_t channel)
    427427{
    428         assert(pXdmac);
    429         assert(channel < XDMAC_CHANNEL_NUM);
     428        _Assert(pXdmac);
     429        _Assert(channel < XDMAC_CHANNEL_NUM);
    430430        return pXdmac->XDMAC_CHID[channel].XDMAC_CIM;
    431431}
     
    440440{
    441441        uint32_t status;
    442         assert(pXdmac);
    443         assert(channel < XDMAC_CHANNEL_NUM);
     442        _Assert(pXdmac);
     443        _Assert(channel < XDMAC_CHANNEL_NUM);
    444444        status = pXdmac->XDMAC_CHID[channel].XDMAC_CIS;
    445445        status &= pXdmac->XDMAC_CHID[channel].XDMAC_CIM;
     
    457457static inline void XDMAC_SetSourceAddr(Xdmac *pXdmac, uint8_t channel, uint32_t addr)
    458458{
    459         assert(pXdmac);
    460         assert(channel < XDMAC_CHANNEL_NUM);
     459        _Assert(pXdmac);
     460        _Assert(channel < XDMAC_CHANNEL_NUM);
    461461        pXdmac->XDMAC_CHID[channel].XDMAC_CSA = addr;
    462462}
     
    471471static inline void XDMAC_SetDestinationAddr(Xdmac *pXdmac, uint8_t channel, uint32_t addr)
    472472{
    473         assert(pXdmac);
    474         assert(channel < XDMAC_CHANNEL_NUM);
     473        _Assert(pXdmac);
     474        _Assert(channel < XDMAC_CHANNEL_NUM);
    475475        pXdmac->XDMAC_CHID[channel].XDMAC_CDA = addr;
    476476}
     
    488488                                                         uint32_t addr, uint8_t ndaif)
    489489{
    490         assert(pXdmac);
    491         assert(ndaif < 2);
    492         assert(channel < XDMAC_CHANNEL_NUM);
     490        _Assert(pXdmac);
     491        _Assert(ndaif < 2);
     492        _Assert(channel < XDMAC_CHANNEL_NUM);
    493493        pXdmac->XDMAC_CHID[channel].XDMAC_CNDA =  (addr & 0xFFFFFFFC) | ndaif;
    494494}
     
    504504static inline void XDMAC_SetDescriptorControl(Xdmac *pXdmac, uint8_t channel, uint8_t config)
    505505{
    506         assert(pXdmac);
    507         assert(channel < XDMAC_CHANNEL_NUM);
     506        _Assert(pXdmac);
     507        _Assert(channel < XDMAC_CHANNEL_NUM);
    508508        pXdmac->XDMAC_CHID[channel].XDMAC_CNDC = config;
    509509}
     
    518518static inline void XDMAC_SetMicroblockControl(Xdmac *pXdmac, uint8_t channel, uint32_t ublen)
    519519{
    520         assert(pXdmac);
    521         assert(channel < XDMAC_CHANNEL_NUM);
     520        _Assert(pXdmac);
     521        _Assert(channel < XDMAC_CHANNEL_NUM);
    522522        pXdmac->XDMAC_CHID[channel].XDMAC_CUBC = XDMAC_CUBC_UBLEN(ublen);
    523523}
     
    532532static inline void XDMAC_SetBlockControl(Xdmac *pXdmac, uint8_t channel, uint16_t blen)
    533533{
    534         assert(pXdmac);
    535         assert(channel < XDMAC_CHANNEL_NUM);
     534        _Assert(pXdmac);
     535        _Assert(channel < XDMAC_CHANNEL_NUM);
    536536        pXdmac->XDMAC_CHID[channel].XDMAC_CBC = XDMAC_CBC_BLEN(blen);
    537537}
     
    546546static inline void XDMAC_SetChannelConfig(Xdmac *pXdmac, uint8_t channel, uint32_t config)
    547547{
    548         assert(pXdmac);
    549         assert(channel < XDMAC_CHANNEL_NUM);
     548        _Assert(pXdmac);
     549        _Assert(channel < XDMAC_CHANNEL_NUM);
    550550        pXdmac->XDMAC_CHID[channel].XDMAC_CC = config;
    551551}
     
    559559static inline uint32_t XDMAC_GetChannelConfig(Xdmac *pXdmac, uint8_t channel)
    560560{
    561         assert(pXdmac);
    562         assert(channel < XDMAC_CHANNEL_NUM);
     561        _Assert(pXdmac);
     562        _Assert(channel < XDMAC_CHANNEL_NUM);
    563563        return pXdmac->XDMAC_CHID[channel].XDMAC_CC;
    564564}
     
    575575{
    576576
    577         assert(pXdmac);
    578         assert(channel < XDMAC_CHANNEL_NUM);
     577        _Assert(pXdmac);
     578        _Assert(channel < XDMAC_CHANNEL_NUM);
    579579        pXdmac->XDMAC_CHID[channel].XDMAC_CDS_MSP = dds_msp;
    580580}
     
    590590                                                                         uint32_t subs)
    591591{
    592         assert(pXdmac);
    593         assert(channel < XDMAC_CHANNEL_NUM);
     592        _Assert(pXdmac);
     593        _Assert(channel < XDMAC_CHANNEL_NUM);
    594594        pXdmac->XDMAC_CHID[channel].XDMAC_CSUS = XDMAC_CSUS_SUBS(subs);
    595595}
     
    605605                uint32_t dubs)
    606606{
    607         assert(pXdmac);
    608         assert(channel < XDMAC_CHANNEL_NUM);
     607        _Assert(pXdmac);
     608        _Assert(channel < XDMAC_CHANNEL_NUM);
    609609        pXdmac->XDMAC_CHID[channel].XDMAC_CDUS = XDMAC_CDUS_DUBS(dubs);
    610610}
     
    618618static inline uint32_t XDMAC_GetChDestinationAddr(Xdmac *pXdmac, uint8_t channel)
    619619{
    620         assert(pXdmac);
    621         assert(channel < XDMAC_CHANNEL_NUM);
     620        _Assert(pXdmac);
     621        _Assert(channel < XDMAC_CHANNEL_NUM);
    622622        return pXdmac->XDMAC_CHID[channel].XDMAC_CDA;
    623623}
     
    625625static inline void XDMAC_StartTransfer(Xdmac *pXdmac, uint8_t channel)
    626626{
    627         assert(pXdmac);
    628         assert(channel < XDMAC_CHANNEL_NUM);
     627        _Assert(pXdmac);
     628        _Assert(channel < XDMAC_CHANNEL_NUM);
    629629        pXdmac->XDMAC_GE = (XDMAC_GE_EN0 << channel);
    630630        pXdmac->XDMAC_GIE = (XDMAC_GIE_IE0 << channel);
Note: See TracChangeset for help on using the changeset viewer.