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 Status
= RtcWaitToUpdate (100000);
195 if (EFI_ERROR (Status
)) {
196 EfiReleaseLock (&Global
->RtcLock
);
197 return EFI_DEVICE_ERROR
;
200 // Get the Time/Date/Daylight Savings values.
202 Time
.Second
= RtcRead (RTC_ADDRESS_SECONDS
);
203 Time
.Minute
= RtcRead (RTC_ADDRESS_MINUTES
);
204 Time
.Hour
= RtcRead (RTC_ADDRESS_HOURS
);
205 Time
.Day
= RtcRead (RTC_ADDRESS_DAY_OF_THE_MONTH
);
206 Time
.Month
= RtcRead (RTC_ADDRESS_MONTH
);
207 Time
.Year
= RtcRead (RTC_ADDRESS_YEAR
);
209 ConvertRtcTimeToEfiTime (&Time
, RegisterB
);
211 if (RtcTestCenturyRegister () == EFI_SUCCESS
) {
212 Century
= BcdToDecimal ((UINT8
) (RtcRead (RTC_ADDRESS_CENTURY
) & 0x7f));
214 Century
= BcdToDecimal (RtcRead (RTC_ADDRESS_CENTURY
));
217 Time
.Year
= (UINT16
) (Century
* 100 + Time
.Year
);
220 // Set RTC configuration after get original time
222 RtcWrite (RTC_ADDRESS_REGISTER_B
, RTC_INIT_REGISTER_B
);
227 EfiReleaseLock (&Global
->RtcLock
);
230 // Validate time fields
232 Status
= RtcTimeFieldsValid (&Time
);
233 if (EFI_ERROR (Status
)) {
234 Time
.Second
= RTC_INIT_SECOND
;
235 Time
.Minute
= RTC_INIT_MINUTE
;
236 Time
.Hour
= RTC_INIT_HOUR
;
237 Time
.Day
= RTC_INIT_DAY
;
238 Time
.Month
= RTC_INIT_MONTH
;
239 Time
.Year
= RTC_INIT_YEAR
;
242 // Reset time value according to new RTC configuration
244 PcRtcSetTime (&Time
, Global
);
252 IN EFI_TIME_CAPABILITIES
*Capabilities
,
253 IN PC_RTC_MODULE_GLOBALS
*Global
263 // TODO: Time - add argument and description to function comment
264 // TODO: Capabilities - add argument and description to function comment
265 // TODO: Global - add argument and description to function comment
266 // TODO: EFI_INVALID_PARAMETER - add return value to function comment
267 // TODO: EFI_DEVICE_ERROR - add return value to function comment
268 // TODO: EFI_SUCCESS - add return value to function comment
271 RTC_REGISTER_B RegisterB
;
276 // Check parameters for null pointer
279 return EFI_INVALID_PARAMETER
;
283 // Acquire RTC Lock to make access to RTC atomic
285 EfiAcquireLock (&Global
->RtcLock
);
288 // Wait for up to 0.1 seconds for the RTC to be updated
290 Status
= RtcWaitToUpdate (100000);
291 if (EFI_ERROR (Status
)) {
292 EfiReleaseLock (&Global
->RtcLock
);
298 RegisterB
.Data
= RtcRead (RTC_ADDRESS_REGISTER_B
);
301 // Get the Time/Date/Daylight Savings values.
303 Time
->Second
= RtcRead (RTC_ADDRESS_SECONDS
);
304 Time
->Minute
= RtcRead (RTC_ADDRESS_MINUTES
);
305 Time
->Hour
= RtcRead (RTC_ADDRESS_HOURS
);
306 Time
->Day
= RtcRead (RTC_ADDRESS_DAY_OF_THE_MONTH
);
307 Time
->Month
= RtcRead (RTC_ADDRESS_MONTH
);
308 Time
->Year
= RtcRead (RTC_ADDRESS_YEAR
);
310 ConvertRtcTimeToEfiTime (Time
, RegisterB
);
312 if (RtcTestCenturyRegister () == EFI_SUCCESS
) {
313 Century
= BcdToDecimal ((UINT8
) (RtcRead (RTC_ADDRESS_CENTURY
) & 0x7f));
315 Century
= BcdToDecimal (RtcRead (RTC_ADDRESS_CENTURY
));
318 Time
->Year
= (UINT16
) (Century
* 100 + Time
->Year
);
323 EfiReleaseLock (&Global
->RtcLock
);
326 // Get the variable that containts the TimeZone and Daylight fields
328 Time
->TimeZone
= Global
->SavedTimeZone
;
329 Time
->Daylight
= Global
->Daylight
;
331 //BufferSize = sizeof (INT16) + sizeof (UINT8);
334 // Make sure all field values are in correct range
336 Status
= RtcTimeFieldsValid (Time
);
337 if (EFI_ERROR (Status
)) {
338 return EFI_DEVICE_ERROR
;
341 // Fill in Capabilities if it was passed in
344 Capabilities
->Resolution
= 1;
348 Capabilities
->Accuracy
= 50000000;
352 Capabilities
->SetsToZero
= FALSE
;
361 IN PC_RTC_MODULE_GLOBALS
*Global
371 // TODO: Time - add argument and description to function comment
372 // TODO: Global - add argument and description to function comment
373 // TODO: EFI_INVALID_PARAMETER - add return value to function comment
377 RTC_REGISTER_B RegisterB
;
381 return EFI_INVALID_PARAMETER
;
384 // Make sure that the time fields are valid
386 Status
= RtcTimeFieldsValid (Time
);
387 if (EFI_ERROR (Status
)) {
391 CopyMem (&RtcTime
, Time
, sizeof (EFI_TIME
));
394 // Acquire RTC Lock to make access to RTC atomic
396 EfiAcquireLock (&Global
->RtcLock
);
399 // Wait for up to 0.1 seconds for the RTC to be updated
401 Status
= RtcWaitToUpdate (100000);
402 if (EFI_ERROR (Status
)) {
403 EfiReleaseLock (&Global
->RtcLock
);
407 // Read Register B, and inhibit updates of the RTC
409 RegisterB
.Data
= RtcRead (RTC_ADDRESS_REGISTER_B
);
410 RegisterB
.Bits
.SET
= 1;
411 RtcWrite (RTC_ADDRESS_REGISTER_B
, RegisterB
.Data
);
413 ConvertEfiTimeToRtcTime (&RtcTime
, RegisterB
, &Century
);
415 RtcWrite (RTC_ADDRESS_SECONDS
, RtcTime
.Second
);
416 RtcWrite (RTC_ADDRESS_MINUTES
, RtcTime
.Minute
);
417 RtcWrite (RTC_ADDRESS_HOURS
, RtcTime
.Hour
);
418 RtcWrite (RTC_ADDRESS_DAY_OF_THE_MONTH
, RtcTime
.Day
);
419 RtcWrite (RTC_ADDRESS_MONTH
, RtcTime
.Month
);
420 RtcWrite (RTC_ADDRESS_YEAR
, (UINT8
) RtcTime
.Year
);
421 if (RtcTestCenturyRegister () == EFI_SUCCESS
) {
422 Century
= (UINT8
) ((Century
& 0x7f) | (RtcRead (RTC_ADDRESS_CENTURY
) & 0x80));
425 RtcWrite (RTC_ADDRESS_CENTURY
, Century
);
428 // Allow updates of the RTC registers
430 RegisterB
.Bits
.SET
= 0;
431 RtcWrite (RTC_ADDRESS_REGISTER_B
, RegisterB
.Data
);
436 EfiReleaseLock (&Global
->RtcLock
);
439 // Set the variable that containts the TimeZone and Daylight fields
441 Global
->SavedTimeZone
= Time
->TimeZone
;
442 Global
->Daylight
= Time
->Daylight
;
449 OUT BOOLEAN
*Enabled
,
450 OUT BOOLEAN
*Pending
,
452 IN PC_RTC_MODULE_GLOBALS
*Global
464 // TODO: Enabled - add argument and description to function comment
465 // TODO: Pending - add argument and description to function comment
466 // TODO: Time - add argument and description to function comment
467 // TODO: Global - add argument and description to function comment
468 // TODO: EFI_INVALID_PARAMETER - add return value to function comment
469 // TODO: EFI_DEVICE_ERROR - add return value to function comment
470 // TODO: EFI_DEVICE_ERROR - add return value to function comment
471 // TODO: EFI_SUCCESS - add return value to function comment
474 RTC_REGISTER_B RegisterB
;
475 RTC_REGISTER_C RegisterC
;
479 // Check paramters for null pointers
481 if ((Enabled
== NULL
) || (Pending
== NULL
) || (Time
== NULL
)) {
482 return EFI_INVALID_PARAMETER
;
486 // Acquire RTC Lock to make access to RTC atomic
488 EfiAcquireLock (&Global
->RtcLock
);
491 // Wait for up to 0.1 seconds for the RTC to be updated
493 Status
= RtcWaitToUpdate (100000);
494 if (EFI_ERROR (Status
)) {
495 EfiReleaseLock (&Global
->RtcLock
);
496 return EFI_DEVICE_ERROR
;
499 // Read Register B and Register C
501 RegisterB
.Data
= RtcRead (RTC_ADDRESS_REGISTER_B
);
502 RegisterC
.Data
= RtcRead (RTC_ADDRESS_REGISTER_C
);
505 // Get the Time/Date/Daylight Savings values.
507 *Enabled
= RegisterB
.Bits
.AIE
;
509 Time
->Second
= RtcRead (RTC_ADDRESS_SECONDS_ALARM
);
510 Time
->Minute
= RtcRead (RTC_ADDRESS_MINUTES_ALARM
);
511 Time
->Hour
= RtcRead (RTC_ADDRESS_HOURS_ALARM
);
512 Time
->Day
= RtcRead (RTC_ADDRESS_DAY_OF_THE_MONTH
);
513 Time
->Month
= RtcRead (RTC_ADDRESS_MONTH
);
514 Time
->Year
= RtcRead (RTC_ADDRESS_YEAR
);
519 Time
->Day
= RtcRead (RTC_ADDRESS_DAY_OF_THE_MONTH
);
520 Time
->Month
= RtcRead (RTC_ADDRESS_MONTH
);
521 Time
->Year
= RtcRead (RTC_ADDRESS_YEAR
);
524 ConvertRtcTimeToEfiTime (Time
, RegisterB
);
526 if (RtcTestCenturyRegister () == EFI_SUCCESS
) {
527 Century
= BcdToDecimal ((UINT8
) (RtcRead (RTC_ADDRESS_CENTURY
) & 0x7f));
529 Century
= BcdToDecimal (RtcRead (RTC_ADDRESS_CENTURY
));
532 Time
->Year
= (UINT16
) (Century
* 100 + Time
->Year
);
537 EfiReleaseLock (&Global
->RtcLock
);
540 // Make sure all field values are in correct range
542 Status
= RtcTimeFieldsValid (Time
);
543 if (EFI_ERROR (Status
)) {
544 return EFI_DEVICE_ERROR
;
547 *Pending
= RegisterC
.Bits
.AF
;
557 IN PC_RTC_MODULE_GLOBALS
*Global
569 // TODO: Enable - add argument and description to function comment
570 // TODO: Time - add argument and description to function comment
571 // TODO: Global - add argument and description to function comment
572 // TODO: EFI_INVALID_PARAMETER - add return value to function comment
573 // TODO: EFI_INVALID_PARAMETER - add return value to function comment
574 // TODO: EFI_UNSUPPORTED - add return value to function comment
575 // TODO: EFI_DEVICE_ERROR - add return value to function comment
576 // TODO: EFI_SUCCESS - add return value to function comment
580 RTC_REGISTER_B RegisterB
;
582 EFI_TIME_CAPABILITIES Capabilities
;
587 return EFI_INVALID_PARAMETER
;
590 // Make sure that the time fields are valid
592 Status
= RtcTimeFieldsValid (Time
);
593 if (EFI_ERROR (Status
)) {
594 return EFI_INVALID_PARAMETER
;
597 // Just support set alarm time within 24 hours
599 PcRtcGetTime (&RtcTime
, &Capabilities
, Global
);
600 if (!IsWithinOneDay (&RtcTime
, Time
)) {
601 return EFI_UNSUPPORTED
;
604 // Make a local copy of the time and date
606 CopyMem (&RtcTime
, Time
, sizeof (EFI_TIME
));
610 // Acquire RTC Lock to make access to RTC atomic
612 EfiAcquireLock (&Global
->RtcLock
);
615 // Wait for up to 0.1 seconds for the RTC to be updated
617 Status
= RtcWaitToUpdate (100000);
618 if (EFI_ERROR (Status
)) {
619 EfiReleaseLock (&Global
->RtcLock
);
620 return EFI_DEVICE_ERROR
;
623 // Read Register B, and inhibit updates of the RTC
625 RegisterB
.Data
= RtcRead (RTC_ADDRESS_REGISTER_B
);
627 RegisterB
.Bits
.SET
= 1;
628 RtcWrite (RTC_ADDRESS_REGISTER_B
, RegisterB
.Data
);
631 ConvertEfiTimeToRtcTime (&RtcTime
, RegisterB
, &Century
);
634 // Set RTC alarm time
636 RtcWrite (RTC_ADDRESS_SECONDS_ALARM
, RtcTime
.Second
);
637 RtcWrite (RTC_ADDRESS_MINUTES_ALARM
, RtcTime
.Minute
);
638 RtcWrite (RTC_ADDRESS_HOURS_ALARM
, RtcTime
.Hour
);
640 RegisterB
.Bits
.AIE
= 1;
643 RegisterB
.Bits
.AIE
= 0;
646 // Allow updates of the RTC registers
648 RegisterB
.Bits
.SET
= 0;
649 RtcWrite (RTC_ADDRESS_REGISTER_B
, RegisterB
.Data
);
654 EfiReleaseLock (&Global
->RtcLock
);
673 // TODO: BcdValue - add argument and description to function comment
678 High
= BcdValue
>> 4;
679 Low
= BcdValue
- (High
<< 4);
681 return (UINT8
) (Low
+ (High
* 10));
685 RtcTestCenturyRegister (
698 // TODO: EFI_SUCCESS - add return value to function comment
699 // TODO: EFI_DEVICE_ERROR - add return value to function comment
704 Century
= RtcRead (RTC_ADDRESS_CENTURY
);
706 // RtcWrite (RTC_ADDRESS_CENTURY, 0x00);
708 Temp
= (UINT8
) (RtcRead (RTC_ADDRESS_CENTURY
) & 0x7f);
709 RtcWrite (RTC_ADDRESS_CENTURY
, Century
);
710 if (Temp
== 0x19 || Temp
== 0x20) {
714 return EFI_DEVICE_ERROR
;
718 ConvertRtcTimeToEfiTime (
720 IN RTC_REGISTER_B RegisterB
732 // TODO: Time - add argument and description to function comment
733 // TODO: RegisterB - add argument and description to function comment
737 if ((Time
->Hour
) & 0x80) {
743 Time
->Hour
= (UINT8
) (Time
->Hour
& 0x7f);
745 if (RegisterB
.Bits
.DM
== 0) {
746 Time
->Year
= BcdToDecimal ((UINT8
) Time
->Year
);
747 Time
->Month
= BcdToDecimal (Time
->Month
);
748 Time
->Day
= BcdToDecimal (Time
->Day
);
749 Time
->Hour
= BcdToDecimal (Time
->Hour
);
750 Time
->Minute
= BcdToDecimal (Time
->Minute
);
751 Time
->Second
= BcdToDecimal (Time
->Second
);
754 // If time is in 12 hour format, convert it to 24 hour format
756 if (RegisterB
.Bits
.MIL
== 0) {
757 if (PM
&& Time
->Hour
< 12) {
758 Time
->Hour
= (UINT8
) (Time
->Hour
+ 12);
761 if (!PM
&& Time
->Hour
== 12) {
766 Time
->Nanosecond
= 0;
767 Time
->TimeZone
= EFI_UNSPECIFIED_TIMEZONE
;
784 // TODO: Timeout - add argument and description to function comment
785 // TODO: EFI_DEVICE_ERROR - add return value to function comment
786 // TODO: EFI_DEVICE_ERROR - add return value to function comment
787 // TODO: EFI_SUCCESS - add return value to function comment
789 RTC_REGISTER_A RegisterA
;
790 RTC_REGISTER_D RegisterD
;
793 // See if the RTC is functioning correctly
795 RegisterD
.Data
= RtcRead (RTC_ADDRESS_REGISTER_D
);
797 if (RegisterD
.Bits
.VRT
== 0) {
798 return EFI_DEVICE_ERROR
;
801 // Wait for up to 0.1 seconds for the RTC to be ready.
803 Timeout
= (Timeout
/ 10) + 1;
804 RegisterA
.Data
= RtcRead (RTC_ADDRESS_REGISTER_A
);
805 while (RegisterA
.Bits
.UIP
== 1 && Timeout
> 0) {
806 MicroSecondDelay (10);
807 RegisterA
.Data
= RtcRead (RTC_ADDRESS_REGISTER_A
);
811 RegisterD
.Data
= RtcRead (RTC_ADDRESS_REGISTER_D
);
812 if (Timeout
== 0 || RegisterD
.Bits
.VRT
== 0) {
813 return EFI_DEVICE_ERROR
;
831 // TODO: Time - add argument and description to function comment
832 // TODO: EFI_INVALID_PARAMETER - add return value to function comment
833 // TODO: EFI_SUCCESS - add return value to function comment
835 if (Time
->Year
< 1998 ||
839 (!DayValid (Time
)) ||
843 Time
->Nanosecond
> 999999999 ||
844 (!(Time
->TimeZone
== EFI_UNSPECIFIED_TIMEZONE
|| (Time
->TimeZone
>= -1440 && Time
->TimeZone
<= 1440))) ||
845 (Time
->Daylight
& (~(EFI_TIME_ADJUST_DAYLIGHT
| EFI_TIME_IN_DAYLIGHT
)))
847 return EFI_INVALID_PARAMETER
;
861 TODO: Add function description
865 Time - TODO: add argument description
869 TODO: add return values
874 INTN DayOfMonth
[12] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
877 Time
->Day
> DayOfMonth
[Time
->Month
- 1] ||
878 (Time
->Month
== 2 && (!IsLeapYear (Time
) && Time
->Day
> 28))
894 TODO: Add function description
898 Time - TODO: add argument description
902 TODO: add return values
906 if (Time
->Year
% 4 == 0) {
907 if (Time
->Year
% 100 == 0) {
908 if (Time
->Year
% 400 == 0) {
922 ConvertEfiTimeToRtcTime (
924 IN RTC_REGISTER_B RegisterB
,
936 // TODO: Time - add argument and description to function comment
937 // TODO: RegisterB - add argument and description to function comment
938 // TODO: Century - add argument and description to function comment
944 // Adjust hour field if RTC in in 12 hour mode
946 if (RegisterB
.Bits
.MIL
== 0) {
947 if (Time
->Hour
< 12) {
951 if (Time
->Hour
>= 13) {
952 Time
->Hour
= (UINT8
) (Time
->Hour
- 12);
953 } else if (Time
->Hour
== 0) {
958 // Set the Time/Date/Daylight Savings values.
960 *Century
= DecimaltoBcd ((UINT8
) (Time
->Year
/ 100));
962 Time
->Year
= (UINT16
) (Time
->Year
% 100);
964 if (RegisterB
.Bits
.DM
== 0) {
965 Time
->Year
= DecimaltoBcd ((UINT8
) Time
->Year
);
966 Time
->Month
= DecimaltoBcd (Time
->Month
);
967 Time
->Day
= DecimaltoBcd (Time
->Day
);
968 Time
->Hour
= DecimaltoBcd (Time
->Hour
);
969 Time
->Minute
= DecimaltoBcd (Time
->Minute
);
970 Time
->Second
= DecimaltoBcd (Time
->Second
);
973 // If we are in 12 hour mode and PM is set, then set bit 7 of the Hour field.
975 if (RegisterB
.Bits
.MIL
== 0 && PM
) {
976 Time
->Hour
= (UINT8
) (Time
->Hour
| 0x80);
989 Judge whether two days are adjacent.
998 TRUE - The interval of two days are within one day.
999 FALSE - The interval of two days exceed ony day or parameter error.
1003 UINT8 DayOfMonth
[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
1004 BOOLEAN Adjacent
= FALSE
;
1006 if (From
->Year
== To
->Year
) {
1007 if (From
->Month
== To
->Month
) {
1008 if ((From
->Day
+ 1) == To
->Day
) {
1009 if ((CompareHMS(From
, To
) >= 0)) {
1012 } else if (From
->Day
== To
->Day
) {
1013 if ((CompareHMS(From
, To
) <= 0)) {
1017 } else if (((From
->Month
+ 1) == To
->Month
) && (To
->Day
== 1)) {
1018 if ((From
->Month
== 2) && !IsLeapYear(From
)) {
1019 if (From
->Day
== 28) {
1020 if ((CompareHMS(From
, To
) >= 0)) {
1024 } else if (From
->Day
== DayOfMonth
[From
->Month
- 1]) {
1025 if ((CompareHMS(From
, To
) >= 0)) {
1030 } else if (((From
->Year
+ 1) == To
->Year
) &&
1031 (From
->Month
== 12) &&
1032 (From
->Day
== 31) &&
1035 if ((CompareHMS(From
, To
) >= 0)) {
1049 Routine Description:
1056 // TODO: DecValue - add argument and description to function comment
1061 High
= DecValue
/ 10;
1062 Low
= DecValue
- (High
* 10);
1064 return (UINT8
) (Low
+ (High
<< 4));