The unified diff between revisions [dea51752..] and [253c6510..] is displayed below. It can also be downloaded as a raw diff.

This diff has been restricted to the following files: 'main.c'

#
# old_revision [dea51752ff3061ddca80de6685b04dac53ac77e1]
# new_revision [253c65100e2208e0b8c93178896f5aab89e4ec0b]
#
# patch "main.c"
#  from [9bd0eaef2d3775dda620602212855b3826601db4]
#    to [d5ad069a51eff072171a593f4f480b1e8aab11bb]
#
============================================================
--- main.c	9bd0eaef2d3775dda620602212855b3826601db4
+++ main.c	d5ad069a51eff072171a593f4f480b1e8aab11bb
@@ -4,6 +4,7 @@
 #include "timer.h"
 #include "uart.h"
 #include "interrupt.h"
+#include "event.h"
 
 #define PINSEL0 (*((volatile unsigned char *) 0xE002C000))
 #define FP0XDIR (*((volatile unsigned int *) 0x3FFFC000))
@@ -160,6 +161,7 @@ int main(void) {
 
 int main(void) {
 	int i;
+
 	init_interrupt();
 	init_uart();
 	init_i2c();
@@ -170,7 +172,8 @@ int main(void) {
 	while (1) {
 		char c;
 		putstr("prompt> ");
-		c = getch();
+		while (!getch(&c))
+			FP0XVAL ^= 0x04000000;
 		if (c == 0x0a)
 			continue;
 		putch(c);
@@ -193,8 +196,6 @@ int main(void) {
 			reply("Help is not available. Try a psychiatrist.");
 			break;
 		case 'T':
-			putstr("I2C status was: ");
-			puthex(i2cstat);
 			putstr(" I2C status is: ");
 			puthex(i2c_statreg());
 			reply(".");
@@ -202,18 +203,6 @@ int main(void) {
 			puthex(i2c_conreg());
 			reply(".");
 			break;
-		case 'S':
-			putstr("Sending START... ");
-			if (i2c_send_start())
-				reply("OK");
-			else
-				reply("FAIL");
-			break;
-		case 'O':
-			putstr("Sending STOP... ");
-			i2c_send_stop();
-			reply("sent");
-			break;
 		case 'I':
 			putstr("Initialising WMP... ");
 			if (wmp_init())
@@ -268,6 +257,10 @@ int main(void) {
 			timer_set_period(10000*TIMER_MS);
 			reply("done");
 			break;
+		case 'E':
+			event_dispatch();
+			reply("done");
+			break;
 		default:
 			reply("Unrecognised command.");
 			break;