mixed up pins for polarity out and start polarity

This commit is contained in:
Wolfgang Hottgenroth 2016-10-15 12:03:30 +02:00
parent 8a42a75845
commit ee606efebd

View File

@ -92,7 +92,7 @@ ISR(TIMER0_A1, TA0_ISR_Comp) {
if (taiv & TA0IV_TACCR1) {
P2OUT &= ~BIT1;
} else if ((taiv && TA0IV_TACCR2) && (pulseWidthIdx == 0)) {
P1OUT ^= (BIT1 | BIT2);
P1OUT ^= BIT2;
}
__enable_interrupt();
}
@ -105,8 +105,8 @@ void inverterExec() {
// start
pulseWidthIdx = 0;
// bridge start polarity
P1OUT &= ~BIT1;
P1OUT |= ((BIT2 & P1IN) >> 1);
P1OUT &= ~BIT2;
P1OUT |= ((BIT1 & P1IN) << 1);
// start timer
TA0CTL = MC_1 | ID_0 | TASSEL_0 | TACLR;
running = true;
@ -129,12 +129,12 @@ void inverterInit() {
P1DIR &= ~BIT3;
// bridge start polarity
P1DIR &= ~BIT2;
P1DIR &= ~BIT1;
// bridge polarity
P1OUT &= ~BIT1;
P1OUT |= ((BIT2 & P1IN) >> 1);
P1DIR |= BIT1;
P1OUT &= ~BIT2;
P1OUT |= ((BIT1 & P1IN) << 1);
P1DIR |= BIT2;
// bridge enable (PWM)
P2OUT &= ~BIT1;