use zero duty cycle for zero
authorEugene Crosser <crosser@average.org>
Wed, 13 Dec 2017 23:21:38 +0000 (00:21 +0100)
committerEugene Crosser <crosser@average.org>
Wed, 13 Dec 2017 23:21:38 +0000 (00:21 +0100)
msp430/main.c

index 8df6210c9836f6c8f835315b20666458322d8bfa..9146b1836853084eb5540311cdacc71e91e32b04 100644 (file)
@@ -168,7 +168,10 @@ int main(void)
                                }
                        } else
                                continue;
-                       TA0CCR2 = 1 << Duty_Cycle;
+                       if (Duty_Cycle)
+                               TA0CCR2 = 1 << (Duty_Cycle - 1);
+                       else
+                               TA0CCR2 = 0;
                }
                __bis_SR_register(LPM0_bits | GIE);
                __no_operation();