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

Restore workingness

The change to use macros for the "Pull" sequences hadn't spotted that several of them were on lines with numeric labels, and the $label term of the "Pull" macro copies that inside the macro, making it macro local. As there aren't any ROUT directives these were silently moved by objasm to whereever the nearest similar number label was - resulting in several non functional exits.
Also move the module flags word to not be immediately after the module header, per recommendation in case the header ever needs extending.
Syntax strings change in line with, for example, *TIME's.

Version 0.59. Tagged as 'GPIO-0_59'
parent f54f65e1
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "0.58"
Module_Version SETA 58
Module_MajorVersion SETS "0.59"
Module_Version SETA 59
Module_MinorVersion SETS ""
Module_Date SETS "09 Oct 2014"
Module_ApplicationDate SETS "09-Oct-14"
Module_Date SETS "13 Oct 2014"
Module_ApplicationDate SETS "13-Oct-14"
Module_ComponentName SETS "GPIO"
Module_ComponentPath SETS "bsd/RiscOS/Sources/ThirdParty/TankStage/HWSupport/GPIO"
Module_FullVersion SETS "0.58"
Module_HelpVersion SETS "0.58 (09 Oct 2014)"
Module_FullVersion SETS "0.59"
Module_HelpVersion SETS "0.59 (13 Oct 2014)"
END
/* (0.58)
/* (0.59)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.58
#define Module_MajorVersion_CMHG 0.59
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 09 Oct 2014
#define Module_Date_CMHG 13 Oct 2014
#define Module_MajorVersion "0.58"
#define Module_Version 58
#define Module_MajorVersion "0.59"
#define Module_Version 59
#define Module_MinorVersion ""
#define Module_Date "09 Oct 2014"
#define Module_Date "13 Oct 2014"
#define Module_ApplicationDate "09-Oct-14"
#define Module_ApplicationDate "13-Oct-14"
#define Module_ComponentName "GPIO"
#define Module_ComponentPath "bsd/RiscOS/Sources/ThirdParty/TankStage/HWSupport/GPIO"
#define Module_FullVersion "0.58"
#define Module_HelpVersion "0.58 (09 Oct 2014)"
#define Module_LibraryVersionInfo "0:58"
#define Module_FullVersion "0.59"
#define Module_HelpVersion "0.59 (13 Oct 2014)"
#define Module_LibraryVersionInfo "0:59"
......@@ -51,7 +51,8 @@ Read_Data
AND r0,r0,r1 ;mask just ours
CMP r0,#0 ;
MOVNE r0,#1 ;
10 Pull "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
;---------------------------------------------
......@@ -82,7 +83,8 @@ Write_Data
CMP r7,#0 ;check flag
STRNE r1,[r0,r4] ;set data bit
STREQ r1,[r0,r5] ;unset data bit
10 Pull "r2-r10,pc" ; restore registers and exit
10
Pull "r2-r10,pc" ; restore registers and exit
;r0= -1 if input , protected or not GPIO
;or
;r0=logical address
......@@ -105,7 +107,8 @@ Read_OE
AND r0,r0,r1 ;
CMP r0,#0 ;is it output ?
MOVNE r0,#1 ;opposite logic to match Pi
10 Pull "r1-r10,pc" ; restore registers and exit
10
Pull "r1-r10,pc" ; restore registers and exit
;r0=value (0=output,1=input)
;---------------------------------------------
......@@ -178,7 +181,8 @@ common1
MOV r1,#0 ;set output to off
BL Write_Data ;write data
B %BT10 ;next
20 Pull "r0-r10,pc" ; restore registers and exit
20
Pull "r0-r10,pc" ; restore registers and exit
;---------------------------------------------
; MapExpIn
;r0=mode
......@@ -207,7 +211,8 @@ safe CMP r6,#-1 ;
MOV r3,#safemode ;safe mode
MOV r7,#&FF ;skip OE write
B common1 ;
20 Pull "r0-r10,pc" ; restore registers and exit
20
Pull "r0-r10,pc" ; restore registers and exit
;---------------------------------------------
; SafeExpIn
Exp_As_Safe
......@@ -239,7 +244,8 @@ set_pins
MOV r1,r1,LSR #8 ;just mode
BL Write_Mode
B %BT10
20 Pull "r0-r10,pc" ; restore registers and exit
20
Pull "r0-r10,pc" ; restore registers and exit
;---------------------------------------------
;
Exp_As_UART
......@@ -286,7 +292,8 @@ modecommon
STREQH r6,[r1,r4] ; write half word
LDRNEH r0,[r1,r4] ; read half word
MOVEQ r0,r6
10 Pull "r1-r10,pc" ; restore registers and exit
10
Pull "r1-r10,pc" ; restore registers and exit
;r0=mode (-1=not ours)
;---------------------------------------------
;WriteMode
......@@ -332,7 +339,8 @@ levelcommon
AND r0,r4,r1 ;
CMP r0,#0 ;
MOVNE r0,#1 ;
10 Pull "r1-r10,pc" ; restore registers and exit
10
Pull "r1-r10,pc" ; restore registers and exit
;r0=mode
;---------------------------------------------
;WriteLevel0
......@@ -455,7 +463,8 @@ irqcommon
STRNE r1,[r0,r5] ;set irq bit
STREQ r1,[r0,r4] ;unset irq bit
MOV r0,#0 ;
10 Pull "r1-r10,pc" ; restore registers and exit
10
Pull "r1-r10,pc" ; restore registers and exit
;r0=0 if ok -1 if protected
;preserves all others
;---------------------------------------------
......@@ -484,7 +493,8 @@ Write_IRQ2
LDRH r5,[r2,#proc_setirqenable2] ;
LDRH r4,[r2,#proc_clearirqenable2] ;
B irqcommon
10 Pull "r1-r10,pc" ; restore registers and exit
10
Pull "r1-r10,pc" ; restore registers and exit
;r0=0 if ok -1 if protected
;preserves all others
;---------------------------------------------
......@@ -518,7 +528,8 @@ commonread32
AND r0,r3,r4 ;just our pins again
AND r0,r0,r5 ;just our pins
MOV r1,r5 ;give user the bitmask
10 Pull "r2-r10,pc" ; restore registers and exit
10
Pull "r2-r10,pc" ; restore registers and exit
;r0=data state
;r1=bitmask
;preserves all others
......@@ -579,7 +590,8 @@ common32
STRNE r3,[r0,r4] ;unset them
ANDS r4,r6,r7 ;just our pins
STRNE r4,[r0,r5] ;set them
10 Pull "r0-r10,pc" ; restore registers and exit
10
Pull "r0-r10,pc" ; restore registers and exit
;preserves all registers
exp_bitmap DCD expbitmap
;---------------------------------------------
......@@ -624,7 +636,8 @@ commonoeread32
LDR r0,[r0,r6] ;get register value
AND r0,r0,r5 ;just our pins
MOV r1,r5 ;give user bitmask
10 Pull "r2-r10,pc" ; restore registers and exit
10
Pull "r2-r10,pc" ; restore registers and exit
;r0=bitmask of OE register
;r1=bitmask
;preserves all others
......@@ -678,7 +691,8 @@ commonoe32
AND r2,r2,r3 ;clears all our outputs
ORR r1,r2,r4 ;set/unset our pins
STR r1,[r0,r5] ;
10 Pull "r0-r10,pc" ; restore registers and exit
10
Pull "r0-r10,pc" ; restore registers and exit
;preserves all registers
;---------------------------------------------
;writeauxoe32
......@@ -731,7 +745,8 @@ sramread
SUB r5,r5,#1 ;dec pointer
CMP r2,r0 ;last byte ?
BGE %BT20 ;
10 Pull "r0-r10,pc" ;
10
Pull "r0-r10,pc" ;
;---------------------------------------------
;sramwrite
;r0=pointer to sram to write
......@@ -753,7 +768,8 @@ sramwrite
SUB r5,r5,#1 ;dec pointer
CMP r2,r0 ;last byte ?
BGE %BT20 ;
10 Pull "r0-r10,pc" ;
10
Pull "r0-r10,pc" ;
;---------------------------------------------
;loadconfig
......@@ -821,7 +837,8 @@ Load_Config
MOV r0,r5 ;gpio number
BL Write_IRQ2 ;
B %BT10 ;
20 Pull "r0-r10,pc" ;
20
Pull "r0-r10,pc" ;
;preserves all registers
;---------------------------------------------
;readconfig
......
......@@ -51,10 +51,7 @@ Module_BaseAddr
DCD RM_SWInames -Module_BaseAddr
DCD 0
DCD 0 ; Messages filename
DCD RM_Flags -Module_BaseAddr ; 32 bit flag
RM_Flags
DCD 1 ; 32-bit compatible
DCD RM_Flags -Module_BaseAddr ; Flags
RM_Title
= "$Module_ComponentName", 0
......@@ -67,6 +64,9 @@ RM_HelpStr
ALIGN
RM_Flags
DCD ModuleFlag_32bit ; 32-bit compatible
;******************************************************************************
;
; RM_HC_Table - Help and command keyword table
......@@ -96,7 +96,7 @@ Map_Help
= "Use 'GPIOMap' to display memory that has been mapped in ",0
ALIGN
Map_Syntax
= "Syntax : GPIOMap",0
= "Syntax: *GPIOMap",0
ALIGN
Map_Code
Push "r0-r12,lr"
......@@ -235,7 +235,7 @@ Mach_Help
= "Use 'GPIOMachine' to display details of the machine we are running on ",0
ALIGN
Mach_Syntax
= "Syntax : GPIOMachine",0
= "Syntax: *GPIOMachine",0
ALIGN
Mach_Code
Push "r0-r12,lr"
......
......@@ -42,7 +42,8 @@ Pi_Read_Data
AND r0,r2,r1 ;
CMP r0,#0 ;
MOVNE r0,#1 ;
10 Pull "r1-r8,pc" ; restore registers and exit
10
Pull "r1-r8,pc" ; restore registers and exit
;r0=value (0 or 1) -1 if bad
;---------------------------------------------
;WriteData
......@@ -67,7 +68,8 @@ Pi_Write_Data
ADDEQ r0,r0,#pi_GPCLR0 ;
ADDNE r0,r0,#pi_GPSET0 ;
STR r1,[r0] ;set register
10 Pull "r2-r9,pc" ; restore registers and exit
10
Pull "r2-r9,pc" ; restore registers and exit
;r0= -1 if input , protected or not GPIO
;or
;r0=logical address of register used
......@@ -87,7 +89,8 @@ Pi_Read_OE
MOVEQ r0,#1 ;
CMP r2,#1 ;
MOVEQ r0,#0 ;
10 Pull "r1-r8,pc" ; restore registers and exit
10
Pull "r1-r8,pc" ; restore registers and exit
;r0=value (0=output,1=input,-1 aux function)
;---------------------------------------------
;WriteOE
......@@ -110,7 +113,8 @@ Pi_Write_OE
ORR r1,r1,r0 ;set mode bits
MOV r0,r9 ;
BL Pi_Write_Mode ;
10 Pull "r1-r9,pc" ; restore registers and exit
10
Pull "r1-r9,pc" ; restore registers and exit
;r0=0 if ok -1 if protected or not GPIO
;----------------------------------------------
; MapExpIn
......@@ -144,7 +148,8 @@ Pi_Exp_As_GPIO
MOV r1,#0 ;set output to off
BL Pi_Write_Data ;write data
B %BT10 ;next
20 Pull "r0-r10,pc" ; restore registers and exit
20
Pull "r0-r10,pc" ; restore registers and exit
;---------------------------------------------
Pi_Exp_As_UART
......@@ -159,7 +164,8 @@ expasin
AND r0,r0,#&FF ;just gpio
BL Pi_Write_Mode ;
B %BT10 ;
20 Pull "r0-r7,pc" ; restore registers and exit
20
Pull "r0-r7,pc" ; restore registers and exit
;---------------------------------------------
;actually exp as SPIO
Pi_Exp_As_MMC
......@@ -239,7 +245,8 @@ Pi_Write_Mode
STR r4,[r7] ;
SWI XOS_IntOn
MOV r0,#0 ;
10 Pull "r1-r10,pc" ; restore registers and exit
10
Pull "r1-r10,pc" ; restore registers and exit
;r0=0 if OK -1 if protected
delay
......@@ -494,7 +501,8 @@ Pi_Write_Exp_32
BLCS Pi_Write_Data ;
ADD r5,r5,#1 ;
B %BT10 ;
20 Pull "r0-r8,pc" ; restore registers and exit
20
Pull "r0-r8,pc" ; restore registers and exit
;preserves all registers
;---------------------------------------------
......@@ -554,7 +562,8 @@ Pi_Write_Exp_OE_32
BLCS Pi_Write_OE ;
ADD r5,r5,#1 ;
B %BT10 ;
20 Pull "r0-r8,pc" ; restore registers and exit
20
Pull "r0-r8,pc" ; restore registers and exit
;preserves all registers
;---------------------------------------------
;readaux32
......@@ -702,7 +711,8 @@ Pi_Load_Config
B %BT10 ;get next
20 Pull "r0-r10,pc" ;
20
Pull "r0-r10,pc" ;
;---------------------------------------------
;readconfig
;r0 pointer for list or -1 for my space
......
......@@ -68,7 +68,8 @@ find_register
LDRH r0,[r4,r3] ;get register
CMP r0,#0 ;protected ?
20 MOVEQ r0,#-1 ;
10 Pull "r1-r4,pc" ;
10
Pull "r1-r4,pc" ;
;r0=physical address or -1
;preserves all others
;-----------------------------------------------------------------------------
......
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