#- Copyright (c) 2008-2020 James Grenning
#- All rights reserved
#- For use by participants in James' training courses.

Objectives
----------
Write a device drive function using TDD from a device 
specification.  Use the CppUMock to create a
test double and write next-to-the-metal unit tests.

Instructions
------------
DO NOT WRITE PRODUCTION CODE UNLESS THERE IS A FAILING TEST CASE 
REQUIRING THAT CODE.

You know the drill. 

Requirements
------------
Download the Flash Specification 
    www.wingman-sw.com/files/cyber-dojo/FlashDataSheet.pdf 

Implement the Flash Program driver function.  

Use the flow chart in the course notes for the Flash
device specification.


Test strategy
-----------------
Get the requirements from the data sheet Figure 17, page 40.
Use the CppUMock to intercept reads and writes from/to 
the hardware.

Exercise Instructions
---------------------
Review 
    IOReadWrite.h
    m28w160ect.h
    
Get to know CppUMock and see how to use it, look at:
    IOReadWrite_CppUMock.cpp
    IOReadWrite_CppUMockTests.cpp
    
From the flowchart in the course notes, create a test list.  How 
many tests will you need?

Test drive Flash Program function to meet the flowchart.

Once you have written a couple tests, look for ways to 
refactor the tests to better represent themselves.

Find the CppUMock reference here:
    http://cpputest.org

