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!news.eternal-september.org!feeder.eternal-september.org!feed.usenet.farm!feeder4.usenet.farm!newsfeed.xs4all.nl!newsfeed9.news.xs4all.nl!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Bidirectional UART design for Ravenscar Date: Sat, 26 Aug 2017 01:40:01 +0300 Organization: Tidorum Ltd Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net Jzbses4PZ7xoMHyPK3jxmQw9JLO857hrc3xCUjYWmWyJCnPIPH Cancel-Lock: sha1:M+aemqiSs2QWB8pKCvXf1BBBsAY= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 In-Reply-To: Xref: news.eternal-september.org comp.lang.ada:47808 Date: 2017-08-26T01:40:01+03:00 List-Id: 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 . @ .