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, but that's
51 // about the only functional library service.
52 printf("TINIm400 monitor rev 0.0\n");
56 // Now we're cooking with gas.
63 gets(buffer); // unsafe, of course, should use some equivalent of fgets.
65 if (!strcmp(buffer, "ledon"))
70 else if (!strcmp(buffer, "ledoff"))
75 else if (!strcmp(buffer, "clock"))
77 printf("Clock: %ld\n", ClockTicks());
79 else if (!strcmp(buffer, "thread"))
81 printf("Thread ID: %d\n", (int)task_getthreadID());
83 else if (!strcmp(buffer, "sleep"))
85 printf("Sleeping for 10 seconds...\n");
87 ClockMilliSecondsDelay(10 * 1000);
91 else if (!strcmp(buffer, "pmr"))
93 printf("PMR: %x\n", PMR);
95 else if (!strcmp(buffer, "exif"))
97 printf("EXIF: %x\n", EXIF);
99 else if (!strcmp(buffer, "blink"))
103 else if (!strcmp(buffer, "t0"))
105 printf("TH0:TL0 %x:%x\n", TH0, TL0);
107 else if (!strcmp(buffer, "t2"))
109 printf("TH2:TL2 %x:%x\n", TH2, TH2);
111 else if (!strcmp(buffer, "faster"))
113 printf("going really fast...\n");
117 PMR = 0x8a; // 8a for REAL fast
118 PMR = 0x9a; // 9a for REAL fast.
123 PMR = 0x1a; // 1a for REAL fast.
133 printf("Unknown command \"%s\".\n", buffer);