<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>LeafLabs Garden &#187; Topic: Using hardware timer interrupt controlled software serial within a library</title>
		<link>http://forums.leaflabs.com/topic.php?id=1162</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:07:57 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=1162" rel="self" type="application/rss+xml" />

		<item>
			<title>HDS on "Using hardware timer interrupt controlled software serial within a library"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1162#post-7137</link>
			<pubDate>Thu, 10 Nov 2011 14:44:59 +0000</pubDate>
			<dc:creator>HDS</dc:creator>
			<guid isPermaLink="false">7137@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hi, all,&#60;/p&#62;
&#60;p&#62;perceived problems with the compiler of the IDE in using hardware timer to control a software serial (bitbanging) serial communication.&#60;/p&#62;
&#60;p&#62;(Maybe I'm not C/C++-freak enough to solve it?)&#60;br /&#62;
Win XP 32bit, SP2. Maple rev 5, Maple IDE 0.0.12&#60;/p&#62;
&#60;p&#62;The C++ library (SoftSerial.h. SoftSerial.cpp) was put into a folder under %mapleIDE%/libraries. Tried to add a timer interrupt to that.&#60;br /&#62;
Declared&#60;br /&#62;
HardwareTimer timer(2);&#60;br /&#62;
in the MapleIDE sketch after &#124;&#124; before&#60;br /&#62;
#include &#34;SoftSerial.h&#34;&#60;/p&#62;
&#60;p&#62;I was not able to&#60;br /&#62;
a) have the compiler recognize a public field of type HardwareTimer in the SoftSerial class defined in the header of the library (Compiler error: Type unknown)&#60;br /&#62;
b) have the compiler recognize a global instance of type HardwareTimer in the SoftSerial library&#60;br /&#62;
c) tried out all possible includes in the library, from FreeRTOS.h to timers.h&#60;/p&#62;
&#60;p&#62;Workaround:&#60;br /&#62;
had to move all the functions in the former library class to a sketch *.pde file,&#60;br /&#62;
rename all LCD.%functions% to LCDfunction in the main sketch - dropping object oriented concepts in order to make things working.&#60;/p&#62;
&#60;p&#62;Noticed, that a class constructor function having parameters is not accepted by the compiler, when it is not stuck in a library, but in the main sketch.&#60;br /&#62;
The library however cannot access to the class type declaration of HardwareTimer.&#60;/p&#62;
&#60;p&#62;Any ideas what went wrong? (Code too large to be posted here...)
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
