Marc Bax / Mbed 2 deprecated Flexbook180111a

Dependencies:   SDFileSystem app epson mbed msp430 pl tests

Revision:
0:c643d398cdb6
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bookmonitor.cpp	Thu Jan 11 13:42:27 2018 +0000
@@ -0,0 +1,41 @@
+//
+// Filename: bookmonitor.h
+//
+// Flexbook page turn monitor.
+//
+
+#include "bookmonitor.h"
+
+#include "book.h"
+#include "hal.h"
+#include "log.h"
+#include "pagefactory.h"
+
+#include <iostream>
+
+namespace Flexbook {
+
+BookMonitor::BookMonitor(Book &book)
+: book(book)
+{
+    Log("Creating BookMonitor");
+}
+
+BookMonitor::~BookMonitor()
+{
+    Log("Deleting BookMonitor");
+}
+
+void BookMonitor::CheckForPageChange()
+{
+    PageType hardwaretype = HAL::GetPageType();
+
+    if(book.GetPageType() != hardwaretype)
+    {
+        book.PageChange(hardwaretype);
+    }
+}
+
+} // End Flexbook namespace.
+
+