#- 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 Fake Function Framework (FFF) 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
------------
Implement the Flash Program driver function.  

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


Test strategy
-----------------
Use the Fake Function Framework to intercept reads and
writes to the hardware.


Exercise Instructions
---------------------
Review 
    IOReadWrite.h
    m28w160ect.h
    
Get to know the FFF and see how to use it, look at:
    IOReadWriteFFFTest.cpp
    IOReadWrite.h
    IOReadWrite.fff.h
    IOReadWrite.fff.c
    fff_globals.c

From the provided flowchart, create a test list.  How 
many tests will you need?

Test drive Flash_Program to meet the flowchart.
     
Once you have written a couple tests, look for ways to 
refactor the tests to better speak to the reader.

Original data sheet
-------------------
www.wingman-sw.com/files/cyber-dojo/FlashDataSheet.pdf 

Figure 17, page 40.

    
