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!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Running a preprocessor from GPS? Date: Wed, 29 Jul 2015 21:38:45 +0100 Organization: A noiseless patient Spider Message-ID: References: <2df4698f-4c8e-457c-822d-209cb2f8ab5e@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="fbe1d5b0173017f7cc2ccfa8ad3bc8c1"; logging-data="31384"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19c5jitTFWMTn9oUZ/AvXf3h1Y09jvhgdA=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) Cancel-Lock: sha1:AHcKnFG0Y9uCW8T5OLihbqW0Xnw= sha1:uyfR9l4+k+Vsviny2ScY6pnBVZ8= Xref: news.eternal-september.org comp.lang.ada:27151 Date: 2015-07-29T21:38:45+01:00 List-Id: "Randy Brukardt" writes: > "Simon Wright" wrote in message > news:lywpxjxxza.fsf@pushface.org... >> I haven't used them often, but don't see the problem with >> >> return Tick * Time_Base ((if System.FreeRTOS.Tasks.In_ISR >> then xTaskGetTickCountFromISR >> else xTaskGetTickCount)); > > Verbosity, for one. Second, the hiding of the control structure. In > general, it's better to write the control structure out in a > subprogram body, it's a lot more readable. I dunno. The version below is quite verbose, and verges on being less readable. But this is a style issue, I think. if System.FreeRTOS.Tasks.In_ISR then return Tick * Time_Base (xTaskGetTickCountFromISR); else return Tick * Time_Base (xTaskGetTickCount); end if;