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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: buffer2.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!1.eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: "G.B." Newsgroups: comp.lang.ada Subject: Re: Running a preprocessor from GPS? Date: Thu, 30 Jul 2015 16:48:42 +0200 Organization: A noiseless patient Spider Message-ID: References: <2df4698f-4c8e-457c-822d-209cb2f8ab5e@googlegroups.com> <877fpi84o6.fsf@adaheads.sparre-andersen.dk> Reply-To: nonlegitur@futureapps.de Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 30 Jul 2015 14:47:08 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="b96887e80893c84a90c3007226ca0d1c"; logging-data="5108"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/MJ/XUH1gwswHiwShAEioSr197Gt6vtY8=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 In-Reply-To: <877fpi84o6.fsf@adaheads.sparre-andersen.dk> Cancel-Lock: sha1:eT1TMrU0AjlDXNaVZMmDn7QOemE= Xref: number.nntp.giganews.com comp.lang.ada:194523 Date: 2015-07-30T16:48:42+02:00 List-Id: On 30.07.15 09:50, Jacob Sparre Andersen wrote: > Simon Wright wrote: >>> Simon Wright wrote: > >>>> return Tick * Time_Base ((if System.FreeRTOS.Tasks.In_ISR >>>> then xTaskGetTickCountFromISR >>>> else xTaskGetTickCount)); > >> 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; > > I definitely find the latter more readable than the former (at least > without syntax highlighting). We now have named conditional expressions, so function GetTickCount return T is ((if System.FreeRTOS.Tasks.In_Isr then xTaskGetTickCountFromISR else xTaskGetTickCount)); begin return Tick * Time_Base (GetTickCount); end