From e064af7bf4d18e7397318d40b40deb1caa4a52ec Mon Sep 17 00:00:00 2001
From: tcsullivan <tullivan99@gmail.com>
Date: Mon, 1 Apr 2019 22:41:39 -0400
Subject: fullscreen widgets, limited scrolling

---
 source/controller.cpp | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

(limited to 'source/controller.cpp')

diff --git a/source/controller.cpp b/source/controller.cpp
index defae8a..423e433 100755
--- a/source/controller.cpp
+++ b/source/controller.cpp
@@ -92,8 +92,10 @@ void loop(void)
 			scrolled = true;
 		} 
 	} else {
-		if (last != 0 && !scrolled)
+		if (last != 0 && !scrolled) {
 			Sharp::sendInput(touchToCoord(last));
+			delay(100);
+		}
 		last = 0;
 		Sharp::setScroll();
 	}
@@ -101,6 +103,12 @@ void loop(void)
 	delay(10);
 }
 
+static void addNewNote(const char *buf)
+{
+	unsigned int count = (buf[1] - '0') * 10 + (buf[2] - '0');
+	Sharp::addWidget<NoteWidget>(buf + 3, count);
+}
+
 void handlePacket(void)
 {
 	char buf[64];
@@ -119,6 +127,9 @@ void handlePacket(void)
 		Sharp::addWidget<NotificationWidget>("Time updated");
 		RTC::setTicks(std::atoi(buf + 1) * 60);
 		break;
+	case 'N':
+		Vibrate::pulse();
+		addNewNote(buf);
 	default:
 		break;
 	}
-- 
cgit v1.2.3