comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: Bidirectional UART design for Ravenscar
Date: Sat, 26 Aug 2017 01:40:01 +0300
Date: 2017-08-26T01:40:01+03:00	[thread overview]
Message-ID: <f0bn9rFbo6oU1@mid.individual.net> (raw)
In-Reply-To: <lyzianxp3t.fsf@pushface.org>

On 17-08-26 01:24 , Simon Wright wrote:
> I'm trying to implement a two-way interrupt-driven interface via a UART
> with Ravenscar, and having trouble because there is one interrupt with
> multiple causes; a writer must wait until transmission is possible
> before putting the next character, while a reader must wait until
> there's a character to be read.
>
> This makes it hard to write a PO with a single entry (a Ravenscar
> restriction) that serves both requirements.
>
> It occurs to me that the interrupt handler could release one of two
> suspension objects; if it's Tx_Transfer_Complete, release the SO that
> the writer waits on, if it's Rx_Transfer_Complete release the reader's
> SO.
>
> Does that seem a reasonable approach?

IMO yes.

I suppose that Tx and Rx completion can happen at the same time (in the 
same execution of the interrupt handler), in which case both suspension 
objects should be released.

-- 
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
       .      @       .

  reply	other threads:[~2017-08-25 22:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-25 22:24 Bidirectional UART design for Ravenscar Simon Wright
2017-08-25 22:40 ` Niklas Holsti [this message]
2017-08-26 11:04 ` Jeffrey R. Carter
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox