FlexBook / Mbed 2 deprecated FlexBook171204a

Dependencies:   SDFileSystem app epson mbed msp430 pl tests

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers bookmonitor.cpp Source File

bookmonitor.cpp

00001 //
00002 // Filename: bookmonitor.h
00003 //
00004 // Flexbook page turn monitor.
00005 //
00006 
00007 #include "bookmonitor.h"
00008 
00009 #include "book.h"
00010 #include "hal.h"
00011 #include "log.h"
00012 #include "pagefactory.h"
00013 
00014 #include <iostream>
00015 
00016 namespace Flexbook {
00017 
00018 BookMonitor::BookMonitor(Book &book)
00019 : book(book)
00020 {
00021     Log("Creating BookMonitor");
00022 }
00023 
00024 BookMonitor::~BookMonitor()
00025 {
00026     Log("Deleting BookMonitor");
00027 }
00028 
00029 void BookMonitor::CheckForPageChange()
00030 {
00031     PageType hardwaretype = HAL::GetPageType();
00032 
00033     if(book.GetPageType() != hardwaretype)
00034     {
00035         book.PageChange(hardwaretype);
00036     }
00037 }
00038 
00039 } // End Flexbook namespace.
00040 
00041