11 puts("Available commands:\n");
12 puts("ledon: turns LED on.");
13 puts("ledoff: turns LED off.");
14 puts("clock: reports millisecond timer.");
15 puts("sleep: sleeps for 10 seconds (or forever if you didn't startclock first).");
25 for (j = 0; j < 10; j++)
27 for (i = 0; i < 32767; i++)
35 for (j = 0; j < 10; j++)
37 for (i = 0; i < 32767; i++)
50 // At this stage, the rom isn't initalized. We do have polled serial I/O, though.
51 printf("TINIm400 monitor rev 0.0\n");
55 // double the cpu speed.
70 // We're hosed. romInit will have printed an error, nothing more to do.
76 // Switch to interrupt driven serial I/O now that the rom is initialized.
77 Serial0SwitchToBuffered();
84 gets(buffer); // unsafe, of course, should use some equivalent of fgets.
86 if (!strcmp(buffer, "ledon"))
91 else if (!strcmp(buffer, "ledoff"))
96 else if (!strcmp(buffer, "clock"))
98 printf("Clock: %ld\n", ClockTicks());
100 else if (!strcmp(buffer, "thread"))
102 printf("Thread ID: %d\n", (int)DSS_getthreadID());
104 else if (!strcmp(buffer, "sleep"))
106 printf("Sleeping for 10 seconds...\n");
108 ClockMilliSecondsDelay(10 * 1000);
112 else if (!strcmp(buffer, "pmr"))
114 printf("PMR: %x\n", PMR);
116 else if (!strcmp(buffer, "exif"))
118 printf("EXIF: %x\n", EXIF);
120 else if (!strcmp(buffer, "blink"))
124 else if (!strcmp(buffer, "t0"))
126 printf("TH0:TL0 %x:%x\n", TH0, TL0);
128 else if (!strcmp(buffer, "t2"))
130 printf("TH2:TL2 %x:%x\n", TH2, TH2);
132 else if (!strcmp(buffer, "faster"))
134 printf("going really fast...\n");
138 PMR = 0x8a; // 8a for REAL fast
139 PMR = 0x9a; // 9a for REAL fast.
144 PMR = 0x1a; // 1a for REAL fast.
154 printf("Unknown command \"%s\".\n", buffer);