[riot-notifications] [RIOT] Kinetis: hwtimer refactor (#3146)

Joakim Gebart notifications at github.com
Wed Jun 3 06:28:12 CEST 2015


> +        "mov r7, #1\n"
> +        /* Any ticks that occur between the below write to CNR_p and the write
> +         * to TEN below will be lost, try to keep it short to minimize the
> +         * risk. */
> +        /* write garbage to CNR to latch the value, it does not matter what the
> +         * value of r7 is. Testing shows that the write must be 32 bit wide or
> +         * we will get garbage when reading back CNR. */
> +        "str r7, [%[CNR_p], #0]\n"
> +        "ldrh %[CNR], [%[CNR_p], #0]\n" /* Read CNR */
> +        "strh r6, [%[TEN], #0]\n"       /* disable timer */
> +        "strh %[CMR], [%[CMR_p], #0]\n" /* update CMR */
> +        "strh r7, [%[TEN], #0]\n"       /* enable timer */
> +        : /* Output variables */
> +        [CNR] "=&r" (cnr)
> +        : /* Input variables */
> +        [TEN] "r" (BITBAND_ADDR(&(LPTIMER_DEV->CSR), LPTMR_CSR_TEN_SHIFT)),

oops, I meant to write BITBAND_REGADDR which is available in the MKxxxxx.h headers. Addressed.

---
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/3146/files#r31593010
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20150602/e19940e2/attachment-0001.html>


More information about the notifications mailing list