Commit f54f65e1 authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Use Push/Pull macros

This gets rid of ~200 mixed UAL warnings without having to use the -nowarn switch, which could hide some genuine warnings needing attention.
PUSH and POP are synonyms for their STM and LDM equivalent, according to the ARM ARM.
Version number bumped to +0.01 greater than Tank's latest binary.

Version 0.58. Tagged as 'GPIO-0_58'
parent 2241ad56
...@@ -11,13 +11,13 @@ ...@@ -11,13 +11,13 @@
GBLS Module_HelpVersion GBLS Module_HelpVersion
GBLS Module_ComponentName GBLS Module_ComponentName
GBLS Module_ComponentPath GBLS Module_ComponentPath
Module_MajorVersion SETS "0.54" Module_MajorVersion SETS "0.58"
Module_Version SETA 54 Module_Version SETA 58
Module_MinorVersion SETS "" Module_MinorVersion SETS ""
Module_Date SETS "09 Oct 2014" Module_Date SETS "09 Oct 2014"
Module_ApplicationDate SETS "09-Oct-14" Module_ApplicationDate SETS "09-Oct-14"
Module_ComponentName SETS "GPIO" Module_ComponentName SETS "GPIO"
Module_ComponentPath SETS "bsd/RiscOS/Sources/ThirdParty/TankStage/HWSupport/GPIO" Module_ComponentPath SETS "bsd/RiscOS/Sources/ThirdParty/TankStage/HWSupport/GPIO"
Module_FullVersion SETS "0.54" Module_FullVersion SETS "0.58"
Module_HelpVersion SETS "0.54 (09 Oct 2014)" Module_HelpVersion SETS "0.58 (09 Oct 2014)"
END END
/* (0.54) /* (0.58)
* *
* This file is automatically maintained by srccommit, do not edit manually. * This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1. * Last processed by srccommit version: 1.1.
* *
*/ */
#define Module_MajorVersion_CMHG 0.54 #define Module_MajorVersion_CMHG 0.58
#define Module_MinorVersion_CMHG #define Module_MinorVersion_CMHG
#define Module_Date_CMHG 09 Oct 2014 #define Module_Date_CMHG 09 Oct 2014
#define Module_MajorVersion "0.54" #define Module_MajorVersion "0.58"
#define Module_Version 54 #define Module_Version 58
#define Module_MinorVersion "" #define Module_MinorVersion ""
#define Module_Date "09 Oct 2014" #define Module_Date "09 Oct 2014"
...@@ -18,6 +18,6 @@ ...@@ -18,6 +18,6 @@
#define Module_ComponentName "GPIO" #define Module_ComponentName "GPIO"
#define Module_ComponentPath "bsd/RiscOS/Sources/ThirdParty/TankStage/HWSupport/GPIO" #define Module_ComponentPath "bsd/RiscOS/Sources/ThirdParty/TankStage/HWSupport/GPIO"
#define Module_FullVersion "0.54" #define Module_FullVersion "0.58"
#define Module_HelpVersion "0.54 (09 Oct 2014)" #define Module_HelpVersion "0.58 (09 Oct 2014)"
#define Module_LibraryVersionInfo "0:54" #define Module_LibraryVersionInfo "0:58"
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
Read_Data Read_Data
CMP r0,#i2c_flag-1 ;check if i2c gpio CMP r0,#i2c_flag-1 ;check if i2c gpio
BCS i2c_Read_Data ; BCS i2c_Read_Data ;
PUSH {r1-r10,lr} ; Push "r1-r10,lr" ;
BL get_logical_and_pin ; BL get_logical_and_pin ;
CMP r0,#-1 ; CMP r0,#-1 ;
BEQ %FT10 ; BEQ %FT10 ;
...@@ -51,7 +51,7 @@ Read_Data ...@@ -51,7 +51,7 @@ Read_Data
AND r0,r0,r1 ;mask just ours AND r0,r0,r1 ;mask just ours
CMP r0,#0 ; CMP r0,#0 ;
MOVNE r0,#1 ; MOVNE r0,#1 ;
10 POP {r1-r10,pc} ; restore registers and exit 10 Pull "r1-r10,pc" ; restore registers and exit
;r0=value (0 or 1) -1 if not GPIO ;r0=value (0 or 1) -1 if not GPIO
;--------------------------------------------- ;---------------------------------------------
...@@ -62,7 +62,7 @@ Read_Data ...@@ -62,7 +62,7 @@ Read_Data
Write_Data Write_Data
CMP r0,#i2c_flag-1 ;check if i2c gpio CMP r0,#i2c_flag-1 ;check if i2c gpio
BCS i2c_Write_Data ; BCS i2c_Write_Data ;
PUSH {r2-r10,lr} ; Push "r2-r10,lr" ;
MOV r7,r1 ;save value MOV r7,r1 ;save value
BL check_protect_i2c ; BL check_protect_i2c ;
CMP r0,#-1 ; CMP r0,#-1 ;
...@@ -82,7 +82,7 @@ Write_Data ...@@ -82,7 +82,7 @@ Write_Data
CMP r7,#0 ;check flag CMP r7,#0 ;check flag
STRNE r1,[r0,r4] ;set data bit STRNE r1,[r0,r4] ;set data bit
STREQ r1,[r0,r5] ;unset data bit STREQ r1,[r0,r5] ;unset data bit
10 POP {r2-r10,pc} ; restore registers and exit 10 Pull "r2-r10,pc" ; restore registers and exit
;r0= -1 if input , protected or not GPIO ;r0= -1 if input , protected or not GPIO
;or ;or
;r0=logical address ;r0=logical address
...@@ -94,7 +94,7 @@ Write_Data ...@@ -94,7 +94,7 @@ Write_Data
Read_OE Read_OE
CMP r0,#i2c_flag-1 ;check if i2c gpio CMP r0,#i2c_flag-1 ;check if i2c gpio
BCS i2c_Read_OE ; BCS i2c_Read_OE ;
PUSH {r1-r10,lr} ; Push "r1-r10,lr" ;
BL get_logical_and_pin ; BL get_logical_and_pin ;
CMP r0,#-1 ; CMP r0,#-1 ;
BEQ %FT10 ; BEQ %FT10 ;
...@@ -105,7 +105,7 @@ Read_OE ...@@ -105,7 +105,7 @@ Read_OE
AND r0,r0,r1 ; AND r0,r0,r1 ;
CMP r0,#0 ;is it output ? CMP r0,#0 ;is it output ?
MOVNE r0,#1 ;opposite logic to match Pi MOVNE r0,#1 ;opposite logic to match Pi
10 POP {r1-r10,pc} ; restore registers and exit 10 Pull "r1-r10,pc" ; restore registers and exit
;r0=value (0=output,1=input) ;r0=value (0=output,1=input)
;--------------------------------------------- ;---------------------------------------------
...@@ -115,18 +115,18 @@ Read_OE ...@@ -115,18 +115,18 @@ Read_OE
Write_OE Write_OE
CMP r0,#i2c_flag-1 ;check if i2c gpio CMP r0,#i2c_flag-1 ;check if i2c gpio
BCS i2c_Write_OE ; BCS i2c_Write_OE ;
PUSH {r1-r10,lr} ; Push "r1-r10,lr" ;
SWI XOS_IntOff SWI XOS_IntOff
MOV r7,r1 ;save value MOV r7,r1 ;save value
BL check_protect_i2c ; BL check_protect_i2c ;
CMP r0,#-1 ; CMP r0,#-1 ;
BEQ %FT10 ; BEQ %FT10 ;
PUSH {r0} ; Push "r0" ;
BL get_table ; BL get_table ;
BL find_register ; BL find_register ;
TST r0,#input_only ; TST r0,#input_only ;
MOVNE r7,#1 ; MOVNE r7,#1 ;
POP {r0} ; Pull "r0" ;
BL get_logical_and_pin ; BL get_logical_and_pin ;
CMP r0,#-1 ; CMP r0,#-1 ;
BEQ %FT10 ; BEQ %FT10 ;
...@@ -140,14 +140,14 @@ Write_OE ...@@ -140,14 +140,14 @@ Write_OE
STR r3,[r0,r6] ;save back STR r3,[r0,r6] ;save back
MOV r0,#0 ; MOV r0,#0 ;
10 SWI XOS_IntOn 10 SWI XOS_IntOn
POP {r1-r10,pc} ; restore registers and exit Pull "r1-r10,pc" ; restore registers and exit
;r0=0 if ok -1 if protected ;r0=0 if ok -1 if protected
;---------------------------------------------- ;----------------------------------------------
; MapAuxIn ; MapAuxIn
;r0=mode ;r0=mode
Aux_As_GPIO Aux_As_GPIO
PUSH {r0-r10,lr} ; Push "r0-r10,lr" ;
BL get_table ; BL get_table ;
LDR r6,[r1,#aux_pins] ;get list of pins LDR r6,[r1,#aux_pins] ;get list of pins
common CMP r6,#-1 ; common CMP r6,#-1 ;
...@@ -178,12 +178,12 @@ common1 ...@@ -178,12 +178,12 @@ common1
MOV r1,#0 ;set output to off MOV r1,#0 ;set output to off
BL Write_Data ;write data BL Write_Data ;write data
B %BT10 ;next B %BT10 ;next
20 POP {r0-r10,pc} ; restore registers and exit 20 Pull "r0-r10,pc" ; restore registers and exit
;--------------------------------------------- ;---------------------------------------------
; MapExpIn ; MapExpIn
;r0=mode ;r0=mode
Exp_As_GPIO Exp_As_GPIO
PUSH {r0-r10,lr} ; Push "r0-r10,lr" ;
BL get_table ; BL get_table ;
LDR r6,[r1,#exp_pins] ;get list of pins LDR r6,[r1,#exp_pins] ;get list of pins
B common ; B common ;
...@@ -192,14 +192,14 @@ Exp_As_GPIO ...@@ -192,14 +192,14 @@ Exp_As_GPIO
; MapCameraIn ; MapCameraIn
;r0=mode ;r0=mode
Camera_As_GPIO Camera_As_GPIO
PUSH {r0-r10,lr} ; Push "r0-r10,lr" ;
BL get_table ; BL get_table ;
LDR r6,[r1,#camera_pins] ;get list of pins LDR r6,[r1,#camera_pins] ;get list of pins
B common ; B common ;
;--------------------------------------------- ;---------------------------------------------
; SafeAuxIn ; SafeAuxIn
Aux_As_Safe Aux_As_Safe
PUSH {r0-r10,lr} ; Push "r0-r10,lr" ;
BL get_table ; BL get_table ;
LDR r6,[r1,#aux_pins] ;get list of pins LDR r6,[r1,#aux_pins] ;get list of pins
safe CMP r6,#-1 ; safe CMP r6,#-1 ;
...@@ -207,25 +207,25 @@ safe CMP r6,#-1 ; ...@@ -207,25 +207,25 @@ safe CMP r6,#-1 ;
MOV r3,#safemode ;safe mode MOV r3,#safemode ;safe mode
MOV r7,#&FF ;skip OE write MOV r7,#&FF ;skip OE write
B common1 ; B common1 ;
20 POP {r0-r10,pc} ; restore registers and exit 20 Pull "r0-r10,pc" ; restore registers and exit
;--------------------------------------------- ;---------------------------------------------
; SafeExpIn ; SafeExpIn
Exp_As_Safe Exp_As_Safe
PUSH {r0-r10,lr} ; Push "r0-r10,lr" ;
BL get_table ; BL get_table ;
LDR r6,[r1,#exp_pins] ;get list of pins LDR r6,[r1,#exp_pins] ;get list of pins
B safe ; B safe ;
;--------------------------------------------- ;---------------------------------------------
; SafecameraIn ; SafecameraIn
Camera_As_Safe Camera_As_Safe
PUSH {r0-r10,lr} ; Push "r0-r10,lr" ;
BL get_table ; BL get_table ;
LDR r6,[r1,#camera_pins] ;get list of pins LDR r6,[r1,#camera_pins] ;get list of pins
B safe ; B safe ;
;--------------------------------------------- ;---------------------------------------------
; ;
Aux_As_USB Aux_As_USB
PUSH {r0-r10,lr} ; Push "r0-r10,lr" ;
MOV r7,#usb_pins ; MOV r7,#usb_pins ;
set_pins set_pins
BL get_table ; BL get_table ;
...@@ -239,29 +239,29 @@ set_pins ...@@ -239,29 +239,29 @@ set_pins
MOV r1,r1,LSR #8 ;just mode MOV r1,r1,LSR #8 ;just mode
BL Write_Mode BL Write_Mode
B %BT10 B %BT10
20 POP {r0-r10,pc} ; restore registers and exit 20 Pull "r0-r10,pc" ; restore registers and exit
;--------------------------------------------- ;---------------------------------------------
; ;
Exp_As_UART Exp_As_UART
PUSH {r0-r10,lr} ; Push "r0-r10,lr" ;
MOV r7,#uart_pins ; MOV r7,#uart_pins ;
B set_pins ; B set_pins ;
;--------------------------------------------- ;---------------------------------------------
; ;
Aux_As_MMC Aux_As_MMC
PUSH {r0-r10,lr} ; Push "r0-r10,lr" ;
MOV r7,#mmc_aux_pins ; MOV r7,#mmc_aux_pins ;
B set_pins ; B set_pins ;
;--------------------------------------------- ;---------------------------------------------
; mode2AuxIn ; mode2AuxIn
Exp_As_MMC Exp_As_MMC
PUSH {r0-r10,lr} ; Push "r0-r10,lr" ;
MOV r7,#mmc_exp_pins ; MOV r7,#mmc_exp_pins ;
B set_pins ; B set_pins ;
;--------------------------------------------- ;---------------------------------------------
; mode3AuxIn ; mode3AuxIn
Aux_As_MM Aux_As_MM
PUSH {r0-r10,lr} ; Push "r0-r10,lr" ;
MOV r7,#mm_pins ; MOV r7,#mm_pins ;
B set_pins ; B set_pins ;
;--------------------------------------------- ;---------------------------------------------
...@@ -270,7 +270,7 @@ Aux_As_MM ...@@ -270,7 +270,7 @@ Aux_As_MM
Read_Mode Read_Mode
CMP r0,#i2c_flag-1 ;check if i2c gpio CMP r0,#i2c_flag-1 ;check if i2c gpio
BCS i2c_Read_Mode BCS i2c_Read_Mode
PUSH {r1-r10,lr} ; Push "r1-r10,lr" ;
MOV r5,#1 ; read/write flag MOV r5,#1 ; read/write flag
;r5=read or write (1/0) ;r5=read or write (1/0)
;r6=mode to write ;r6=mode to write
...@@ -286,7 +286,7 @@ modecommon ...@@ -286,7 +286,7 @@ modecommon
STREQH r6,[r1,r4] ; write half word STREQH r6,[r1,r4] ; write half word
LDRNEH r0,[r1,r4] ; read half word LDRNEH r0,[r1,r4] ; read half word
MOVEQ r0,r6 MOVEQ r0,r6
10 POP {r1-r10,pc} ; restore registers and exit 10 Pull "r1-r10,pc" ; restore registers and exit
;r0=mode (-1=not ours) ;r0=mode (-1=not ours)
;--------------------------------------------- ;---------------------------------------------
;WriteMode ;WriteMode
...@@ -295,13 +295,13 @@ modecommon ...@@ -295,13 +295,13 @@ modecommon
Write_Mode Write_Mode
CMP r0,#i2c_flag-1 ;check if i2c gpio CMP r0,#i2c_flag-1 ;check if i2c gpio
BCS i2c_Write_Mode BCS i2c_Write_Mode
PUSH {r1-r10,lr} ; Push "r1-r10,lr" ;
MOV r6,r1 ; preserve data MOV r6,r1 ; preserve data
BL check_protect_i2c ; BL check_protect_i2c ;
MOV r5,#0 ; read/write flag MOV r5,#0 ; read/write flag
CMP r0,#-1 ; CMP r0,#-1 ;
BNE modecommon ; BNE modecommon ;
POP {r1-r10,pc} ; restore registers and exit Pull "r1-r10,pc" ; restore registers and exit
;r0=mode (-1=not ours) ;r0=mode (-1=not ours)
;--------------------------------------------- ;---------------------------------------------
;ReadLevel0 ;ReadLevel0
...@@ -309,7 +309,7 @@ Write_Mode ...@@ -309,7 +309,7 @@ Write_Mode
Read_Level0 Read_Level0
CMP r0,#i2c_flag-1 ;check if i2c gpio CMP r0,#i2c_flag-1 ;check if i2c gpio
BCS i2c_Read_Polarity BCS i2c_Read_Polarity
PUSH {r1-r10,lr} ; Push "r1-r10,lr" ;
MOV r7,#1 ; read/write flag MOV r7,#1 ; read/write flag
MOV r8,#proc_leveldetect0 ;register MOV r8,#proc_leveldetect0 ;register
;r5=read or write (1,0) ;r5=read or write (1,0)
...@@ -332,7 +332,7 @@ levelcommon ...@@ -332,7 +332,7 @@ levelcommon
AND r0,r4,r1 ; AND r0,r4,r1 ;
CMP r0,#0 ; CMP r0,#0 ;
MOVNE r0,#1 ; MOVNE r0,#1 ;
10 POP {r1-r10,pc} ; restore registers and exit 10 Pull "r1-r10,pc" ; restore registers and exit
;r0=mode ;r0=mode
;--------------------------------------------- ;---------------------------------------------
;WriteLevel0 ;WriteLevel0
...@@ -341,7 +341,7 @@ levelcommon ...@@ -341,7 +341,7 @@ levelcommon
Write_Level0 Write_Level0
CMP r0,#i2c_flag-1 ;check if i2c gpio CMP r0,#i2c_flag-1 ;check if i2c gpio
BCS i2c_Write_Polarity BCS i2c_Write_Polarity
PUSH {r1-r10,lr} ; Push "r1-r10,lr" ;
MOV r8,#proc_leveldetect0 ;register MOV r8,#proc_leveldetect0 ;register
write_register write_register
MOV r7,#0 ; read/write flag MOV r7,#0 ; read/write flag
...@@ -351,7 +351,7 @@ write_register ...@@ -351,7 +351,7 @@ write_register
BL check_protect_i2c ; BL check_protect_i2c ;
CMP r0,#-1 ; CMP r0,#-1 ;
BNE levelcommon ; BNE levelcommon ;
POP {r1-r10,pc} ; restore registers and exit Pull "r1-r10,pc" ; restore registers and exit
;r0=mode or -1 if protected ;r0=mode or -1 if protected
;preserves all others ;preserves all others
;--------------------------------------------- ;---------------------------------------------
...@@ -360,7 +360,7 @@ write_register ...@@ -360,7 +360,7 @@ write_register
Read_Level1 Read_Level1
CMP r0,#i2c_flag-1 ;check if i2c gpio CMP r0,#i2c_flag-1 ;check if i2c gpio
BCS i2c_Read_Pull BCS i2c_Read_Pull
PUSH {r1-r10,lr} ; Push "r1-r10,lr" ;
MOV r7,#1 ; read/write flag MOV r7,#1 ; read/write flag
MOV r8,#proc_leveldetect1 ;register MOV r8,#proc_leveldetect1 ;register
B levelcommon ; B levelcommon ;
...@@ -371,14 +371,14 @@ Read_Level1 ...@@ -371,14 +371,14 @@ Read_Level1
Write_Level1 Write_Level1
CMP r0,#i2c_flag-1 ;check if i2c gpio CMP r0,#i2c_flag-1 ;check if i2c gpio
BCS i2c_Write_Pull BCS i2c_Write_Pull
PUSH {r1-r10,lr} ; Push "r1-r10,lr" ;
MOV r8,#proc_leveldetect1 ;register MOV r8,#proc_leveldetect1 ;register
B write_register ; B write_register ;
;--------------------------------------------- ;---------------------------------------------
;ReadRising ;ReadRising
;r0=GPIO number ;r0=GPIO number
Read_Rising Read_Rising
PUSH {r1-r10,lr} ; Push "r1-r10,lr" ;
MOV r7,#1 ; read/write flag MOV r7,#1 ; read/write flag
MOV r8,#proc_risingdetect ;register MOV r8,#proc_risingdetect ;register
B levelcommon ; B levelcommon ;
...@@ -387,14 +387,14 @@ Read_Rising ...@@ -387,14 +387,14 @@ Read_Rising
;r0=GPIO number ;r0=GPIO number
;r1=0/1 ;r1=0/1
Write_Rising Write_Rising
PUSH {r1-r10,lr} ; Push "r1-r10,lr" ;
MOV r8,#proc_risingdetect ;register MOV r8,#proc_risingdetect ;register
B write_register ; B write_register ;
;--------------------------------------------- ;---------------------------------------------
;ReadFallin ;ReadFallin
;r0=GPIO number ;r0=GPIO number
Read_Falling Read_Falling
PUSH {r1-r10,lr} ; Push "r1-r10,lr" ;
MOV r7,#1 ; read/write flag MOV r7,#1 ; read/write flag
MOV r8,#proc_fallingdetect ;register MOV r8,#proc_fallingdetect ;register
B levelcommon ; B levelcommon ;
...@@ -403,14 +403,14 @@ Read_Falling ...@@ -403,14 +403,14 @@ Read_Falling
;r0=GPIO number ;r0=GPIO number
;r1=0/1 ;r1=0/1
Write_Falling Write_Falling
PUSH {r1-r10,lr} ; Push "r1-r10,lr" ;
MOV r8,#proc_fallingdetect ;register MOV r8,#proc_fallingdetect ;register
B write_register ; B write_register ;
;--------------------------------------------- ;---------------------------------------------
;ReadDebounceEnable ;ReadDebounceEnable
;r0=GPIO number ;r0=GPIO number
Read_DebounceEnable Read_DebounceEnable
PUSH {r1-r10,lr} ; Push "r1-r10,lr" ;
MOV r7,#1 ; read/write flag MOV r7,#1 ; read/write flag
MOV r8,#proc_debounceenable ;register MOV r8,#proc_debounceenable ;register
B levelcommon ; B levelcommon ;
...@@ -419,14 +419,14 @@ Read_DebounceEnable ...@@ -419,14 +419,14 @@ Read_DebounceEnable
;r0=GPIO number ;r0=GPIO number
;r1=0/1 ;r1=0/1
Write_DebounceEnable Write_DebounceEnable
PUSH {r1-r10,lr} ; Push "r1-r10,lr" ;
MOV r8,#proc_debounceenable ;register MOV r8,#proc_debounceenable ;register
B write_register ; B write_register ;
;--------------------------------------------- ;---------------------------------------------
;ReadIRQ1 ;ReadIRQ1
;r0=GPIO number ;r0=GPIO number
Read_IRQ1 Read_IRQ1
PUSH {r1-r10,lr} ; Push "r1-r10,lr" ;
MOV r7,#1 ; read/write flag MOV r7,#1 ; read/write flag
MOV r8,#proc_irqstatus1 ; MOV r8,#proc_irqstatus1 ;
B levelcommon ; B levelcommon ;
...@@ -435,7 +435,7 @@ Read_IRQ1 ...@@ -435,7 +435,7 @@ Read_IRQ1
;r0=GPIO number ;r0=GPIO number
;r1=0/1 ;r1=0/1
Write_IRQ1 Write_IRQ1
PUSH {r1-r10,lr} ; Push "r1-r10,lr" ;
MOV r7,r1 ; MOV r7,r1 ;
BL check_protect_i2c ; BL check_protect_i2c ;
CMP r0,#-1 ; CMP r0,#-1 ;
...@@ -455,14 +455,14 @@ irqcommon ...@@ -455,14 +455,14 @@ irqcommon
STRNE r1,[r0,r5] ;set irq bit STRNE r1,[r0,r5] ;set irq bit
STREQ r1,[r0,r4] ;unset irq bit STREQ r1,[r0,r4] ;unset irq bit
MOV r0,#0 ; MOV r0,#0 ;
10 POP {r1-r10,pc} ; restore registers and exit 10 Pull "r1-r10,pc" ; restore registers and exit
;r0=0 if ok -1 if protected ;r0=0 if ok -1 if protected
;preserves all others ;preserves all others
;--------------------------------------------- ;---------------------------------------------
;ReadIRQ2 ;ReadIRQ2
;r0=GPIO number ;r0=GPIO number
Read_IRQ2 Read_IRQ2
PUSH {r1-r10,lr} ; Push "r1-r10,lr" ;
MOV r7,#1 ; read/write flag MOV r7,#1 ; read/write flag
MOV r8,#proc_irqstatus2 ; MOV r8,#proc_irqstatus2 ;
B levelcommon ; B levelcommon ;
...@@ -471,7 +471,7 @@ Read_IRQ2 ...@@ -471,7 +471,7 @@ Read_IRQ2
;r0=GPIO number ;r0=GPIO number
;r1=0/1 ;r1=0/1
Write_IRQ2 Write_IRQ2
PUSH {r1-r10,lr} ; Push "r1-r10,lr" ;
MOV r7,r1 ; MOV r7,r1 ;
BL check_protect_i2c ; BL check_protect_i2c ;
BEQ %FT10 ; BEQ %FT10 ;
...@@ -484,7 +484,7 @@ Write_IRQ2 ...@@ -484,7 +484,7 @@ Write_IRQ2
LDRH r5,[r2,#proc_setirqenable2] ; LDRH r5,[r2,#proc_setirqenable2] ;
LDRH r4,[r2,#proc_clearirqenable2] ; LDRH r4,[r2,#proc_clearirqenable2] ;
B irqcommon B irqcommon
10 POP {r1-r10,pc} ; restore registers and exit 10 Pull "r1-r10,pc" ; restore registers and exit
;r0=0 if ok -1 if protected ;r0=0 if ok -1 if protected
;preserves all others ;preserves all others
;--------------------------------------------- ;---------------------------------------------
...@@ -492,7 +492,7 @@ Write_IRQ2 ...@@ -492,7 +492,7 @@ Write_IRQ2
Read_Exp_32 Read_Exp_32
CMP r0,#i2c_flag-1 ;check if i2c gpio