Fix date/time not work for the return value of RtcRead not need type convert.
authorgikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 1 Jul 2009 06:05:41 +0000 (06:05 +0000)
committergikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 1 Jul 2009 06:05:41 +0000 (06:05 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8698 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/PcatRealTimeClockRuntimeDxe/PcRtc.c

index c6b58b394e417f480ec22c75532b271b495e83b9..cf5ed0bf5a7d2870c64e551e59dec2b524508d97 100644 (file)
@@ -158,8 +158,9 @@ PcRtcInit (
   Time.Month  = RtcRead (RTC_ADDRESS_MONTH);\r
   Time.Year   = RtcRead (RTC_ADDRESS_YEAR);\r
 \r
-  Century = BcdToDecimal8 (RtcRead (RTC_ADDRESS_CENTURY));\r
-\r
+  Century = RtcRead (RTC_ADDRESS_CENTURY);\r
+  Time.Year = (UINT16) (Century * 100 + Time.Year);\r
+  \r
   //\r
   // Set RTC configuration after get original time\r
   // The value of bit AIE should be reserved.\r
@@ -281,8 +282,9 @@ PcRtcGetTime (
   Time->Month   = RtcRead (RTC_ADDRESS_MONTH);\r
   Time->Year    = RtcRead (RTC_ADDRESS_YEAR);\r
 \r
-  Century = BcdToDecimal8 (RtcRead (RTC_ADDRESS_CENTURY));\r
-\r
+  Century = RtcRead (RTC_ADDRESS_CENTURY);\r
+  Time->Year = (UINT16) (Century * 100 + Time->Year);\r
+  \r
   //\r
   // Release RTC Lock.\r
   //\r
@@ -508,8 +510,9 @@ PcRtcGetWakeupTime (
     Time->Year    = RtcRead (RTC_ADDRESS_YEAR);\r
   }\r
 \r
-  Century = BcdToDecimal8 (RtcRead (RTC_ADDRESS_CENTURY));\r
-\r
+  Century = RtcRead (RTC_ADDRESS_CENTURY);\r
+  Time->Year = (UINT16) (Century * 100 + Time->Year);\r
+  \r
   //\r
   // Release RTC Lock.\r
   //\r