From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Compiler doesn't respect 'Size for atomic object Date: Wed, 20 Dec 2017 21:20:20 +0000 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="47d826f47b613d695456d8f7d5ba85c7"; logging-data="3973"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18/wDTijv+91mj18Jt7VI8IWpQwh2ea2Nw=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (darwin) Cancel-Lock: sha1:zKXPDDZdeaQstDczbsIjMF0Le5U= sha1:UOTcFKQsT34ufp8IicRZdVXgLqo= Xref: reader02.eternal-september.org comp.lang.ada:49556 Date: 2017-12-20T21:20:20+00:00 List-Id: Simon Wright writes: > Simon Clubley writes: > >> If you use a naturally 32-bit variable instead of your Interrupt_ID >> data type, does it work ok ? > > Yes. My workround is to declare the atomic object as Integer, and > convert the Interrupt_ID to Integer (the ARM says only that Interrupt_ID > is discrete, but that's a bridge to cross when we come to it; it's > naturally an Integer on Cortex-M). I meant, naturally an integral type. The RM description of the NVIC's STIR indicates that the IRQ fits in 8 bits; the top 24 bits are reserved (write as 0).