Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Kelsey Bjarnason Newsgroups: comp.os.linux.advocacy,comp.os.linux.embedded Subject: Re: Reading the Riot Act To ARM's developers Date: Fri, 10 Feb 2012 21:22:44 -0800 Organization: A noiseless patient Spider Lines: 38 Message-ID: <4iah09-1p2.ln1@spankydtr.localhost.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Info: mx04.eternal-september.org; posting-host="1slvsP1WECuGs7FJVcqjxw"; logging-data="12646"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/sFLxaS897P2V0lSLtXMVDj3O0NGilQ24=" User-Agent: Pan/0.133 (House of Butterflies) Cancel-Lock: sha1:OFjxSX955ugvf/hrFbMn/CoduAc= Xref: x330-a1.tempe.blueboxinc.net comp.os.linux.advocacy:88132 comp.os.linux.embedded:97 [snips] On Tue, 07 Feb 2012 23:43:43 +0000, 7 wrote: > Typically the CMSIS library forces you to write code using hard coded > numbers. So you want to set some flag to enable an interrupt it would > read something like > > SYSCON->INT |= (1<<4) > > Here is the crunch, who the hell is going to know if its the 4th bit or > the 14th bit when you got a million of these lines of code? > > Shortest possible answer NOBODY. Not even you!!!!!!!!! > > And then you change CPU, and something changes in hardware, how will you > know what to look for - you gonna search for "4" all throughout the > code????? Are you actually using a tool so bad it doesn't let you define your own symbols? define INT_XMA (1 << 4) ... SYSCON->INT |= INT_XMA Need to change INT_XMA? Change it in one place, *every* usage of it changes. If your development tools can't cope with this - and, ideally, with include files - then you should consider using a macro preprocessor to generate the compilable code from the maintainable code. Either way, has nothing to do with ARM, per se; just to do with an apparently crippled toolchain and/or a developer who can't look beyond the trivial tool to see possible solutions.