This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Identification of a (possible) 'Assert Conflict' w/in long-standing API file, adc.c!

Greetings,

In attempting to aid a poster - trying to implement, 'Hardware Oversampling' w/in the TM4C123 MCU - the following was discovered.    Credit  our (independent) firm's 'Jennifer' - w/this discovery - which intends to serve multiple others - if indeed the conflict proves 'real.'      (which both Jennifer & I believe - it is!)

The conflict appears w/in the ADC Function:  'ADCClockConfigSet()'  and is first described - then introduced below:

//*****************************************************************************
//
//! Sets the clock configuration for the ADC.
//!
//! \param ui32Base is the base address of the ADC to configure, which must  always be \b ADC0_BASE.

Yet - when this function is examined - the following reveals:

void
ADCClockConfigSet(uint32_t ui32Base, uint32_t ui32Config,
uint32_t ui32ClockDiv)
{
//
// Check the argument.
//
ASSERT((ui32Base == ADC0_BASE) || (ui32Base == ADC1_BASE));
ASSERT((ui32ClockDiv - 1) <= (ADC_CC_CLKDIV_M >> ADC_CC_CLKDIV_S));

It would appear - that the (expanded) acceptance of ADC1_BASE - occurred post this Function's (Preamble) or  Description...    And that this (new) broader ADC Module acceptance - negates the 'must always be'  (restriction) - w/in the  function's description!      Clearly NOT the 'biggest deal' - yet this should serve to alert others - that (perhaps) each/every 'preamble' to the newer functions - may not 'match' ... code reality...

For those interested - the original thread - in which our Jennifer engaged:  https://e2e.ti.com/support/microcontrollers/tiva_arm/f/908/p/712037/2635398#pi320098=1

  • Hi cb1,

    This is a great find, I will input this into our bug tracker so we can get the comment fixed on the next TivaWare release.
  • Also to add on, I tracked down that ADCClockConfigSet was added in TivaWare 2.1.0 as a new feature and only had ADC0_BASE then. So support for ADC1_BASE was indeed, as you guessed, added in later on and the comment just wasn't revised!
  • Thank you indeed, Ralph! Our young programmer/math-wiz - will be most pleased to note your kind approval.

    And - to empty my wallet (still further) w/the discovery of (any) vendor or (God forbid) cb1 'screw up!'     Too many of mine to note - yet  the uber-bright - highly motivated - young staff's'  'extra alertness'  substantially  reduces - often eliminates - product miscues!     (Which likely will cost MANY THOUSANDS if  'missed'  - and then - 'unhappily discovered' by our clients...  Who somehow - 'Resist & Dislike' - serving as our firm's (unpaid) 'QC Dept.')    (Is that the 'echo' - of  the 'screams' of  (so many) 'impaled/impaired' users - caused (w/out end) by 'Plague-istors  R9/R10'  ('123 LPad' - for those (only) newly arriving...)

    My assessment of the (likely) error's cause (conflict between Function Description & Code) - was 'FAR from a Guess!'     Having engaged in such work - for some time - w/ 'beyond average success" and w/both investor & my own funds at risk - (some) skill (may) have developed...   

  • Nearly unparsable (but the parenthesis were balanced;-)

    Best Regards,
    Dave

  • Mon Ami - you've been told - repeatedly - that w/age - your vision degrades.     Our corporate 'mutt' (papered German Shepherd) will shortly - produce off-spring - and one may 'Guide You' across/over/around - your (assumed) 'parenthetically challenged' - New England wasteland... 

    You may note 'parentheses' (from Webster) ... a word or clause - added as an explanation or comment - w/in a complete sentence.    Those are (regularly) employed to insure that the reader does not 'skip over' - or otherwise miss - key points!     Living 13 years in Los Angeles - and attending law-school (after engineering school) parentheses are 'well noted' in legal writings (briefs, court filings etc.); also in scripts and screenplays (entertainment industry) and w/in medical-device literature.    (where 'understanding' is absolutely paramount!)

    I've an unusually young staff - aiding their 'recognition' of that (key/critical) IS required - and this method (perhaps outside 'your' comfort) has been proven to, 'pay off!'

    Investors often direct:  'Accompanying any critical/protesting comment - should arrive - a 'superior' alternative!'     Staff / I 'note the critical' - yet the proposed alternative - lays (markedly) silent...   

    Should you/others have 'competing alternatives' (to capture attention) I'd be delighted to 'read/review' - then comment.    

    Note that the employment of 'bold' and 'color' are options - but are reserved for that  (especially vital.) 

  • For those interested in 'Writing Styles' - especially those destined for 'Research, Academia, or Tech' - the book below (most often) 'informs & advises'  cb1 writings.    Perhaps (some) 'Slings & Arrows' - may be (more properly) directed - in the author's direction.