// test1.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <windows.h>
#include <commctrl.h>
#include <iostream>
#include "cspi_1.h"

using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
	uint32_t written, read;
	Polled_CSPI_1::InitializeMasterMode();
	Polled_CSPI_1::Enable();
	// Polled_CSPI_1::EnableLoopback();
	cout << "Test Started" << endl;
	written = 0;
	while (1) {
		Polled_CSPI_1::SendSample(written);
		read = Polled_CSPI_1::GetSample();
		if (written != read)
			//cout << "Bite me, Wayne: " << written << " does not equal " << read << endl;
		cout << "Read = " << read << " Written = " << written++ << endl;
	}
	return 0;
}

