/*
	RTCTEST.C

	Access, read and display the Real Time Clock
*/

main() {
	auto struct tm t;
	auto char lastSec;

	mktm(&t,0);
	if (tm_wr(&t) == -1) {
		printf("no real time clock is found\n");
	} else {
		while (1) {
			lastSec = t.tm_sec;
			do {
				tm_rd(&t);
				hitwd();
			} while (lastSec == t.tm_sec);
			printf("%02d/%02d/%02d %02d:%02d:%02d\n",
				t.tm_year,
				t.tm_mon,
				t.tm_mday,
				t.tm_hour,
				t.tm_min,
				t.tm_sec);
			hitwd();
		}
	}
}