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: Thu, 30 Jul 2015 18:31:52 +0100 Organization: A noiseless patient Spider Message-ID: References: <2df4698f-4c8e-457c-822d-209cb2f8ab5e@googlegroups.com> <76a06b25-96c1-49d2-8b88-e0a8ece98cc0@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="fbe1d5b0173017f7cc2ccfa8ad3bc8c1"; logging-data="11616"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+E+/RFqREiqrkq4+DXDlBVkXcgDQZS6jo=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) Cancel-Lock: sha1:eAERuCYgXgtdBLHRseOOX+muITM= sha1:LJM2YqRNw/76ePeTUkDfm7urH+g= Xref: news.eternal-september.org comp.lang.ada:27226 Date: 2015-07-30T18:31:52+01:00 List-Id: EGarrulo writes: > On Thursday, July 30, 2015 at 6:14:52 PM UTC+2, Simon Wright wrote: >> EGarrulo writes: >> >> > KISS solution: >> > >> > TickCount := (if System.FreeRTOS.Tasks.In_ISR >> > then xTaskGetTickCountFromISR >> > else xTaskGetTickCount) >> > return Tick * Time_Base (TickCount); >> > >> > or: >> > >> > if System.FreeRTOS.Tasks.In_ISR then >> > TickCount := xTaskGetTickCountFromISR; >> > else >> > TickCount := xTaskGetTickCount; >> > end if; >> > return Tick * Time_Base (TickCount); >> >> Both of these require Tick_Count (!) > > But then why did you write xTaskGetTickCountFromISR (!)? :D > > I know, I know: they must be system calls. I just went with what -- > at first sight -- seemed your naming convention. Indeed! I'd probably have called the variable Ticks.