	.file "X:\\707976_EPBuoyPrototypeAndTesting\\dsPicCodes\\powerconverter\\PowerConverter.X\\PIDGainScaling.c"
	.section	.debug_abbrev,info
.Ldebug_abbrev0:
	.section	.debug_info,info
.Ldebug_info0:
	.section	.debug_line,info
.Ldebug_line0:
	.section	.text,code
.Ltext0:
	.section	.text,code
	.align	2
	.global	_ScaleGainsAndLimitOutput	; export
	.type	_ScaleGainsAndLimitOutput,@function
_ScaleGainsAndLimitOutput:
.LFB19:
	.file 1 "PIDGainScaling.c"
	.loc 1 30 0
	.set ___PA___,1
	lnk	#10
.LCFI0:
	add	w14,#6,w2
	mov	w0,[w2]
	add	w14,#8,w0
	mov	w1,[w0]
	.loc 1 50 0
	add	w14,#8,w0
	mov	[w0],w0
	mov	[w0],w0
	cp0	w0
	.set ___BP___,0
	bra	le,.L2
.LBB2:
	.loc 1 54 0
	add	w14,#8,w0
	mov	[w0],w0
	mov	[w0],w0
	mov	w0,w1
	mov	#32767,w0
	rcall	__Q15shr
	mov	w0,w1
	inc2	w14,w0
	mov	w1,[w0]
	.loc 1 55 0
	inc2	w14,w0
	mov	[w0],w0
	rcall	__Q15neg
	mov	w0,w1
	add	w14,#4,w0
	mov	w1,[w0]
	.loc 1 56 0
	add	w14,#6,w0
	mov	[w0],w0
	add	w0,#4,w0
	mov	[w0],w1
	inc2	w14,w0
	mov	[w0],w0
	sub	w1,w0,[w15]
	.set ___BP___,0
	bra	lt,.L3
	.loc 1 57 0
	add	w14,#6,w0
	mov	[w0],w0
	add	w0,#4,w0
	inc2	w14,w1
	mov	[w1],[w0]
	.loc 1 58 0
	mov	#32767,w0
	mov	w0,[w14]
	bra	.L4
.L3:
	.loc 1 59 0
	add	w14,#6,w0
	mov	[w0],w0
	add	w0,#4,w0
	mov	[w0],w1
	add	w14,#4,w0
	mov	[w0],w0
	sub	w1,w0,[w15]
	.set ___BP___,0
	bra	gt,.L5
	.loc 1 60 0
	add	w14,#6,w0
	mov	[w0],w0
	add	w0,#4,w0
	add	w14,#4,w1
	mov	[w1],[w0]
	.loc 1 61 0
	mov	#-32768,w0
	mov	w0,[w14]
	bra	.L4
.L5:
	.loc 1 63 0
	add	w14,#8,w0
	mov	[w0],w0
	mov	[w0],w1
	add	w14,#6,w0
	mov	[w0],w0
	add	w0,#4,w0
	mov	[w0],w0
	rcall	__Q15shl
	mov	w0,[w14]
	bra	.L4
.L2:
.LBE2:
	.loc 1 66 0
	add	w14,#6,w0
	mov	[w0],w0
	add	w0,#4,w0
	mov	[w0],[w14]
.L4:
	.loc 1 70 0
	add	w14,#8,w0
	mov	[w0],w0
	inc2	w0,w0
	mov	[w0],w0
	sub	w0,[w14],[w15]
	.set ___BP___,0
	bra	le,.L6
	.loc 1 72 0
	add	w14,#8,w0
	mov	[w0],w0
	mov	#1,w1
	add	w0,#6,w0
	mov	w1,[w0]
	.loc 1 73 0
	add	w14,#6,w0
	mov	[w0],w0
	rcall	_PIDInit
	.loc 1 74 0
	add	w14,#8,w0
	mov	[w0],w0
	inc2	w0,w0
	mov	[w0],[w14]
	.loc 1 75 0
	add	w14,#8,w0
	mov	[w0],w0
	mov	[w0],w0
	cp0	w0
	.set ___BP___,0
	bra	le,.L7
	.loc 1 76 0
	add	w14,#8,w0
	mov	[w0],w0
	mov	[w0],w1
	add	w14,#8,w0
	mov	[w0],w0
	inc2	w0,w0
	mov	[w0],w0
	rcall	__Q15shr
	mov	w0,w1
	add	w14,#6,w0
	mov	[w0],w0
	add	w0,#4,w0
	mov	w1,[w0]
	bra	.L8
.L7:
	.loc 1 78 0
	add	w14,#8,w0
	mov	[w0],w0
	inc2	w0,w0
	mov	[w0],w1
	add	w14,#6,w0
	mov	[w0],w0
	add	w0,#4,w0
	mov	w1,[w0]
	bra	.L8
.L6:
	.loc 1 82 0
	add	w14,#8,w0
	mov	[w0],w0
	clr	w1
	add	w0,#6,w0
	mov	w1,[w0]
.L8:
	.loc 1 85 0
	add	w14,#8,w0
	mov	[w0],w0
	add	w0,#4,w0
	mov	[w0],w0
	sub	w0,[w14],[w15]
	.set ___BP___,0
	bra	ge,.L9
	.loc 1 87 0
	add	w14,#8,w0
	mov	[w0],w0
	mov	#1,w1
	add	w0,#8,w0
	mov	w1,[w0]
	.loc 1 88 0
	add	w14,#6,w0
	mov	[w0],w0
	rcall	_PIDInit
	.loc 1 89 0
	add	w14,#8,w0
	mov	[w0],w0
	add	w0,#4,w0
	mov	[w0],[w14]
	.loc 1 90 0
	add	w14,#8,w0
	mov	[w0],w0
	mov	[w0],w0
	cp0	w0
	.set ___BP___,0
	bra	le,.L10
	.loc 1 91 0
	add	w14,#8,w0
	mov	[w0],w0
	mov	[w0],w1
	add	w14,#8,w0
	mov	[w0],w0
	add	w0,#4,w0
	mov	[w0],w0
	rcall	__Q15shr
	mov	w0,w1
	add	w14,#6,w0
	mov	[w0],w0
	add	w0,#4,w0
	mov	w1,[w0]
	bra	.L11
.L10:
	.loc 1 93 0
	add	w14,#8,w0
	mov	[w0],w0
	add	w0,#4,w0
	mov	[w0],w1
	add	w14,#6,w0
	mov	[w0],w0
	add	w0,#4,w0
	mov	w1,[w0]
	bra	.L11
.L9:
	.loc 1 96 0
	add	w14,#8,w0
	mov	[w0],w0
	clr	w1
	add	w0,#8,w0
	mov	w1,[w0]
.L11:
	.loc 1 99 0
	mov	[w14],w0
	.loc 1 100 0
	ulnk	
	return	
	.set ___PA___,0
.LFE19:
	.size	_ScaleGainsAndLimitOutput, .-_ScaleGainsAndLimitOutput
	.section	.debug_frame,info
.Lframe0:
	.4byte	.LECIE0-.LSCIE0
.LSCIE0:
	.4byte	0xffffffff
	.byte	0x1
	.byte	0
	.uleb128 0x1
	.sleb128 2
	.byte	0x25
	.byte	0x12
	.uleb128 0xf
	.sleb128 -2
	.byte	0x9
	.uleb128 0x25
	.uleb128 0xf
	.align	4
.LECIE0:
.LSFDE0:
	.4byte	.LEFDE0-.LASFDE0
.LASFDE0:
	.4byte	.Lframe0
	.4byte	.LFB19
	.4byte	.LFE19-.LFB19
	.byte	0x4
	.4byte	.LCFI0-.LFB19
	.byte	0x12
	.uleb128 0xe
	.sleb128 -3
	.byte	0x8e
	.uleb128 0x2
	.align	4
.LEFDE0:
	.section	.text,code
.Letext0:
	.file 2 "c:\\program files\\microchip\\xc16\\v2.00\\bin\\bin\\../..\\support\\generic\\h/dsp.h"
	.file 3 "types.h"
	.section	.debug_info,info
	.4byte	0x381
	.2byte	0x2
	.4byte	.Ldebug_abbrev0
	.byte	0x4
	.uleb128 0x1
	.asciz	"GNU C 4.5.1 (XC16, Microchip v2.00) (A) Build date: Jan 24 2022"
	.byte	0x1
	.asciz	"PIDGainScaling.c"
	.ascii	"X:\\707976_EPBuoyPrototypeAndTesting\\dsPicCodes\\powerconverter\\Po"
	.asciz	"werConverter.X"
	.4byte	.Ltext0
	.4byte	.Letext0
	.4byte	.Ldebug_line0
	.uleb128 0x2
	.byte	0x2
	.byte	0x7
	.asciz	"short unsigned int"
	.uleb128 0x2
	.byte	0x2
	.byte	0x7
	.asciz	"unsigned int"
	.uleb128 0x2
	.byte	0x2
	.byte	0x5
	.asciz	"int"
	.uleb128 0x2
	.byte	0x4
	.byte	0x5
	.asciz	"long int"
	.uleb128 0x2
	.byte	0x8
	.byte	0x5
	.asciz	"long long int"
	.uleb128 0x2
	.byte	0x1
	.byte	0x6
	.asciz	"signed char"
	.uleb128 0x2
	.byte	0x1
	.byte	0x8
	.asciz	"unsigned char"
	.uleb128 0x2
	.byte	0x4
	.byte	0x7
	.asciz	"long unsigned int"
	.uleb128 0x2
	.byte	0x8
	.byte	0x7
	.asciz	"long long unsigned int"
	.uleb128 0x2
	.byte	0x4
	.byte	0x4
	.asciz	"float"
	.uleb128 0x2
	.byte	0x4
	.byte	0x4
	.asciz	"double"
	.uleb128 0x2
	.byte	0x2
	.byte	0x5
	.asciz	"short int"
	.uleb128 0x3
	.asciz	"fractional"
	.byte	0x2
	.byte	0x5c
	.4byte	0xdf
	.uleb128 0x4
	.byte	0x2
	.4byte	0x172
	.uleb128 0x5
	.byte	0xa
	.byte	0x2
	.2byte	0x773
	.4byte	0x218
	.uleb128 0x6
	.asciz	"abcCoefficients"
	.byte	0x2
	.2byte	0x774
	.4byte	0x184
	.byte	0x2
	.byte	0x23
	.uleb128 0x0
	.uleb128 0x6
	.asciz	"controlHistory"
	.byte	0x2
	.2byte	0x777
	.4byte	0x184
	.byte	0x2
	.byte	0x23
	.uleb128 0x2
	.uleb128 0x6
	.asciz	"controlOutput"
	.byte	0x2
	.2byte	0x779
	.4byte	0x172
	.byte	0x2
	.byte	0x23
	.uleb128 0x4
	.uleb128 0x6
	.asciz	"measuredOutput"
	.byte	0x2
	.2byte	0x77a
	.4byte	0x172
	.byte	0x2
	.byte	0x23
	.uleb128 0x6
	.uleb128 0x6
	.asciz	"controlReference"
	.byte	0x2
	.2byte	0x77b
	.4byte	0x172
	.byte	0x2
	.byte	0x23
	.uleb128 0x8
	.byte	0x0
	.uleb128 0x7
	.asciz	"tPID"
	.byte	0x2
	.2byte	0x77c
	.4byte	0x18a
	.uleb128 0x8
	.asciz	"tagGainScalingAndLimits"
	.byte	0xa
	.byte	0x3
	.byte	0x4e
	.4byte	0x2d0
	.uleb128 0x9
	.asciz	"GainScaleFactor"
	.byte	0x3
	.byte	0x4f
	.4byte	0xdf
	.byte	0x2
	.byte	0x23
	.uleb128 0x0
	.uleb128 0x9
	.asciz	"LowerActuatorLimit"
	.byte	0x3
	.byte	0x50
	.4byte	0x172
	.byte	0x2
	.byte	0x23
	.uleb128 0x2
	.uleb128 0x9
	.asciz	"UpperActuatorLimit"
	.byte	0x3
	.byte	0x51
	.4byte	0x172
	.byte	0x2
	.byte	0x23
	.uleb128 0x4
	.uleb128 0x9
	.asciz	"LowerLimitActive"
	.byte	0x3
	.byte	0x52
	.4byte	0xdf
	.byte	0x2
	.byte	0x23
	.uleb128 0x6
	.uleb128 0x9
	.asciz	"UpperLimitActive"
	.byte	0x3
	.byte	0x53
	.4byte	0xdf
	.byte	0x2
	.byte	0x23
	.uleb128 0x8
	.byte	0x0
	.uleb128 0x3
	.asciz	"tGSAL"
	.byte	0x3
	.byte	0x54
	.4byte	0x225
	.uleb128 0xa
	.byte	0x1
	.asciz	"ScaleGainsAndLimitOutput"
	.byte	0x1
	.byte	0x1d
	.byte	0x1
	.4byte	0x172
	.4byte	.LFB19
	.4byte	.LFE19
	.byte	0x1
	.byte	0x5e
	.4byte	0x378
	.uleb128 0xb
	.asciz	"PID"
	.byte	0x1
	.byte	0x1d
	.4byte	0x378
	.byte	0x2
	.byte	0x7e
	.sleb128 6
	.uleb128 0xb
	.asciz	"GSAL"
	.byte	0x1
	.byte	0x1d
	.4byte	0x37e
	.byte	0x2
	.byte	0x7e
	.sleb128 8
	.uleb128 0xc
	.asciz	"ControllerOutput"
	.byte	0x1
	.byte	0x20
	.4byte	0x172
	.byte	0x2
	.byte	0x7e
	.sleb128 0
	.uleb128 0xd
	.4byte	.LBB2
	.4byte	.LBE2
	.uleb128 0xc
	.asciz	"upper_lim"
	.byte	0x1
	.byte	0x34
	.4byte	0xdf
	.byte	0x2
	.byte	0x7e
	.sleb128 2
	.uleb128 0xc
	.asciz	"lower_lim"
	.byte	0x1
	.byte	0x35
	.4byte	0xdf
	.byte	0x2
	.byte	0x7e
	.sleb128 4
	.byte	0x0
	.byte	0x0
	.uleb128 0x4
	.byte	0x2
	.4byte	0x218
	.uleb128 0x4
	.byte	0x2
	.4byte	0x2d0
	.byte	0x0
	.section	.debug_abbrev,info
	.uleb128 0x1
	.uleb128 0x11
	.byte	0x1
	.uleb128 0x25
	.uleb128 0x8
	.uleb128 0x13
	.uleb128 0xb
	.uleb128 0x3
	.uleb128 0x8
	.uleb128 0x1b
	.uleb128 0x8
	.uleb128 0x11
	.uleb128 0x1
	.uleb128 0x12
	.uleb128 0x1
	.uleb128 0x10
	.uleb128 0x6
	.byte	0x0
	.byte	0x0
	.uleb128 0x2
	.uleb128 0x24
	.byte	0x0
	.uleb128 0xb
	.uleb128 0xb
	.uleb128 0x3e
	.uleb128 0xb
	.uleb128 0x3
	.uleb128 0x8
	.byte	0x0
	.byte	0x0
	.uleb128 0x3
	.uleb128 0x16
	.byte	0x0
	.uleb128 0x3
	.uleb128 0x8
	.uleb128 0x3a
	.uleb128 0xb
	.uleb128 0x3b
	.uleb128 0xb
	.uleb128 0x49
	.uleb128 0x13
	.byte	0x0
	.byte	0x0
	.uleb128 0x4
	.uleb128 0xf
	.byte	0x0
	.uleb128 0xb
	.uleb128 0xb
	.uleb128 0x49
	.uleb128 0x13
	.byte	0x0
	.byte	0x0
	.uleb128 0x5
	.uleb128 0x13
	.byte	0x1
	.uleb128 0xb
	.uleb128 0xb
	.uleb128 0x3a
	.uleb128 0xb
	.uleb128 0x3b
	.uleb128 0x5
	.uleb128 0x1
	.uleb128 0x13
	.byte	0x0
	.byte	0x0
	.uleb128 0x6
	.uleb128 0xd
	.byte	0x0
	.uleb128 0x3
	.uleb128 0x8
	.uleb128 0x3a
	.uleb128 0xb
	.uleb128 0x3b
	.uleb128 0x5
	.uleb128 0x49
	.uleb128 0x13
	.uleb128 0x38
	.uleb128 0xa
	.byte	0x0
	.byte	0x0
	.uleb128 0x7
	.uleb128 0x16
	.byte	0x0
	.uleb128 0x3
	.uleb128 0x8
	.uleb128 0x3a
	.uleb128 0xb
	.uleb128 0x3b
	.uleb128 0x5
	.uleb128 0x49
	.uleb128 0x13
	.byte	0x0
	.byte	0x0
	.uleb128 0x8
	.uleb128 0x13
	.byte	0x1
	.uleb128 0x3
	.uleb128 0x8
	.uleb128 0xb
	.uleb128 0xb
	.uleb128 0x3a
	.uleb128 0xb
	.uleb128 0x3b
	.uleb128 0xb
	.uleb128 0x1
	.uleb128 0x13
	.byte	0x0
	.byte	0x0
	.uleb128 0x9
	.uleb128 0xd
	.byte	0x0
	.uleb128 0x3
	.uleb128 0x8
	.uleb128 0x3a
	.uleb128 0xb
	.uleb128 0x3b
	.uleb128 0xb
	.uleb128 0x49
	.uleb128 0x13
	.uleb128 0x38
	.uleb128 0xa
	.byte	0x0
	.byte	0x0
	.uleb128 0xa
	.uleb128 0x2e
	.byte	0x1
	.uleb128 0x3f
	.uleb128 0xc
	.uleb128 0x3
	.uleb128 0x8
	.uleb128 0x3a
	.uleb128 0xb
	.uleb128 0x3b
	.uleb128 0xb
	.uleb128 0x27
	.uleb128 0xc
	.uleb128 0x49
	.uleb128 0x13
	.uleb128 0x11
	.uleb128 0x1
	.uleb128 0x12
	.uleb128 0x1
	.uleb128 0x40
	.uleb128 0xa
	.uleb128 0x1
	.uleb128 0x13
	.byte	0x0
	.byte	0x0
	.uleb128 0xb
	.uleb128 0x5
	.byte	0x0
	.uleb128 0x3
	.uleb128 0x8
	.uleb128 0x3a
	.uleb128 0xb
	.uleb128 0x3b
	.uleb128 0xb
	.uleb128 0x49
	.uleb128 0x13
	.uleb128 0x2
	.uleb128 0xa
	.byte	0x0
	.byte	0x0
	.uleb128 0xc
	.uleb128 0x34
	.byte	0x0
	.uleb128 0x3
	.uleb128 0x8
	.uleb128 0x3a
	.uleb128 0xb
	.uleb128 0x3b
	.uleb128 0xb
	.uleb128 0x49
	.uleb128 0x13
	.uleb128 0x2
	.uleb128 0xa
	.byte	0x0
	.byte	0x0
	.uleb128 0xd
	.uleb128 0xb
	.byte	0x1
	.uleb128 0x11
	.uleb128 0x1
	.uleb128 0x12
	.uleb128 0x1
	.byte	0x0
	.byte	0x0
	.byte	0x0
	.section	.debug_pubnames,info
	.4byte	0x2b
	.2byte	0x2
	.4byte	.Ldebug_info0
	.4byte	0x385
	.4byte	0x2dd
	.asciz	"ScaleGainsAndLimitOutput"
	.4byte	0x0
	.section	.debug_pubtypes,info
	.4byte	0x4c
	.2byte	0x2
	.4byte	.Ldebug_info0
	.4byte	0x385
	.4byte	0x172
	.asciz	"fractional"
	.4byte	0x218
	.asciz	"tPID"
	.4byte	0x225
	.asciz	"tagGainScalingAndLimits"
	.4byte	0x2d0
	.asciz	"tGSAL"
	.4byte	0x0
	.section	.debug_aranges,info
	.4byte	0x14
	.2byte	0x2
	.4byte	.Ldebug_info0
	.byte	0x4
	.byte	0x0
	.2byte	0x0
	.2byte	0x0
	.4byte	0x0
	.4byte	0x0
	.section	.debug_str,info
	.section	.text,code



	.section __c30_info, info, bss
__large_data_scalar:

	.section __c30_signature, info, data
	.word 0x0001
	.word 0x0006
	.word 0x0000

; MCHP configuration words

	.set ___PA___,0
	.end
