I have a piece of code which does PWM on Consecutive outputs PORTC.0-4. However the code seems quite long (taking up unnecessary code space on the PIC). I'm sure it can be shortened, but a little unsure how as each of the variables (LED Colours) have been defined. I need to leave the other bits (getout) in which relate to an interupt routine. Can it be shortened ?

Many thanks,

Red VAR PORTC.0 ' All LEDs
Green VAR PORTC.1 ' Connected between
Blue VAR PORTC.2 ' RC pins and ground
UV VAR PORTC.3 ' via resistor
White VAR PORTC.4 '

Bright VAR byte
getout VAR byte

FadeAll:
'FadeRED
Low White
bright = 0
while (Bright !=255) and (GetOut=0)
PWM Red,Bright,3
bright = bright + 1
wend
while (bright !=0) and (getout = 0)
PWM Red,Bright,3
bright=bright - 1
wend
'FadeGreen
bright = 0
while (Bright !=255) and (GetOut=0)
PWM Green,Bright,3
bright = bright + 1
wend
while (bright !=0) and (getout = 0)
PWM Green,Bright,3
bright=bright - 1
wend
'FadeBlue
bright = 0
while (Bright !=255) and (GetOut=0)
PWM Blue,Bright,3
bright = bright + 1
wend
while (bright !=0) and (getout = 0)
PWM Blue,Bright,3
bright=bright - 1
wend
'FadeUV:
bright = 0
while (Bright !=255) and (GetOut=0)
PWM UV,Bright,3
bright = bright + 1
wend
while (bright !=0) and (getout = 0)
PWM UV,Bright,3
bright=bright - 1
wend
'FadeWhite:
bright = 0
while (Bright !=255) and (GetOut=0)
PWM White,Bright,3
bright = bright + 1
wend
while (bright !=0) and (getout = 0)
PWM White,Bright,3
bright=bright - 1
wend
return