
_InitMain:

;MyProject.c,2 :: 		void InitMain() {
;MyProject.c,3 :: 		ANSEL  = 0;                         // Configure AN pins as digital
	CLRF       ANSEL+0
;MyProject.c,4 :: 		ANSELH = 0;  C1ON_bit = 0;                       // Disable comparators
	CLRF       ANSELH+0
	BCF        C1ON_bit+0, 7
;MyProject.c,5 :: 		C2ON_bit = 0;    PORTA = 255;
	BCF        C2ON_bit+0, 7
	MOVLW      255
	MOVWF      PORTA+0
;MyProject.c,6 :: 		TRISA = 255;                        // configure PORTA pins as input
	MOVLW      255
	MOVWF      TRISA+0
;MyProject.c,7 :: 		PORTB = 0;                          // set PORTB to 0
	CLRF       PORTB+0
;MyProject.c,8 :: 		TRISB = 0;                          // designate PORTB pins as output
	CLRF       TRISB+0
;MyProject.c,9 :: 		PORTC = 0;                          // set PORTC to 0
	CLRF       PORTC+0
;MyProject.c,10 :: 		TRISC = 0;                          // designate PORTC pins as output
	CLRF       TRISC+0
;MyProject.c,11 :: 		PWM1_Init(5000);                    // Initialize PWM1 module at 5KHz
	BCF        T2CON+0, 0
	BCF        T2CON+0, 1
	MOVLW      199
	MOVWF      PR2+0
	CALL       _PWM1_Init+0
;MyProject.c,12 :: 		PWM2_Init(5000);                    // Initialize PWM2 module at 5KHz}
	BCF        T2CON+0, 0
	BCF        T2CON+0, 1
	MOVLW      199
	MOVWF      PR2+0
	CALL       _PWM2_Init+0
;MyProject.c,14 :: 		initMain();
	CALL       _InitMain+0
;MyProject.c,15 :: 		current_duty  = 16;                 // initial value for current_duty
	MOVLW      16
	MOVWF      _current_duty+0
;MyProject.c,16 :: 		current_duty1 = 16;                 // initial value for current_duty1
	MOVLW      16
	MOVWF      _current_duty1+0
;MyProject.c,17 :: 		PWM1_Start();                       // start PWM1
	CALL       _PWM1_Start+0
;MyProject.c,18 :: 		PWM2_Start();                       // start PWM2
	CALL       _PWM2_Start+0
;MyProject.c,19 :: 		PWM1_Set_Duty(current_duty);        // Set current duty for PWM1
	MOVF       _current_duty+0, 0
	MOVWF      FARG_PWM1_Set_Duty_new_duty+0
	CALL       _PWM1_Set_Duty+0
;MyProject.c,20 :: 		PWM2_Set_Duty(current_duty1);       // Set current duty for PWM2
	MOVF       _current_duty1+0, 0
	MOVWF      FARG_PWM2_Set_Duty_new_duty+0
	CALL       _PWM2_Set_Duty+0
;MyProject.c,21 :: 		while (1) {                         // endless loop
L_InitMain0:
;MyProject.c,22 :: 		if (RA0_bit) {                    // button on RA0 pressed
	BTFSS      RA0_bit+0, 0
	GOTO       L_InitMain2
;MyProject.c,23 :: 		Delay_ms(40);
	MOVLW      52
	MOVWF      R12+0
	MOVLW      241
	MOVWF      R13+0
L_InitMain3:
	DECFSZ     R13+0, 1
	GOTO       L_InitMain3
	DECFSZ     R12+0, 1
	GOTO       L_InitMain3
	NOP
	NOP
;MyProject.c,24 :: 		current_duty++;                 // increment current_duty
	INCF       _current_duty+0, 1
;MyProject.c,25 :: 		PWM1_Set_Duty(current_duty);     }
	MOVF       _current_duty+0, 0
	MOVWF      FARG_PWM1_Set_Duty_new_duty+0
	CALL       _PWM1_Set_Duty+0
L_InitMain2:
;MyProject.c,26 :: 		if (RA1_bit) {                    // button on RA1 pressed
	BTFSS      RA1_bit+0, 1
	GOTO       L_InitMain4
;MyProject.c,27 :: 		Delay_ms(40);
	MOVLW      52
	MOVWF      R12+0
	MOVLW      241
	MOVWF      R13+0
L_InitMain5:
	DECFSZ     R13+0, 1
	GOTO       L_InitMain5
	DECFSZ     R12+0, 1
	GOTO       L_InitMain5
	NOP
	NOP
;MyProject.c,28 :: 		current_duty--;                 // decrement current_duty
	DECF       _current_duty+0, 1
;MyProject.c,29 :: 		PWM1_Set_Duty(current_duty);     }
	MOVF       _current_duty+0, 0
	MOVWF      FARG_PWM1_Set_Duty_new_duty+0
	CALL       _PWM1_Set_Duty+0
L_InitMain4:
;MyProject.c,30 :: 		if (RA2_bit) {                    // button on RA2 pressed
	BTFSS      RA2_bit+0, 2
	GOTO       L_InitMain6
;MyProject.c,31 :: 		Delay_ms(40);
	MOVLW      52
	MOVWF      R12+0
	MOVLW      241
	MOVWF      R13+0
L_InitMain7:
	DECFSZ     R13+0, 1
	GOTO       L_InitMain7
	DECFSZ     R12+0, 1
	GOTO       L_InitMain7
	NOP
	NOP
;MyProject.c,32 :: 		current_duty1++;                // increment current_duty1
	INCF       _current_duty1+0, 1
;MyProject.c,33 :: 		PWM2_Set_Duty(current_duty1);     }
	MOVF       _current_duty1+0, 0
	MOVWF      FARG_PWM2_Set_Duty_new_duty+0
	CALL       _PWM2_Set_Duty+0
L_InitMain6:
;MyProject.c,34 :: 		if (RA3_bit) {                    // button on RA3 pressed
	BTFSS      RA3_bit+0, 3
	GOTO       L_InitMain8
;MyProject.c,35 :: 		Delay_ms(40);
	MOVLW      52
	MOVWF      R12+0
	MOVLW      241
	MOVWF      R13+0
L_InitMain9:
	DECFSZ     R13+0, 1
	GOTO       L_InitMain9
	DECFSZ     R12+0, 1
	GOTO       L_InitMain9
	NOP
	NOP
;MyProject.c,36 :: 		current_duty1--;                // decrement current_duty1
	DECF       _current_duty1+0, 1
;MyProject.c,37 :: 		PWM2_Set_Duty(current_duty1);     }
	MOVF       _current_duty1+0, 0
	MOVWF      FARG_PWM2_Set_Duty_new_duty+0
	CALL       _PWM2_Set_Duty+0
L_InitMain8:
;MyProject.c,38 :: 		Delay_ms(5);                      // slow down change pace a little  }}
	MOVLW      7
	MOVWF      R12+0
	MOVLW      125
	MOVWF      R13+0
L_InitMain10:
	DECFSZ     R13+0, 1
	GOTO       L_InitMain10
	DECFSZ     R12+0, 1
	GOTO       L_InitMain10
;MyProject.c,39 :: 		}  }
	GOTO       L_InitMain0
L_end_InitMain:
	RETURN
; end of _InitMain
