From 9a1eee23398a27389a2bc35f51cf0ec72710a7e0 Mon Sep 17 00:00:00 2001 From: gikidy Date: Wed, 1 Jul 2009 06:05:41 +0000 Subject: [PATCH] Fix date/time not work for the return value of RtcRead not need type convert. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8698 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Universal/PcatRealTimeClockRuntimeDxe/PcRtc.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/MdeModulePkg/Universal/PcatRealTimeClockRuntimeDxe/PcRtc.c b/MdeModulePkg/Universal/PcatRealTimeClockRuntimeDxe/PcRtc.c index c6b58b394e..cf5ed0bf5a 100644 --- a/MdeModulePkg/Universal/PcatRealTimeClockRuntimeDxe/PcRtc.c +++ b/MdeModulePkg/Universal/PcatRealTimeClockRuntimeDxe/PcRtc.c @@ -158,8 +158,9 @@ PcRtcInit ( Time.Month = RtcRead (RTC_ADDRESS_MONTH); Time.Year = RtcRead (RTC_ADDRESS_YEAR); - Century = BcdToDecimal8 (RtcRead (RTC_ADDRESS_CENTURY)); - + Century = RtcRead (RTC_ADDRESS_CENTURY); + Time.Year = (UINT16) (Century * 100 + Time.Year); + // // Set RTC configuration after get original time // The value of bit AIE should be reserved. @@ -281,8 +282,9 @@ PcRtcGetTime ( Time->Month = RtcRead (RTC_ADDRESS_MONTH); Time->Year = RtcRead (RTC_ADDRESS_YEAR); - Century = BcdToDecimal8 (RtcRead (RTC_ADDRESS_CENTURY)); - + Century = RtcRead (RTC_ADDRESS_CENTURY); + Time->Year = (UINT16) (Century * 100 + Time->Year); + // // Release RTC Lock. // @@ -508,8 +510,9 @@ PcRtcGetWakeupTime ( Time->Year = RtcRead (RTC_ADDRESS_YEAR); } - Century = BcdToDecimal8 (RtcRead (RTC_ADDRESS_CENTURY)); - + Century = RtcRead (RTC_ADDRESS_CENTURY); + Time->Year = (UINT16) (Century * 100 + Time->Year); + // // Release RTC Lock. // -- 2.39.2