diff --git a/src/inverterCtrl.c b/src/inverterCtrl.c index 9083294..3b1f18c 100644 --- a/src/inverterCtrl.c +++ b/src/inverterCtrl.c @@ -15,11 +15,11 @@ #include -#define NUM_OF_SINE_VALUES 30 +#define NUM_OF_SINE_VALUES 21 volatile uint8_t pulseWidthIdx = 0; -volatile bool direction = true; +volatile bool direction = false; ISR(TIMER1_A0, TA1_ISR_Ovrfl) { @@ -79,7 +79,7 @@ void inverterCtrlInit() { void inverterCtrlSetFrequency(uint16_t f) { float ff = (float)f; - float slotLength = 2 / (ff * 400e-9 * NUM_OF_SINE_VALUES); + float slotLength = 4 / (ff * 400e-9 * NUM_OF_SINE_VALUES); uint16_t sl = (uint16_t)slotLength; __disable_interrupt();