#include <stdio.h>

#include "new.h"
#include "heap.h"
#include "flasher.h"
#include "heap_stress.h"
#include "controller_thread.h"
#include "motor_controller.h"
#include "pressure_sensor.h"

char buffer[80];

void AssertionFailure(char const *file, unsigned line)
{
	// Until I can think of something better for
	// low level assertion failures, loop here.

	// Force the counter to be placed into memory
	volatile static int i = 0 ;
	for (;;) {
		i++; // Place a breakpoint here with the debugger.
	}
}

int main(void)
{
	ControllerThread	depth;
#if 0

	MotorController		foo;
	foo.Enable();
	foo.UpdateVelocity(100);
	foo.UpdateVelocity(200);
	foo.UpdateVelocity(300);
	foo.UpdateVelocity(400);
	foo.UpdateVelocity(500);
	foo.UpdateVelocity(400);
	foo.UpdateVelocity(300);
	foo.UpdateVelocity(200);
	foo.UpdateVelocity(100);
	foo.Stop();
	foo.UpdateVelocity(-200);
	foo.UpdateVelocity(-400);
	foo.Disable();

#else

	for (;;) {
		depth.Run(false);
	}
	return 0 ;
#endif
}
