<?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: SerialEvent() not supported?</title>
		<link>http://forums.leaflabs.com/topic.php?id=10137</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:25:25 +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=10137" rel="self" type="application/rss+xml" />

		<item>
			<title>ala42 on "SerialEvent() not supported?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=10137#post-22067</link>
			<pubDate>Mon, 21 Jan 2013 20:35:41 +0000</pubDate>
			<dc:creator>ala42</dc:creator>
			<guid isPermaLink="false">22067@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;serialEvent is not supported by libmaple, and this function is plain nonsense. On Arduino it is called after loop is called&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;int main(void)
{
	init();

#if defined(USBCON)
	USBDevice.attach();
#endif

	setup();

	for (;;) {
		loop();
		if (serialEventRun) serialEventRun();
	}

	return 0;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;and it does this:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;void serialEventRun(void)
{
#ifdef serialEvent_implemented
  if (Serial.available()) serialEvent();
#endif
#ifdef serialEvent1_implemented
  if (Serial1.available()) serialEvent1();
#endif
#ifdef serialEvent2_implemented
  if (Serial2.available()) serialEvent2();
#endif
#ifdef serialEvent3_implemented
  if (Serial3.available()) serialEvent3();
#endif
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;So in case you need serialEvent() called for compatibility reasons, add this at the end of your loop:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;if (Serial.available()) serialEvent();&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Depending on if you use Serial or USB communication, you might need to use SerialUSB.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>corsoy on "SerialEvent() not supported?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=10137#post-22063</link>
			<pubDate>Mon, 21 Jan 2013 11:33:37 +0000</pubDate>
			<dc:creator>corsoy</dc:creator>
			<guid isPermaLink="false">22063@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hi everyone,&#60;/p&#62;
&#60;p&#62;I want to know if some one of you worked on the SerialEvent(), SerialEvent1(), SerialEvent2(),...&#60;br /&#62;
This function are call when a series read was done (by interuption).&#60;/p&#62;
&#60;p&#62;Arduino exemple: &#60;a href=&#34;http://arduino.cc/en/Tutorial/SerialEvent&#34; rel=&#34;nofollow&#34;&#62;http://arduino.cc/en/Tutorial/SerialEvent&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Thanks,&#60;br /&#62;
Corso
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
