Пример #1
0
void _pwmDutyValue( uint8_t chn, uint16_t value)
{
    switch(chn) {
        case 0: PWM1_DutyValueSet( value); break;
        case 1: PWM2_DutyValueSet( value); break;
        case 2: PWM3_DutyValueSet( value); break;
        case 3: PWM4_DutyValueSet( value); break;
        case 4: PWM5_DutyValueSet( value); break;
        case 5: PWM6_DutyValueSet( value); break;
        case 6: PWM7_DutyValueSet( value); break;
        default: break;
    }
}
Пример #2
0
void TMR2_DefaultInterruptHandler(void){
    // add your TMR2 interrupt custom code
    // or set custom function using TMR2_SetInterruptHandler()
	if (SMstatbits.del2 == 1)
	{
		PWM1_DutyValueSet(SMpos[SPEEDOMETR].PWM1duty);
		PWM2_DutyValueSet(SMpos[SPEEDOMETR].PWM2duty);
		PWM3_DutyValueSet(SMpos[TAHOMETR].PWM1duty);
		PWM4_DutyValueSet(SMpos[TAHOMETR].PWM2duty);
		PWM5_LoadDutyValue(SMpos[TEMPERATURE].PWM1duty);
		PWM6_LoadDutyValue(SMpos[TEMPERATURE].PWM2duty);

		SMstatbits.del2 = 0;
		SMstatbits.CalcNext = 1;
	}
	else
	{
		SMstatbits.del2 = 1;
	}
}