changeset 73:c54c6ad1c66f

pirexplore: added rtccomp command to read RTC compensation registers
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Fri, 26 Jul 2013 21:12:03 +0000
parents 92c1ed6b4b67
children 8138a6380ae3
files target-utils/pirexplore/cmdtab.c target-utils/pirexplore/rtc.c
diffstat 2 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/target-utils/pirexplore/cmdtab.c	Fri Jul 26 20:32:43 2013 +0000
+++ b/target-utils/pirexplore/cmdtab.c	Fri Jul 26 21:12:03 2013 +0000
@@ -7,6 +7,7 @@
 extern void cmd_r16();
 extern void cmd_r32();
 extern void cmd_rtc();
+extern void cmd_rtccomp();
 extern void cmd_w8();
 extern void cmd_w16();
 extern void cmd_w32();
@@ -19,6 +20,7 @@
 	{"r16", cmd_r16},
 	{"r32", cmd_r32},
 	{"rtc", cmd_rtc},
+	{"rtccomp", cmd_rtccomp},
 	{"w8", cmd_w8},
 	{"w16", cmd_w16},
 	{"w32", cmd_w32},
--- a/target-utils/pirexplore/rtc.c	Fri Jul 26 20:32:43 2013 +0000
+++ b/target-utils/pirexplore/rtc.c	Fri Jul 26 21:12:03 2013 +0000
@@ -50,3 +50,10 @@
 		time2.year, time2.month, time2.day_of_month, time2.day_of_week,
 		time2.hours, time2.minutes, time2.seconds);
 }
+
+void
+cmd_rtccomp()
+{
+	printf("%04X\n", (RTC_REGS.rtc_comp_msb_reg << 8) |
+			  RTC_REGS.rtc_comp_lsb_reg);
+}