3 Copyright (c) 2005 - 2007, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 RTC Architectural Protocol GUID as defined in EFI 2.0
21 #include "RealTimeClock.h"
53 TODO: Add function description
57 Address - TODO: add argument description
61 TODO: add return values
65 IoWrite8 (PCAT_RTC_ADDRESS_REGISTER
, (UINT8
) (Address
| (UINT8
) (IoRead8 (PCAT_RTC_ADDRESS_REGISTER
) & 0x80)));
66 return IoRead8 (PCAT_RTC_DATA_REGISTER
);
78 Compare the Hour, Minute and Second of the 'From' time and the 'To' time.
79 Only compare H/M/S in EFI_TIME and ignore other fields here.
88 >0 : The H/M/S of the 'From' time is later than those of 'To' time
89 ==0 : The H/M/S of the 'From' time is same as those of 'To' time
90 <0 : The H/M/S of the 'From' time is earlier than those of 'To' time
95 if ((From
->Hour
> To
->Hour
) ||
96 ((From
->Hour
== To
->Hour
) && (From
->Minute
> To
->Minute
)) ||
97 ((From
->Hour
== To
->Hour
) && (From
->Minute
== To
->Minute
) && (From
->Second
> To
->Second
))) {
99 } else if ((From
->Hour
== To
->Hour
) && (From
->Minute
== To
->Minute
) && (From
->Second
== To
->Second
)) {
115 TODO: Add function description
119 Address - TODO: add argument description
120 Data - TODO: add argument description
124 TODO: add return values
128 IoWrite8 (PCAT_RTC_ADDRESS_REGISTER
, (UINT8
) (Address
| (UINT8
) (IoRead8 (PCAT_RTC_ADDRESS_REGISTER
) & 0x80)));
129 IoWrite8 (PCAT_RTC_DATA_REGISTER
, Data
);
134 IN PC_RTC_MODULE_GLOBALS
*Global
140 TODO: Add function description
144 Global - TODO: add argument description
148 EFI_DEVICE_ERROR - TODO: Add description for return value
149 EFI_SUCCESS - TODO: Add description for return value
154 RTC_REGISTER_A RegisterA
;
155 RTC_REGISTER_B RegisterB
;
156 //RTC_REGISTER_C RegisterC;
157 RTC_REGISTER_D RegisterD
;
162 // Acquire RTC Lock to make access to RTC atomic
164 EfiAcquireLock (&Global
->RtcLock
);
167 // Initialize RTC Register
169 // Make sure Division Chain is properly configured,
170 // or RTC clock won't "tick" -- time won't increment
172 RegisterA
.Data
= RTC_INIT_REGISTER_A
;
173 RtcWrite (RTC_ADDRESS_REGISTER_A
, RegisterA
.Data
);
178 RegisterB
.Data
= RtcRead (RTC_ADDRESS_REGISTER_B
);
181 // Clear RTC flag register
183 //RegisterC.Data = RtcRead (RTC_ADDRESS_REGISTER_C);
186 // Clear RTC register D
188 RegisterD
.Data
= RTC_INIT_REGISTER_D
;
189 RtcWrite (RTC_ADDRESS_REGISTER_D
, RegisterD
.Data
);
192 // Wait for up to 0.1 seconds for the RTC to be updated
194 // KEN: BUGBUG following wait action will cause failure under vmware environment.
196 //Status = RtcWaitToUpdate (100000);
197 //if (EFI_ERROR (Status)) {
198 // EfiReleaseLock (&Global->RtcLock);
199 // return EFI_DEVICE_ERROR;
202 // Get the Time/Date/Daylight Savings values.
204 Time
.Second
= RtcRead (RTC_ADDRESS_SECONDS
);
205 Time
.Minute
= RtcRead (RTC_ADDRESS_MINUTES
);
206 Time
.Hour
= RtcRead (RTC_ADDRESS_HOURS
);
207 Time
.Day
= RtcRead (RTC_ADDRESS_DAY_OF_THE_MONTH
);
208 Time
.Month
= RtcRead (RTC_ADDRESS_MONTH
);
209 Time
.Year
= RtcRead (RTC_ADDRESS_YEAR
);
211 ConvertRtcTimeToEfiTime (&Time
, RegisterB
);
213 if (RtcTestCenturyRegister () == EFI_SUCCESS
) {
214 Century
= BcdToDecimal ((UINT8
) (RtcRead (RTC_ADDRESS_CENTURY
) & 0x7f));
216 Century
= BcdToDecimal (RtcRead (RTC_ADDRESS_CENTURY
));
219 Time
.Year
= (UINT16
) (Century
* 100 + Time
.Year
);
222 // Set RTC configuration after get original time
224 RtcWrite (RTC_ADDRESS_REGISTER_B
, RTC_INIT_REGISTER_B
);
229 EfiReleaseLock (&Global
->RtcLock
);
232 // Validate time fields
234 Status
= RtcTimeFieldsValid (&Time
);
235 if (EFI_ERROR (Status
)) {
236 Time
.Second
= RTC_INIT_SECOND
;
237 Time
.Minute
= RTC_INIT_MINUTE
;
238 Time
.Hour
= RTC_INIT_HOUR
;
239 Time
.Day
= RTC_INIT_DAY
;
240 Time
.Month
= RTC_INIT_MONTH
;
241 Time
.Year
= RTC_INIT_YEAR
;
244 // Reset time value according to new RTC configuration
246 PcRtcSetTime (&Time
, Global
);
254 IN EFI_TIME_CAPABILITIES
*Capabilities
,
255 IN PC_RTC_MODULE_GLOBALS
*Global
265 // TODO: Time - add argument and description to function comment
266 // TODO: Capabilities - add argument and description to function comment
267 // TODO: Global - add argument and description to function comment
268 // TODO: EFI_INVALID_PARAMETER - add return value to function comment
269 // TODO: EFI_DEVICE_ERROR - add return value to function comment
270 // TODO: EFI_SUCCESS - add return value to function comment
273 RTC_REGISTER_B RegisterB
;
278 // Check parameters for null pointer
281 return EFI_INVALID_PARAMETER
;
285 // Acquire RTC Lock to make access to RTC atomic
287 EfiAcquireLock (&Global
->RtcLock
);
290 // Wait for up to 0.1 seconds for the RTC to be updated
292 Status
= RtcWaitToUpdate (100000);
293 if (EFI_ERROR (Status
)) {
294 EfiReleaseLock (&Global
->RtcLock
);
300 RegisterB
.Data
= RtcRead (RTC_ADDRESS_REGISTER_B
);
303 // Get the Time/Date/Daylight Savings values.
305 Time
->Second
= RtcRead (RTC_ADDRESS_SECONDS
);
306 Time
->Minute
= RtcRead (RTC_ADDRESS_MINUTES
);
307 Time
->Hour
= RtcRead (RTC_ADDRESS_HOURS
);
308 Time
->Day
= RtcRead (RTC_ADDRESS_DAY_OF_THE_MONTH
);
309 Time
->Month
= RtcRead (RTC_ADDRESS_MONTH
);
310 Time
->Year
= RtcRead (RTC_ADDRESS_YEAR
);
312 ConvertRtcTimeToEfiTime (Time
, RegisterB
);
314 if (RtcTestCenturyRegister () == EFI_SUCCESS
) {
315 Century
= BcdToDecimal ((UINT8
) (RtcRead (RTC_ADDRESS_CENTURY
) & 0x7f));
317 Century
= BcdToDecimal (RtcRead (RTC_ADDRESS_CENTURY
));
320 Time
->Year
= (UINT16
) (Century
* 100 + Time
->Year
);
325 EfiReleaseLock (&Global
->RtcLock
);
328 // Get the variable that containts the TimeZone and Daylight fields
330 Time
->TimeZone
= Global
->SavedTimeZone
;
331 Time
->Daylight
= Global
->Daylight
;
333 //BufferSize = sizeof (INT16) + sizeof (UINT8);
336 // Make sure all field values are in correct range
338 Status
= RtcTimeFieldsValid (Time
);
339 if (EFI_ERROR (Status
)) {
340 return EFI_DEVICE_ERROR
;
343 // Fill in Capabilities if it was passed in
346 Capabilities
->Resolution
= 1;
350 Capabilities
->Accuracy
= 50000000;
354 Capabilities
->SetsToZero
= FALSE
;
363 IN PC_RTC_MODULE_GLOBALS
*Global
373 // TODO: Time - add argument and description to function comment
374 // TODO: Global - add argument and description to function comment
375 // TODO: EFI_INVALID_PARAMETER - add return value to function comment
379 RTC_REGISTER_B RegisterB
;
383 return EFI_INVALID_PARAMETER
;
386 // Make sure that the time fields are valid
388 Status
= RtcTimeFieldsValid (Time
);
389 if (EFI_ERROR (Status
)) {
393 CopyMem (&RtcTime
, Time
, sizeof (EFI_TIME
));
396 // Acquire RTC Lock to make access to RTC atomic
398 EfiAcquireLock (&Global
->RtcLock
);
401 // Wait for up to 0.1 seconds for the RTC to be updated
403 Status
= RtcWaitToUpdate (100000);
404 if (EFI_ERROR (Status
)) {
405 EfiReleaseLock (&Global
->RtcLock
);
409 // Read Register B, and inhibit updates of the RTC
411 RegisterB
.Data
= RtcRead (RTC_ADDRESS_REGISTER_B
);
412 RegisterB
.Bits
.SET
= 1;
413 RtcWrite (RTC_ADDRESS_REGISTER_B
, RegisterB
.Data
);
415 ConvertEfiTimeToRtcTime (&RtcTime
, RegisterB
, &Century
);
417 RtcWrite (RTC_ADDRESS_SECONDS
, RtcTime
.Second
);
418 RtcWrite (RTC_ADDRESS_MINUTES
, RtcTime
.Minute
);
419 RtcWrite (RTC_ADDRESS_HOURS
, RtcTime
.Hour
);
420 RtcWrite (RTC_ADDRESS_DAY_OF_THE_MONTH
, RtcTime
.Day
);
421 RtcWrite (RTC_ADDRESS_MONTH
, RtcTime
.Month
);
422 RtcWrite (RTC_ADDRESS_YEAR
, (UINT8
) RtcTime
.Year
);
423 if (RtcTestCenturyRegister () == EFI_SUCCESS
) {
424 Century
= (UINT8
) ((Century
& 0x7f) | (RtcRead (RTC_ADDRESS_CENTURY
) & 0x80));
427 RtcWrite (RTC_ADDRESS_CENTURY
, Century
);
430 // Allow updates of the RTC registers
432 RegisterB
.Bits
.SET
= 0;
433 RtcWrite (RTC_ADDRESS_REGISTER_B
, RegisterB
.Data
);
438 EfiReleaseLock (&Global
->RtcLock
);
441 // Set the variable that containts the TimeZone and Daylight fields
443 Global
->SavedTimeZone
= Time
->TimeZone
;
444 Global
->Daylight
= Time
->Daylight
;
451 OUT BOOLEAN
*Enabled
,
452 OUT BOOLEAN
*Pending
,
454 IN PC_RTC_MODULE_GLOBALS
*Global
466 // TODO: Enabled - add argument and description to function comment
467 // TODO: Pending - add argument and description to function comment
468 // TODO: Time - add argument and description to function comment
469 // TODO: Global - add argument and description to function comment
470 // TODO: EFI_INVALID_PARAMETER - add return value to function comment
471 // TODO: EFI_DEVICE_ERROR - add return value to function comment
472 // TODO: EFI_DEVICE_ERROR - add return value to function comment
473 // TODO: EFI_SUCCESS - add return value to function comment
476 RTC_REGISTER_B RegisterB
;
477 RTC_REGISTER_C RegisterC
;
481 // Check paramters for null pointers
483 if ((Enabled
== NULL
) || (Pending
== NULL
) || (Time
== NULL
)) {
484 return EFI_INVALID_PARAMETER
;
488 // Acquire RTC Lock to make access to RTC atomic
490 EfiAcquireLock (&Global
->RtcLock
);
493 // Wait for up to 0.1 seconds for the RTC to be updated
495 Status
= RtcWaitToUpdate (100000);
496 if (EFI_ERROR (Status
)) {
497 EfiReleaseLock (&Global
->RtcLock
);
498 return EFI_DEVICE_ERROR
;
501 // Read Register B and Register C
503 RegisterB
.Data
= RtcRead (RTC_ADDRESS_REGISTER_B
);
504 RegisterC
.Data
= RtcRead (RTC_ADDRESS_REGISTER_C
);
507 // Get the Time/Date/Daylight Savings values.
509 *Enabled
= RegisterB
.Bits
.AIE
;
511 Time
->Second
= RtcRead (RTC_ADDRESS_SECONDS_ALARM
);
512 Time
->Minute
= RtcRead (RTC_ADDRESS_MINUTES_ALARM
);
513 Time
->Hour
= RtcRead (RTC_ADDRESS_HOURS_ALARM
);
514 Time
->Day
= RtcRead (RTC_ADDRESS_DAY_OF_THE_MONTH
);
515 Time
->Month
= RtcRead (RTC_ADDRESS_MONTH
);
516 Time
->Year
= RtcRead (RTC_ADDRESS_YEAR
);
521 Time
->Day
= RtcRead (RTC_ADDRESS_DAY_OF_THE_MONTH
);
522 Time
->Month
= RtcRead (RTC_ADDRESS_MONTH
);
523 Time
->Year
= RtcRead (RTC_ADDRESS_YEAR
);
526 ConvertRtcTimeToEfiTime (Time
, RegisterB
);
528 if (RtcTestCenturyRegister () == EFI_SUCCESS
) {
529 Century
= BcdToDecimal ((UINT8
) (RtcRead (RTC_ADDRESS_CENTURY
) & 0x7f));
531 Century
= BcdToDecimal (RtcRead (RTC_ADDRESS_CENTURY
));
534 Time
->Year
= (UINT16
) (Century
* 100 + Time
->Year
);
539 EfiReleaseLock (&Global
->RtcLock
);
542 // Make sure all field values are in correct range
544 Status
= RtcTimeFieldsValid (Time
);
545 if (EFI_ERROR (Status
)) {
546 return EFI_DEVICE_ERROR
;
549 *Pending
= RegisterC
.Bits
.AF
;
559 IN PC_RTC_MODULE_GLOBALS
*Global
571 // TODO: Enable - add argument and description to function comment
572 // TODO: Time - add argument and description to function comment
573 // TODO: Global - add argument and description to function comment
574 // TODO: EFI_INVALID_PARAMETER - add return value to function comment
575 // TODO: EFI_INVALID_PARAMETER - add return value to function comment
576 // TODO: EFI_UNSUPPORTED - add return value to function comment
577 // TODO: EFI_DEVICE_ERROR - add return value to function comment
578 // TODO: EFI_SUCCESS - add return value to function comment
582 RTC_REGISTER_B RegisterB
;
584 EFI_TIME_CAPABILITIES Capabilities
;
589 return EFI_INVALID_PARAMETER
;
592 // Make sure that the time fields are valid
594 Status
= RtcTimeFieldsValid (Time
);
595 if (EFI_ERROR (Status
)) {
596 return EFI_INVALID_PARAMETER
;
599 // Just support set alarm time within 24 hours
601 PcRtcGetTime (&RtcTime
, &Capabilities
, Global
);
602 if (!IsWithinOneDay (&RtcTime
, Time
)) {
603 return EFI_UNSUPPORTED
;
606 // Make a local copy of the time and date
608 CopyMem (&RtcTime
, Time
, sizeof (EFI_TIME
));
612 // Acquire RTC Lock to make access to RTC atomic
614 EfiAcquireLock (&Global
->RtcLock
);
617 // Wait for up to 0.1 seconds for the RTC to be updated
619 Status
= RtcWaitToUpdate (100000);
620 if (EFI_ERROR (Status
)) {
621 EfiReleaseLock (&Global
->RtcLock
);
622 return EFI_DEVICE_ERROR
;
625 // Read Register B, and inhibit updates of the RTC
627 RegisterB
.Data
= RtcRead (RTC_ADDRESS_REGISTER_B
);
629 RegisterB
.Bits
.SET
= 1;
630 RtcWrite (RTC_ADDRESS_REGISTER_B
, RegisterB
.Data
);
633 ConvertEfiTimeToRtcTime (&RtcTime
, RegisterB
, &Century
);
636 // Set RTC alarm time
638 RtcWrite (RTC_ADDRESS_SECONDS_ALARM
, RtcTime
.Second
);
639 RtcWrite (RTC_ADDRESS_MINUTES_ALARM
, RtcTime
.Minute
);
640 RtcWrite (RTC_ADDRESS_HOURS_ALARM
, RtcTime
.Hour
);
642 RegisterB
.Bits
.AIE
= 1;
645 RegisterB
.Bits
.AIE
= 0;
648 // Allow updates of the RTC registers
650 RegisterB
.Bits
.SET
= 0;
651 RtcWrite (RTC_ADDRESS_REGISTER_B
, RegisterB
.Data
);
656 EfiReleaseLock (&Global
->RtcLock
);
675 // TODO: BcdValue - add argument and description to function comment
680 High
= BcdValue
>> 4;
681 Low
= BcdValue
- (High
<< 4);
683 return (UINT8
) (Low
+ (High
* 10));
687 RtcTestCenturyRegister (
700 // TODO: EFI_SUCCESS - add return value to function comment
701 // TODO: EFI_DEVICE_ERROR - add return value to function comment
706 Century
= RtcRead (RTC_ADDRESS_CENTURY
);
708 // RtcWrite (RTC_ADDRESS_CENTURY, 0x00);
710 Temp
= (UINT8
) (RtcRead (RTC_ADDRESS_CENTURY
) & 0x7f);
711 RtcWrite (RTC_ADDRESS_CENTURY
, Century
);
712 if (Temp
== 0x19 || Temp
== 0x20) {
716 return EFI_DEVICE_ERROR
;
720 ConvertRtcTimeToEfiTime (
722 IN RTC_REGISTER_B RegisterB
734 // TODO: Time - add argument and description to function comment
735 // TODO: RegisterB - add argument and description to function comment
739 if ((Time
->Hour
) & 0x80) {
745 Time
->Hour
= (UINT8
) (Time
->Hour
& 0x7f);
747 if (RegisterB
.Bits
.DM
== 0) {
748 Time
->Year
= BcdToDecimal ((UINT8
) Time
->Year
);
749 Time
->Month
= BcdToDecimal (Time
->Month
);
750 Time
->Day
= BcdToDecimal (Time
->Day
);
751 Time
->Hour
= BcdToDecimal (Time
->Hour
);
752 Time
->Minute
= BcdToDecimal (Time
->Minute
);
753 Time
->Second
= BcdToDecimal (Time
->Second
);
756 // If time is in 12 hour format, convert it to 24 hour format
758 if (RegisterB
.Bits
.MIL
== 0) {
759 if (PM
&& Time
->Hour
< 12) {
760 Time
->Hour
= (UINT8
) (Time
->Hour
+ 12);
763 if (!PM
&& Time
->Hour
== 12) {
768 Time
->Nanosecond
= 0;
769 Time
->TimeZone
= EFI_UNSPECIFIED_TIMEZONE
;
786 // TODO: Timeout - add argument and description to function comment
787 // TODO: EFI_DEVICE_ERROR - add return value to function comment
788 // TODO: EFI_DEVICE_ERROR - add return value to function comment
789 // TODO: EFI_SUCCESS - add return value to function comment
791 RTC_REGISTER_A RegisterA
;
792 RTC_REGISTER_D RegisterD
;
795 // See if the RTC is functioning correctly
797 RegisterD
.Data
= RtcRead (RTC_ADDRESS_REGISTER_D
);
799 if (RegisterD
.Bits
.VRT
== 0) {
800 return EFI_DEVICE_ERROR
;
803 // Wait for up to 0.1 seconds for the RTC to be ready.
805 Timeout
= (Timeout
/ 10) + 1;
806 RegisterA
.Data
= RtcRead (RTC_ADDRESS_REGISTER_A
);
807 while (RegisterA
.Bits
.UIP
== 1 && Timeout
> 0) {
808 MicroSecondDelay (10);
809 RegisterA
.Data
= RtcRead (RTC_ADDRESS_REGISTER_A
);
813 RegisterD
.Data
= RtcRead (RTC_ADDRESS_REGISTER_D
);
814 if (Timeout
== 0 || RegisterD
.Bits
.VRT
== 0) {
815 return EFI_DEVICE_ERROR
;
833 // TODO: Time - add argument and description to function comment
834 // TODO: EFI_INVALID_PARAMETER - add return value to function comment
835 // TODO: EFI_SUCCESS - add return value to function comment
837 if (Time
->Year
< 1998 ||
841 (!DayValid (Time
)) ||
845 Time
->Nanosecond
> 999999999 ||
846 (!(Time
->TimeZone
== EFI_UNSPECIFIED_TIMEZONE
|| (Time
->TimeZone
>= -1440 && Time
->TimeZone
<= 1440))) ||
847 (Time
->Daylight
& (~(EFI_TIME_ADJUST_DAYLIGHT
| EFI_TIME_IN_DAYLIGHT
)))
849 return EFI_INVALID_PARAMETER
;
863 TODO: Add function description
867 Time - TODO: add argument description
871 TODO: add return values
876 INTN DayOfMonth
[12] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
879 Time
->Day
> DayOfMonth
[Time
->Month
- 1] ||
880 (Time
->Month
== 2 && (!IsLeapYear (Time
) && Time
->Day
> 28))
896 TODO: Add function description
900 Time - TODO: add argument description
904 TODO: add return values
908 if (Time
->Year
% 4 == 0) {
909 if (Time
->Year
% 100 == 0) {
910 if (Time
->Year
% 400 == 0) {
924 ConvertEfiTimeToRtcTime (
926 IN RTC_REGISTER_B RegisterB
,
938 // TODO: Time - add argument and description to function comment
939 // TODO: RegisterB - add argument and description to function comment
940 // TODO: Century - add argument and description to function comment
946 // Adjust hour field if RTC in in 12 hour mode
948 if (RegisterB
.Bits
.MIL
== 0) {
949 if (Time
->Hour
< 12) {
953 if (Time
->Hour
>= 13) {
954 Time
->Hour
= (UINT8
) (Time
->Hour
- 12);
955 } else if (Time
->Hour
== 0) {
960 // Set the Time/Date/Daylight Savings values.
962 *Century
= DecimaltoBcd ((UINT8
) (Time
->Year
/ 100));
964 Time
->Year
= (UINT16
) (Time
->Year
% 100);
966 if (RegisterB
.Bits
.DM
== 0) {
967 Time
->Year
= DecimaltoBcd ((UINT8
) Time
->Year
);
968 Time
->Month
= DecimaltoBcd (Time
->Month
);
969 Time
->Day
= DecimaltoBcd (Time
->Day
);
970 Time
->Hour
= DecimaltoBcd (Time
->Hour
);
971 Time
->Minute
= DecimaltoBcd (Time
->Minute
);
972 Time
->Second
= DecimaltoBcd (Time
->Second
);
975 // If we are in 12 hour mode and PM is set, then set bit 7 of the Hour field.
977 if (RegisterB
.Bits
.MIL
== 0 && PM
) {
978 Time
->Hour
= (UINT8
) (Time
->Hour
| 0x80);
991 Judge whether two days are adjacent.
1000 TRUE - The interval of two days are within one day.
1001 FALSE - The interval of two days exceed ony day or parameter error.
1005 UINT8 DayOfMonth
[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
1006 BOOLEAN Adjacent
= FALSE
;
1008 if (From
->Year
== To
->Year
) {
1009 if (From
->Month
== To
->Month
) {
1010 if ((From
->Day
+ 1) == To
->Day
) {
1011 if ((CompareHMS(From
, To
) >= 0)) {
1014 } else if (From
->Day
== To
->Day
) {
1015 if ((CompareHMS(From
, To
) <= 0)) {
1019 } else if (((From
->Month
+ 1) == To
->Month
) && (To
->Day
== 1)) {
1020 if ((From
->Month
== 2) && !IsLeapYear(From
)) {
1021 if (From
->Day
== 28) {
1022 if ((CompareHMS(From
, To
) >= 0)) {
1026 } else if (From
->Day
== DayOfMonth
[From
->Month
- 1]) {
1027 if ((CompareHMS(From
, To
) >= 0)) {
1032 } else if (((From
->Year
+ 1) == To
->Year
) &&
1033 (From
->Month
== 12) &&
1034 (From
->Day
== 31) &&
1037 if ((CompareHMS(From
, To
) >= 0)) {
1051 Routine Description:
1058 // TODO: DecValue - add argument and description to function comment
1063 High
= DecValue
/ 10;
1064 Low
= DecValue
- (High
* 10);
1066 return (UINT8
) (Low
+ (High
<< 4));