From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by befuddled.reisers.ca (Postfix, from userid 65534) id D374E1EFDF6; Fri, 18 Nov 2016 12:27:52 -0500 (EST) Received: from mail-it0-x244.google.com (mail-it0-x244.google.com [IPv6:2607:f8b0:4001:c0b::244]) by befuddled.reisers.ca (Postfix) with ESMTPS id 63E5F1EFDDD for ; Fri, 18 Nov 2016 12:27:51 -0500 (EST) Received: by mail-it0-x244.google.com with SMTP id o1so5637339ito.1 for ; Fri, 18 Nov 2016 09:27:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=fq6IIn9WdiyB3dOXxnDmChJ28vvAAGlnhkeKpZu3zlo=; b=a12oLAN50Bc+JGc3zNdPpojCKn3VhRn7K4ldnJg/KQuSW2YctFmGB71GmYKpbZW1GL TWOxjGvDDGWSpMxLbwYRyKLt415Hq0nGkrJEzyf5tQVWM3mw9ke3ay4eU4tTOw6EPEX+ odu53oOM5azoaEx6D1vJijUnEMsWS1wY2PAxqnktkwh+FMMtTSP/8AVesl0i/WQaOqEp IkrlCdTTtH929S78gdbxibPx1Tav3gA03t6eHbJZEea81aTNLeCKKsIWXr+tei4pHb2B PBBTVTwciP3PW3FOsrNPLYefBE+E+VrCmSoC3f3Dp+eI+Wfb1C4/ioE/fDYiDmu0PbqM iAmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=fq6IIn9WdiyB3dOXxnDmChJ28vvAAGlnhkeKpZu3zlo=; b=A8jmatfjUJAkz9QJ0AJoS2mfDD4DEIpGy1ciQndFRwPKVRJsYNS39MIRNeK8eUHP9L N5/lWArWfnIYmxFy/E5PxyetsIC1HwF9cAmVpqFtQzLF3fzA0x6vMu/LSKDGvhwUltIU TEkBj9zisdUGgYvV28R/uZhqP0GvHB4PsmTUWT8aPSTYAP3wSmnVqM++QokEboKuLfw3 oNGm3Lm4b5Cj5S63ev96ZIKO/Q7CudiJY9dp9YG5qNfQnMtaCh0pyO/FINspr10hP+ND 7ILrIOH7gQdfbxy5DTpQMn72AlOnGnf3jJyzRa/rMpu1Z/qtIODAl1hAiltOuPeSS2f1 9hXw== X-Gm-Message-State: AKaTC02zQfZcROefKJzqekgFI7UcF92AAwjh8CYovRi5D+dgYjsKGnwZtuiwl1Kt1vJAwQ== X-Received: by 10.36.205.132 with SMTP id l126mr793383itg.64.1479490069552; Fri, 18 Nov 2016 09:27:49 -0800 (PST) Received: from db (CPEc03fd54e25a1-CM00fc8d424d60.cpe.net.cable.rogers.com. [99.236.54.233]) by smtp.gmail.com with ESMTPSA id e23sm1279410itd.19.2016.11.18.09.27.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Nov 2016 09:27:48 -0800 (PST) Date: Fri, 18 Nov 2016 12:27:47 -0500 From: David To: speakup@linux-speakup.org Subject: using system serial tty drivers Message-ID: <20161118172747.GA25081@db> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 X-BeenThere: speakup@linux-speakup.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Speakup is a screen review system for Linux." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2016 17:27:52 -0000 The purpose of defines is that all drivers will dump the old serial stuff eventually. Just wrappping serial_out to do one character transfers is a performance hit big time. that is why I refactored the buffer handlers so you can do. while ( (bytes = synth_buffer_status(true) ) != 0) { if (bytes < 0) { // flush code goes here // drain tty buffers etc. and break loop } // we have something to write to synth this_write = synth_buffer_gets(my_buff, 256 ); written = write_serial(fd, my_buff, this_write); if (written < this_write) synth_buffer_ungets(this_write-written); // synth is full so push back unwritten chars and wait ... } } // do_catchup