mirror of
https://github.com/ole00/afterburner.git
synced 2024-11-22 06:32:01 +00:00
Sketch: reduced duration on VPP ramp-up
The VPP ramp-up was too long after the change of the calibration scale in recent commits.
This commit is contained in:
parent
dabfcf5aad
commit
a9bf98b719
18
aftb_vpp.h
18
aftb_vpp.h
@ -122,7 +122,6 @@ static void varVppSetVppIndex(uint8_t value) {
|
|||||||
static void varVppSet(uint8_t value) {
|
static void varVppSet(uint8_t value) {
|
||||||
uint8_t v;
|
uint8_t v;
|
||||||
int8_t inc;
|
int8_t inc;
|
||||||
int8_t incMin;
|
|
||||||
if (value == VPP_5V0 || value >= MAX_WIPER) {
|
if (value == VPP_5V0 || value >= MAX_WIPER) {
|
||||||
varVppSetVppIndex(0);
|
varVppSetVppIndex(0);
|
||||||
return;
|
return;
|
||||||
@ -134,19 +133,14 @@ static void varVppSet(uint8_t value) {
|
|||||||
Serial.println(vppWiper[value]);
|
Serial.println(vppWiper[value]);
|
||||||
#endif
|
#endif
|
||||||
//ramp up to prevent massive voltage overshoots
|
//ramp up to prevent massive voltage overshoots
|
||||||
v = vppWiper[value] / 2;
|
v = vppWiper[value] / 3;
|
||||||
v -= 2;
|
inc = v >> 2;
|
||||||
inc = 16;
|
|
||||||
incMin = 2;
|
|
||||||
if (value > VPP_13V0) {
|
|
||||||
incMin = 1;
|
|
||||||
}
|
|
||||||
while (v < vppWiper[value]) {
|
while (v < vppWiper[value]) {
|
||||||
varVppSetVppIndex(v);
|
varVppSetVppIndex(v);
|
||||||
v+= inc + (inc / 2);
|
v+= (inc << 1);
|
||||||
inc -= inc / 2;
|
inc -= (inc >> 1);
|
||||||
if (inc < incMin) {
|
if (inc < 2) {
|
||||||
inc = incMin;
|
inc = 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
varVppSetVppIndex(vppWiper[value]);
|
varVppSetVppIndex(vppWiper[value]);
|
||||||
|
Loading…
Reference in New Issue
Block a user