This commit is contained in:
Wolfgang Hottgenroth 2016-09-23 23:14:57 +02:00
parent 8c9151a143
commit e77c0c0351
4 changed files with 2 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

View File

@ -38,7 +38,7 @@ float sineValues[NUM_OF_SINE_VALUES] = {
0.0000
};
volatile uint16_t pulseWidths[NUM_OF_SINE_VALUES * 2] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
volatile uint16_t pulseWidths[NUM_OF_SINE_VALUES * 2];
volatile uint8_t pulseWidthIdx = 0;
volatile uint8_t activeOffset = 0;
@ -97,7 +97,7 @@ void inverterSetFrequency(uint16_t f) {
uint8_t currentOffset = (activeOffset == 0) ? NUM_OF_SINE_VALUES : 0;
for (uint8_t i = 0; i < NUM_OF_SINE_VALUES; i++) {
uint16_t pw = (uint16_t)(slotLength * sineValues[i]);
pulseWidths[i + currentOffset] = (pw == sl) ? (pw - 15) : pw;
pulseWidths[i + currentOffset] = (pw == sl) ? (pw - 25) : pw;
}
__disable_interrupt();