mirror of
https://github.com/ole00/afterburner.git
synced 2024-06-18 04:29:28 +00:00
Added some comments for clearnes
This commit is contained in:
parent
2e88c0324d
commit
84481ab77d
|
@ -37,7 +37,7 @@
|
|||
*/
|
||||
|
||||
|
||||
#define VERSION "0.5.6"
|
||||
#define VERSION "0.5.6hh"
|
||||
|
||||
//#define DEBUG_PES
|
||||
//#define DEBUG_VERIFY
|
||||
|
@ -832,7 +832,7 @@ static void setVCC(char on) {
|
|||
static void setVPP(char on) {
|
||||
// new board desgin
|
||||
if (varVppExists) {
|
||||
uint8_t v = VPP_11V0;
|
||||
uint8_t v; // v is recalculated in each case; initialization of the variable is unnecessary
|
||||
|
||||
// when PES is read the VPP is not determined via PES
|
||||
if (on == READPES) {
|
||||
|
@ -843,14 +843,15 @@ static void setVPP(char on) {
|
|||
}
|
||||
} else {
|
||||
//safety check
|
||||
if (vpp < 36) {
|
||||
vpp = 36; //9V
|
||||
if (vpp < 36) { // set minimum to 9V0
|
||||
vpp = 36; //9V // ==> v = (36 / 2) - 18 = 0 ==> VPP_9V0
|
||||
} else
|
||||
if (vpp > 66) {
|
||||
vpp = 40; //12V
|
||||
if (vpp > 66) { // set maximum to 10V0
|
||||
vpp = 40; //12V // ==> v = (40 / 2) - 18 = 2 ==> VPP_10V0
|
||||
}
|
||||
// 36 <= vpp <=66 ==> v = 0 ... 15 ==> VPP_9V0 ... VPP_16V5
|
||||
v = (vpp >> 1) - 18; // 18: 2 * 9V, resolution 0.5V (not 0.25V) hence 'vpp >> 1'
|
||||
#if 0
|
||||
#if 1
|
||||
Serial.print(F("setVPP "));
|
||||
Serial.print(vpp);
|
||||
Serial.print(F(" index="));
|
||||
|
|
Loading…
Reference in New Issue
Block a user