From 25ba5312af7accbbb4bb6bbb16d83acdfeb40a3b Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Sat, 15 Oct 2016 14:36:46 +0200 Subject: [PATCH] =?UTF-8?q?phase=20shift=20must=20be=20120=C2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/inverterCtrl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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();