Commit 7f21e480 authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Add HAL RTC support to Cortex branch of kernel, clean up RTCSupport code

Detail:
  HAL kernels (on the Cortex branch at least) now support HALDevice-based RTCs. If the kernels own RTC code is disabled or fails to detect an RTC, then after HAL_InitDevices is called the HALDevice list will be scanned for any HAL-resident RTC devices.
  Additionally, the RTCSupport flag (in Hdr:Machine.Machine), which was previously TRUE for all HAL kernels, can now be set to FALSE in HAL kernels to disable the kernels own IIC RTC code. This allows the unwanted legacy RTC code to be disabled for machines which are known to use HAL RTCs instead.
  hdr/RTCDevice - new header describing data structures used for HAL RTC device
  hdr/HALDevice - added RTCDevice device type, IIC serial bus type
  hdr/KernelWS - upgraded RTCFitted from a 1 byte field to 4 byte. It now stores either a null value (for no RTC), a value <2048 for an IIC RTC address, or a value >= 2048 for a RTCDevice ptr
  Makefile - added header export of hdr/RTCDevice
  s/GetAll - include hdr/RTCDevice
  s/NewReset - initialise HAL RTC after HAL_InitDevices if required
  s/PMF/i2cutils, s/PMF/osinit, s/PMF/osword - modifications to allow use of HAL RTC (and disallow use of builtin IIC RTC)
Admin:
  Tested on rev C2 beagleboard


Version 5.35, 4.79.2.98.2.11. Tagged as 'Kernel-5_35-4_79_2_98_2_11'
parent 7f375f88
......@@ -64,6 +64,7 @@ EXPORTS = ${EXP_HDR}.EnvNumbers \
${EXP_HDR}.VduExt \
${EXP_HDR}.HALEntries \
${EXP_HDR}.HALDevice \
${EXP_HDR}.RTCDevice \
${EXP_HDR}.OSEntries \
${C_EXP_HDR}.RISCOS \
${C_EXP_HDR}.HALEntries \
......@@ -163,6 +164,9 @@ ${EXP_HDR}.HALEntries: hdr.HALEntries
${EXP_HDR}.HALDevice: hdr.HALDevice
${CP} hdr.HALDevice $@ ${CPFLAGS}
${EXP_HDR}.RTCDevice: hdr.RTCDevice
${CP} hdr.RTCDevice $@ ${CPFLAGS}
${EXP_HDR}.OSEntries: hdr.OSEntries
${CP} hdr.OSEntries $@ ${CPFLAGS}
......
......@@ -13,11 +13,11 @@
GBLS Module_ComponentPath
Module_MajorVersion SETS "5.35"
Module_Version SETA 535
Module_MinorVersion SETS "4.79.2.98.2.10"
Module_Date SETS "17 Jul 2009"
Module_ApplicationDate SETS "17-Jul-09"
Module_MinorVersion SETS "4.79.2.98.2.11"
Module_Date SETS "23 Jul 2009"
Module_ApplicationDate SETS "23-Jul-09"
Module_ComponentName SETS "Kernel"
Module_ComponentPath SETS "castle/RiscOS/Sources/Kernel"
Module_FullVersion SETS "5.35 (4.79.2.98.2.10)"
Module_HelpVersion SETS "5.35 (17 Jul 2009) 4.79.2.98.2.10"
Module_FullVersion SETS "5.35 (4.79.2.98.2.11)"
Module_HelpVersion SETS "5.35 (23 Jul 2009) 4.79.2.98.2.11"
END
......@@ -5,19 +5,19 @@
*
*/
#define Module_MajorVersion_CMHG 5.35
#define Module_MinorVersion_CMHG 4.79.2.98.2.10
#define Module_Date_CMHG 17 Jul 2009
#define Module_MinorVersion_CMHG 4.79.2.98.2.11
#define Module_Date_CMHG 23 Jul 2009
#define Module_MajorVersion "5.35"
#define Module_Version 535
#define Module_MinorVersion "4.79.2.98.2.10"
#define Module_Date "17 Jul 2009"
#define Module_MinorVersion "4.79.2.98.2.11"
#define Module_Date "23 Jul 2009"
#define Module_ApplicationDate "17-Jul-09"
#define Module_ApplicationDate "23-Jul-09"
#define Module_ComponentName "Kernel"
#define Module_ComponentPath "castle/RiscOS/Sources/Kernel"
#define Module_FullVersion "5.35 (4.79.2.98.2.10)"
#define Module_HelpVersion "5.35 (17 Jul 2009) 4.79.2.98.2.10"
#define Module_FullVersion "5.35 (4.79.2.98.2.11)"
#define Module_HelpVersion "5.35 (23 Jul 2009) 4.79.2.98.2.11"
#define Module_LibraryVersionInfo "5:35"
......@@ -56,6 +56,7 @@ HALDeviceSysPeri_IntC # 1 ; Interrupt controller
HALDeviceSysPeri_DMAC # 1 ; DMA controller
HALDeviceSysPeri_DMAB # 1 ; DMA channel - buffer type
HALDeviceSysPeri_DMAL # 1 ; DMA channel - list type
HALDeviceSysPeri_RTC # 1 ; RTCDevice
HALDeviceType_Comms * 4 :SHL: 8
^ 1
......@@ -86,7 +87,7 @@ HALDeviceExpBus_PCI * 2 :SHL: 24
HALDeviceBus_Ser * 4 :SHL: 28
HALDeviceSerBus_ACLink * 0 :SHL: 24
HALDeviceSerBus_IIC * 1 :SHL: 24
^ 0
HALDeviceID_AudC_M5451 # 1
......@@ -104,6 +105,9 @@ HALDeviceID_DMAB_M1535 # 1
^ 0
HALDeviceID_DMAL_M5229 # 1
^ 0
HALDeviceID_RTC_TPS65950 # 1
]
OPT OldOpt
......
......@@ -1267,6 +1267,8 @@ ProcVec_End # 0
ProcVecPreVeneersSize * 4*4 ; Space for preveneers for loading handler addresses from 0 page.
ProcVecPreVeneers # ProcVecPreVeneersSize
RTCFitted # 4 ; =0 no RTC, <2048 = address of I2C RTC, >=2048 = HALDevice_RTC ptr
[ :DEF: ShowWS
! 0, "Free space before DebuggerSpace = ":CC::STR:(&300-@)
]
......@@ -1278,7 +1280,6 @@ Export_DebuggerSpace # 16*8 ; Debugger module needs some zero page
; NVRAM support
NVRamSize # 1 ; Size of NVRam (E2ROM & CMOS) fitted in 256byte units
RTCFitted # 1 ; flag non zero if RTC is fitted
NVRamBase # 1 ; Base of NVRam
NVRamSpeed # 1 ; Clock hold time in 0.5s units
NVRamPageSize # 1 ; Page size for writing (log2)
......
; Copyright 2009 Castle Technology Ltd
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
;
; Public interface (ie interface to the kernel) of RTC HAL devices
GET hdr:HALDevice
OldOpt SETA {OPT}
OPT OptNoList+OptNoP1List
[ :LNOT: :DEF: Included_Hdr_RTCDevice
GBLL Included_Hdr_RTCDevice
Included_Hdr_RTCDevice SETL {TRUE}
; Device for each RTC controller
^ 0
# HALDeviceSize
HALDevice_RTCTimeFormat # 1
HALDevice_RTCFormatFlags # 1
# 2 ; Padding
HALDevice_RTCReadTime # 4
HALDevice_RTCWriteTime # 4
HALDevice_RTC_Size * :INDEX: @
; Supported time formats for communication with RISC OS
RTCTimeFormat_BCD * 0
; BCD format details
RTCFormatFlags_BCD_1BasedDay * 1 :SHL: 0 ; is DayOfMonth 0-based or 1-based?
RTCFormatFlags_BCD_1BasedMonth * 1 :SHL: 1 ; is Month 0-based or 1-based?
RTCFormatFlags_BCD_NeedsYearHelp * 1 :SHL: 2 ; If this is set, RISC OS assumes only the RTC is only able to store the two lowest bits of YearLO. If this is unset, the RTC must be able to store the full two-byte year.
; Struct for storing BCD time
^ 0
RTCTimeStruct_BCD_Centiseconds # 1
RTCTimeStruct_BCD_Seconds # 1
RTCTimeStruct_BCD_Minutes # 1
RTCTimeStruct_BCD_Hours # 1
RTCTimeStruct_BCD_DayOfMonth # 1
RTCTimeStruct_BCD_Month # 1
RTCTimeStruct_BCD_YearLO # 1
RTCTimeStruct_BCD_YearHI # 1
RTCTimeStruct_BCD_Size * :INDEX: @
; Return codes
RTCRetCode_OK * 0
RTCRetCode_Error * -1 ; Generic nonspecific error
RTCRetCode_InvalidTime * -2 ; For write operations, indicates that the RTC cannot be programmed with the supplied time. For read operations, indicates that the RTC has been detected as containing an invalid time (e.g. following power loss)
]
OPT OldOpt
END
......@@ -42,6 +42,7 @@ ShowWS SETL {TRUE} ; Make KernelWS be verbose
GET Hdr:KernelWS
GET Hdr:HALEntries
GET Hdr:HALDevice
GET Hdr:RTCDevice
GET Hdr:OSEntries
GET Hdr:Services
GET Hdr:FSNumbers
......
......@@ -1882,6 +1882,7 @@ ResetPart1Done ; R0 is reset type
STR R0, [R0, #DeviceCount]
STR R0, [R0, #DeviceTable]
CallHAL HAL_InitDevices ; get HAL to register any devices it has
BL LookForHALRTC ; Check if an RTC was just added. This is currently the only place where HAL RTCs are checked for; if we wanted to check anywhere else (e.g. after ROM module initialisation) then we'd have to listen for Service_Hardware so we can cope with device removal
|
BL L1L2PTenhancements ; little tricks on cacheability etc for performance
]
......@@ -2349,4 +2350,40 @@ HexTable = "0123456789ABCDEF"
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[ HAL
LookForHALRTC
Push "R0-R2,R8,R14"
MOV R0, #0
LDR R0, [R0, #RTCFitted]
CMP R0, #0
Pull "R0-R2,R8,PC",NE ; We already have an RTC
LDR R0, =(0:SHL:16)+HALDeviceType_SysPeri+HALDeviceSysPeri_RTC
MOV R1, #0
MOV R8, #4
01
SWI XOS_Hardware
Pull "R0-R2,R8,PC",VS
CMP R1, #-1
Pull "R0-R2,R8,PC",EQ
LDR R14, [R2, #HALDevice_Location]
; Currently, we only support devices located on IIC bus 0
CMP R14, #HALDeviceBus_Ser+HALDeviceSerBus_IIC
BNE %BT01
; Try activating
Push "R0-R3,R12"
MOV R0, R2
MOV LR, PC
LDR PC, [R2, #HALDevice_Activate]
CMP R0, #1
Pull "R0-R3,R12"
BNE %BT01
DebugTX "HAL RTC detected!"
MOV R0, #0
STR R2, [R0, #RTCFitted]
; Read the time from the RTC into RealTime, and fixup YearCMOS if needed
BL CheckYear
DebugTX "Leaving LookForHALRTC"
Pull "R0-R2,R8,PC"
]
END
......@@ -549,8 +549,9 @@ Read
CMP R0, #&10 ; don't cache the clock
[ E2ROMSupport
BHS %FT13
; If there's no RTC, read dummy values from the cache
MOV R14, #0
LDRB R14, [R14, #RTCFitted]
LDR R14, [R14, #RTCFitted]
TEQ R14, #0
BNE %FT15
|
......@@ -1043,7 +1044,7 @@ GetI2CAddress ROUT
; address is < end address -> is valid
MOV R1, #0
;LDRB R1, [R1, #RTCFitted] ; This causes a headache if both an RTC and NVRAM are fitted
;LDR R1, [R1, #RTCFitted] ; This causes a headache if both an RTC and NVRAM are fitted
;TEQ R1, #0
;LDREQB R1, [R1, #NVRamBase] ; RTC overlaps bottom of NVRAM
LDRB R1, [R1, #NVRamBase] ; RTC overlaps bottom of NVRAM
......@@ -1192,27 +1193,90 @@ MakeChecksum ROUT
; in: UTC time:
; R0 = hours
; R1 = minutes
; R2 = day of month
; R3 = month
; R2 = day of month (1-based)
; R3 = month (1-based)
; R5 = year (lo)
; R6 = year (hi)
; R7 = seconds
; R8 = centiseconds
;
; If R0,R2,R5 or R6 is -1 then the time,date,year,century (respectively) will not be written
; If R0,R2,R5 or R6 is -1 then the time,date,year,century (respectively) will not be written. However if R2=-1, R5 & R6 will also be -1, so only R0 (for time) and R2 (for D/M/Y) need checking.
;
SetTime ROUT
Push "R4, R9-R10, R14" ; save registers
LDR R10, =ZeroPage
LDRB R10, [R10, #RTCFitted]
LDR R10, [R10, #RTCFitted]
[ HAL
CMP R10, #2048 ; Is it an I2C address or HALDevice_RTC ptr?
BLO %FT15
Push "R0-R3,R12"
MOV R4, R0 ; copy hours in R4
; Prepare BCD data on stack
ASSERT (RTCTimeStruct_BCD_Size :AND: 3)=0
SUB R13, R13, #RTCTimeStruct_BCD_Size
MOV R9, R13
; Ensure struct matches our setting order
ASSERT RTCTimeStruct_BCD_Centiseconds = 0
ASSERT RTCTimeStruct_BCD_Seconds = 1
ASSERT RTCTimeStruct_BCD_Minutes = 2
ASSERT RTCTimeStruct_BCD_Hours = 3
ASSERT RTCTimeStruct_BCD_DayOfMonth = 4
ASSERT RTCTimeStruct_BCD_Month = 5
ASSERT RTCTimeStruct_BCD_YearLO = 6
ASSERT RTCTimeStruct_BCD_YearHI = 7
; Are we setting the time?
CMP R4, #-1
STREQ R4, [R9], #4 ; Conveniently, 4 bytes of time info
BEQ %FT11
MOV R0, R8
BL HTBS9
MOV R0, R7
BL HTBS9
MOV R0, R1
BL HTBS9
MOV R0, R4
BL HTBS9
11
; Are we setting the date?
CMP R2, #-1
STREQ R2, [R9], #4 ; Conveniently, 4 bytes of date info
BEQ %FT12
LDRB R1, [R10, #HALDevice_RTCFormatFlags]
MOV R0, R2
TST R1, #RTCFormatFlags_BCD_1BasedDay
SUBEQ R0, R0, #1
BL HTBS9
TST R1, #RTCFormatFlags_BCD_1BasedMonth
MOV R0, R3
SUBEQ R0, R0, #1
BL HTBS9
MOV R0, R5
BL HTBS9
MOV R0, R6
BL HTBS9
12
SUB R1, R9, #8
MOV R0, R10
ADRL R2, HALRTC_IICOp
MOV LR, PC
LDR PC, [R10, #HALDevice_RTCWriteTime]
; Unfortunately, we don't do anything with the return code at the moment.
13
ADD R13, R13, #RTCTimeStruct_BCD_Size ; RTCTimeStruct
Pull "R0-R3,R12"
BL RTCToRealTime
Pull "R4, R9-R10, PC"
15
] ; HAL
[ RTCSupport :LOR: :LNOT: HAL
TEQ R10, #0 ; no RTC - just set soft copy
BNE %FT20
]
BL RegToRealTime
Pull "R4, R9-R10, PC"
[ RTCSupport :LOR: :LNOT: HAL
20
Push "R0-R2"
MOV R4, R0 ; copy hours in R4
......@@ -1294,6 +1358,7 @@ SetTime ROUT
Push "R14"
BL IIC_Op ; write the prepared block with retries
Pull "PC"
] ; RTCSupport :LOR: :LNOT: HAL
; *****************************************************************************
;
......@@ -1303,20 +1368,72 @@ SetTime ROUT
;
; out: R0 = hours
; R1 = minutes
; R2 = days
; R3 = months
; R2 = days (1-based)
; R3 = months (1-based)
; R5 = year (lo)
; R6 = year (hi)
; R7 = seconds
; R8 = centiseconds
;
; Note: Returns garbage if no RTC, or an error occurs!
ReadTime ROUT
Push "R4, R14"
SUB R13, R13, #(12*2)+6+1+1
LDR R14, =ZeroPage
LDRB R2, [R14, #RTCFitted]
LDR R2, [R14, #RTCFitted]
[ HAL
CMP R2, #2048 ; IIC address or RTCDevice ptr?
BLO %FT49
Push "R12"
MOV R6, R2
MOV R0, R2
SUB R13, R13, #RTCTimeStruct_BCD_Size
MOV R1, R13
ADRL R2, HALRTC_IICOp
MOV LR, PC
LDR PC, [R0, #HALDevice_RTCReadTime]
; Not really much point checking the error code since we have no way of returning an error to the caller
; So just read the junk data and be done with it
LDRB R0, [R13, #RTCTimeStruct_BCD_Centiseconds]
BL BCDToHex
MOV R8, R0 ; centiseconds
LDRB R0, [R13, #RTCTimeStruct_BCD_Seconds]
BL BCDToHex
MOV R7, R0 ; seconds
LDRB R0, [R13, #RTCTimeStruct_BCD_Minutes]
BL BCDToHex
MOV R1, R0 ; minutes
LDRB R0, [R13, #RTCTimeStruct_BCD_Hours]
BL BCDToHex
MOV R4, R0 ; hours
LDRB R0, [R13, #RTCTimeStruct_BCD_DayOfMonth]
BL BCDToHex
LDRB R12, [R6, #HALDevice_RTCFormatFlags]
MOV R2, R0
TST R12, #RTCFormatFlags_BCD_1BasedDay
ADDEQ R2, R2, #1 ; days
LDRB R0, [R13, #RTCTimeStruct_BCD_Month]
BL BCDToHex
MOV R3, R0
TST R12, #RTCFormatFlags_BCD_1BasedMonth
ADDEQ R3, R3, #1 ; months
LDRB R0, [R13, #RTCTimeStruct_BCD_YearLO]
BL BCDToHex
MOV R5, R0 ; year lo
LDRB R0, [R13, #RTCTimeStruct_BCD_YearHI]
BL BCDToHex
; We're done with our stack data, remove it
ADD R13, R13, #RTCTimeStruct_BCD_Size
MOV R6, R0 ; year hi
; If the RTC can reliably store the year, we don't need to use the CMOS copy
TST R12, #RTCFormatFlags_BCD_NeedsYearHelp
Pull "R12"
BEQ DontReadTimeYear
B ReadTimeYear
49
] ; HAL
[ RTCSupport :LOR: :LNOT: HAL
SUB R13, R13, #(12*2)+6+1+1
ORR R14, R2, #1:SHL:29 ; retry
STR R14, [R13, #8] ; transfer 1 address
ADD R0, R14, #1
......@@ -1361,6 +1478,7 @@ ReadTime ROUT
AND R0, R0, #&1F ; month (clear day of week bits)
BL BCDToHex
MOV R3, R0
ADD R13, R13, #(12*2)+6+1+1
B ReadTimeYear
50
......@@ -1381,25 +1499,26 @@ ReadTime ROUT
LDRB R0, [R13, #6]
BL BCDToHex
MOV R3, R0 ; month
ADD R13, R13, #(12*2)+6+1+1
] ; RTCSupport :LOR: :LNOT: HAL
ReadTimeYear
ADD R13, R13, #(12*2)+6+1+1
MOV R0, #YearCMOS
BL Read
MOV R5, R0 ; year (lo)
MOV R0, #YearCMOS+1
BL Read
MOV R6, R0 ; year (hi)
DontReadTimeYear
MOV R0, R4 ; put hours in R0
TEQ R2, #0 ; Ensure day/month are non-zero (LRust, fix RP-0370)
MOVEQ R2, #1 ; No then force 1st
TEQ R3, #0 ; Invalid month?
MOVEQ R3, #1 ; Yes then force Jan
Pull "R4, PC"
[ RTCSupport :LOR: :LNOT: HAL
; *****************************************************************************
;
; InitRTC - Force the clock into a known state (incase of new battery)
......@@ -1433,6 +1552,35 @@ InitRTC
65
ADD R13, R13, #4
Pull "R0-R2, PC"
] ; RTCSupport :LOR: :LNOT: HAL
[ HAL
; *****************************************************************************
;
; HALRTC_IICOp - Wrapper for IIC_OpV to allow it to be called from HALDevice RTC drivers
;
; in: R0 = iic_transfer *
; R1 = number of transfers
; R2 = 'kernel workspace ptr' - currently unused
; out: R0 = HAL_IICOp error code
HALRTC_IICOp
Push "R14"
BL IIC_OpV
; Translate the RISC OS error code back into an IIC one we can pass to the driver
LDRVS R2, [R0]
LDRVS R1, =ErrorNumber_IIC_Busy
MOV R0, #5 ; EERROR
TEQ R2, R1 ; Won't modify V
MOVEQ R0, #3 ; EBUSY
LDRVS R1, =ErrorNumber_IIC_NoAcknowledge
TEQ R2, R1
MOVEQ R0, #2 ; ENOACK
MOVVC R0, #0 ; ECOMPLETED
Pull "PC"
]
; *****************************************************************************
;
......@@ -1458,12 +1606,12 @@ InitCMOSCache Entry "r1-r6, sb,r12"
BVC %FT13
MOV R0, #RTCAddressPHI
BL DummyAccess
STRVSB R4, [R2, #RTCFitted]
STRVS R4, [R2, #RTCFitted]
13
STRVCB R0, [R2, #RTCFitted]
STRVC R0, [R2, #RTCFitted]
BLVC InitRTC
|
STRB R4, [R2, #RTCFitted]
STR R4, [R2, #RTCFitted]
]
[ HAL
......
......@@ -176,7 +176,7 @@ BuffPtrInitLoop
secs0070 * (86400*(365*70+18)) ; from time() in risc_oslib.c.armsys
MOV R1, #0
LDRB R0, [R1, #RTCFitted]
LDR R0, [R1, #RTCFitted]
TEQ R0, #0 ; when zero,no RTC
BNE %FT28
LDR R7, =(secs0070 * 100) ; centiseconds LSW
......
......@@ -729,7 +729,53 @@ OsWord0F_5byte
CheckYear ROUT
Push "R0,R1,R2,R14"
MOV R0, #0
LDRB R0, [R0, #RTCFitted]
LDR R0, [R0, #RTCFitted]
[ HAL
CMP R0, #2048
[ RTCSupport
BLO %FT8
|
BLO %FT15
]
; Ask the RTC what it thinks the year is
Push "R3,R10,R12"
MOV R10, R0
SUB R13, R13, #RTCTimeStruct_BCD_Size
MOV R1, R13
ADRL R2, HALRTC_IICOp
MOV LR, PC
LDR PC, [R0, #HALDevice_RTCReadTime]
; Did we succeed?
CMP R0, #RTCRetCode_OK
LDRB R0, [R13, #RTCTimeStruct_BCD_YearLO]
LDRB R1, [R13, #RTCTimeStruct_BCD_YearHI]
ADD R13, R13, #RTCTimeStruct_BCD_Size
LDRB R2, [R10, #HALDevice_RTCFormatFlags]
Pull "R3,R10,R12"
BNE %FT15
TST R2, #RTCFormatFlags_BCD_NeedsYearHelp
BNE %FT9
; Year is reliable; convert R0 & R1 to ints and update CMOS if necessary.
BL BCDToHex
MOV R2, R1
MOV R1, R0 ; YearLO
MOV R0, #YearCMOS
BL Read
CMP R0, R1
MOVNE R0, #YearCMOS
BLNE Write
MOV R0, R2
BL BCDToHex
MOV R1, R0 ; YearHI
MOV R0, #YearCMOS+1
BL Read
CMP R0, R1
MOVNE R0, #YearCMOS+1
BLNE Write
B %FT15
8
] ; HAL
[ RTCSupport :LOR: :LNOT: HAL
TEQ R0, #RTCAddressPHI
MOVEQ R1, #5
MOVNE R1, #6 ; year address (dependant on RTC)
......@@ -747,7 +793,9 @@ CheckYear ROUT
TEQ R1, #RTCAddressPHI+1
MOVEQ R1, R0, LSR #6
ANDNE R1, R0, #3 ; R1= year MOD 4
] ; RTCSupport :LOR: :LNOT: HAL
9
ANDNE R1, R0, #3 ; R1= year MOD 4. Note sharing of NE condition with HAL code.
MOV R0, #YearCMOS
BL Read
AND R2, R0, #3
......@@ -770,7 +818,7 @@ CheckYear ROUT
MOV R1, R2
MOV R0, #YearCMOS
BL Write
15
BL RTCToRealTime
Pull "R0,R1,R2,PC"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment