Subversion Repositories Code-Repo

Rev

Rev 113 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 113 Rev 114
Line 31... Line 31...
31
 
31
 
32
void pwm_IR_stop() {
32
void pwm_IR_stop() {
33
    ClosePWM1();
33
    ClosePWM1();
34
}
34
}
35
 
35
 
36
void pwm_LED_start() {
36
void pwm_LED_on() {
37
    OpenPWM2(0xFF);     // Full period from timer
37
    OpenPWM2(0xFF);     // Full period from timer
38
    SetDCPWM2(0x80);    // 50% duty cycle
38
    SetDCPWM2(0x80);    // 50% duty cycle
39
    PSTR2CONbits.STRA = 1;  // Enable output channel A
39
    PSTR2CONbits.STRA = 1;  // Enable output channel A
-
 
40
    PWM_LED_STATE = 1;
40
}
41
}
41
 
42
 
42
void pwm_LED_stop() {
43
void pwm_LED_off() {
43
    ClosePWM2();
44
    ClosePWM2();
-
 
45
    PWM_LED_STATE = 0;
-
 
46
}
-
 
47
 
-
 
48
void pwm_LED_toggle() {
-
 
49
    if (PWM_LED_STATE) {
-
 
50
        pwm_LED_off();
-
 
51
    } else {
-
 
52
        pwm_LED_on();
-
 
53
    }
44
}
54
}
45
55