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!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Bidirectional UART design for Ravenscar Date: Fri, 25 Aug 2017 23:24:38 +0100 Organization: A noiseless patient Spider Message-ID: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="a187b5efa3c0be430648db6860322d0e"; logging-data="24299"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+DYKXjum4B8Vp2YbiWkTtvo4te4NV/TdI=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (darwin) Cancel-Lock: sha1:LPbTvmrSyn0cxA7qv70O4hsKC5s= sha1:rRV7AAXG5DyPT+FBIJhqxHG5CVE= Xref: news.eternal-september.org comp.lang.ada:47807 Date: 2017-08-25T23:24:38+01:00 List-Id: 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?