fine
This commit is contained in:
parent
8c9151a143
commit
e77c0c0351
BIN
doc/inverter0_2016-09-23-1.png
Normal file
BIN
doc/inverter0_2016-09-23-1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.1 KiB |
BIN
doc/inverter0_2016-09-23-2.png
Normal file
BIN
doc/inverter0_2016-09-23-2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.6 KiB |
BIN
doc/inverter0_2016-09-23-3.png
Normal file
BIN
doc/inverter0_2016-09-23-3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.5 KiB |
@ -38,7 +38,7 @@ float sineValues[NUM_OF_SINE_VALUES] = {
|
|||||||
0.0000
|
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 pulseWidthIdx = 0;
|
||||||
volatile uint8_t activeOffset = 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;
|
uint8_t currentOffset = (activeOffset == 0) ? NUM_OF_SINE_VALUES : 0;
|
||||||
for (uint8_t i = 0; i < NUM_OF_SINE_VALUES; i++) {
|
for (uint8_t i = 0; i < NUM_OF_SINE_VALUES; i++) {
|
||||||
uint16_t pw = (uint16_t)(slotLength * sineValues[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();
|
__disable_interrupt();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user