Chopstx 1.11

NIIBE Yutaka gniibe at fsij.org
Wed Oct 3 02:46:02 CEST 2018


Hello,

Chopstx version 1.11 is released.  Actually, version 1.10 was released
with no announcement, then, I found a problem, which was fixed in 1.11.

Interrupt handling is changed to require call of new function
chopstx_intr_done.  This change allows flexible use of chopstx_poll;
Now, it's OK to call chopstx_poll again even when some of interrupts are
ready to be handled.  (And I found that we had spurious interrupts in
older versions, which doesn't occur any more with chopstx_intr_done).

I'm testing acknowledge button with FST-01SZ prototype.

============================  Code example
    static chopstx_intr_t intr0;
    static chopstx_intr_t intr1;

    static struct chx_poll_head *const poll_ptrs[] = {
      (struct chx_poll_head *const)&intr0,
      (struct chx_poll_head *const)&intr1,
    };

    main ()
    {
      uint32_t timer;

      hardware_init0 ();
      chopstx_claim_irq (&intr0, INTR_REQ_SOMETHING0);
      hardware_init1 ();
      chopstx_claim_irq (&intr1, INTR_REQ_SOMETHING1);

      while (1)
        {
          timer = 5000; /* 5msec, for example */

          chopstx_poll (&timer, 2, poll_ptrs);
    #if 0 /*older versions */
          /* In older versions of Chopstx,
           * all events should be handled,
           * after return of chopstx_poll and
           * before next call of chopstx_poll
           */

          if (intr0.ready)
            {
              interrupt_handler0 ();
              /* We didn't have chopstx_intr_done */
            }

          if (intr1.ready)
            {
              interrupt_handler1 ();
              /* We didn't have chopstx_intr_done */
            }

          if (intr0.ready == 0 && intr1.ready == 0)
            {
              /* timeout handling */
            }
    #else
          if (intr0.ready)
            {
              interrupt_handler0 ();
              chopstx_intr_done (&intr0);
              /* Now, it's possible not to allocate any clocks for
                 handling intr1 when intr0 is busy */
            }
          else if (intr1.ready)
            {
              interrupt_handler1 ();
              chopstx_intr_done (&intr1);
            }
          else
            {
              /* timeout handling */
            }
    #endif
        }
    }
============================

============================
Chopstx version 1.11 is released.

    tag release/1.11
    Tagger: NIIBE Yutaka <gniibe at fsij.org>
    Date:   Tue Oct 2 09:59:09 2018 +0900

    commit fffb8aa3b3731fb242d9b99f7d935d85425c1404

Chopstx is a simple RT thread library.  Major change sice version 1.9 is
interrupt handling and experiment with FST-01SZ prototype.  We have USB
bug fix for ZLP, too.
-- 



More information about the Gnuk-users mailing list