Skip to content

Commit 4f6793e

Browse files
committed
Cosmetic cleanup only
1 parent 32fe286 commit 4f6793e

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

Arduino_Pedelec_Controller/Arduino_Pedelec_Controller.ino

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ double torque=0.0; //cyclist's torque in Nm (averaged over one pedal r
271271
double torque_instant=0.0; //cyclist's torque in Nm (live)
272272
double power_human=0.0; //cyclist's power
273273
double wh_human=0;
274-
#if defined(SUPPORT_XCELL_RT) || defined(SUPPORT_SEMPU_V1)|| defined(SUPPORT_SEMPU)
274+
#if defined(SUPPORT_XCELL_RT) || defined(SUPPORT_SEMPU_V1) || defined(SUPPORT_SEMPU)
275275
int torque_zero=TORQUE_ZERO; //Offset of torque sensor. Adjusted at startup if TORQUE_AUTOZERO option is set
276276
static volatile boolean analogRead_in_use = false; //read torque values in interrupt only if no analogRead in process
277277
static volatile boolean torque_want_calculation = false; //read torque values in interrupt only if no analogRead in process
@@ -485,7 +485,7 @@ digitalWrite(option_pin,HIGH);
485485
#ifdef SUPPORT_PAS
486486
bitClear(DDRE,5); //configure PE5 as input
487487
bitSet(PORTE,5); //enable pull-up on PAS sensor
488-
#if !defined(SUPPORT_XCELL_RT) && !defined(SUPPORT_BBS)&& !defined(SUPPORT_SEMPU)
488+
#if !defined(SUPPORT_XCELL_RT) && !defined(SUPPORT_BBS) && !defined(SUPPORT_SEMPU)
489489
bitSet(EICRB,2); //trigger on any edge INT5 for PAS sensor
490490
EIMSK |= (1<<INT5); //turn on interrupt INT5 for PAS sensor
491491
#else
@@ -527,7 +527,7 @@ digitalWrite(option_pin,HIGH);
527527
poti_stat = map(poti_value_on_startup_in_watts, 0, curr_power_poti_max, 0, 1023);
528528
#endif
529529

530-
#if defined(SUPPORT_XCELL_RT) || defined(SUPPORT_SEMPU_V1)|| defined(SUPPORT_SEMPU)
530+
#if defined(SUPPORT_XCELL_RT) || defined(SUPPORT_SEMPU_V1) || defined(SUPPORT_SEMPU)
531531
#ifdef TORQUE_AUTOZERO
532532
torque_rezero();
533533
#endif
@@ -665,8 +665,8 @@ if (loadcell.is_ready()) //new conversion result from load cell available
665665
current_display = 0.99*current_display + 0.01*current; //averaged current for display
666666
power=current*voltage;
667667

668-
#if defined(SUPPORT_XCELL_RT) || defined(SUPPORT_SEMPU_V1)|| defined(SUPPORT_SEMPU)
669-
#ifdef SUPPORT_XCELL_RT
668+
#if defined(SUPPORT_XCELL_RT) || defined(SUPPORT_SEMPU_V1) || defined(SUPPORT_SEMPU)
669+
#ifdef SUPPORT_XCELL_RT
670670
torque_instant=0.49*(analogRead(option_pin)-torque_zero); //multiplication constant for THUN X-CELL RT is approx. 0.49Nm/count
671671
#else //Sempu
672672
torque_instant=0.33*(analogRead(option_pin)-torque_zero); //multiplication constant for SEMPU V1 is approx. 0.33Nm/count
@@ -679,8 +679,8 @@ if (loadcell.is_ready()) //new conversion result from load cell available
679679
torque+=torquevalues[i];
680680
}
681681
readtorque=false;
682-
//now calculate torque_instant, torque and power
683-
#ifdef SUPPORT_XCELL_RT
682+
//now calculate torque_instant, torque and power
683+
#ifdef SUPPORT_XCELL_RT
684684
#if HARDWARE_REV<20
685685
torque=abs((torque)*0.061); //torque=sum of torque values/#of torque values*5V/1023 counts/(10mV/Nm)
686686
#else
@@ -727,7 +727,7 @@ if (loadcell.is_ready()) //new conversion result from load cell available
727727
wh=variable.wh;
728728
km=variable.kilometers;
729729
mah=variable.mah;
730-
#if defined(SUPPORT_XCELL_RT) || defined(SUPPORT_SEMPU_V1)|| defined(SUPPORT_SEMPU)
730+
#if defined(SUPPORT_XCELL_RT) || defined(SUPPORT_SEMPU_V1) || defined(SUPPORT_SEMPU)
731731
wh_human=variable.wh_human;
732732
#endif
733733
}
@@ -791,7 +791,7 @@ if (loadcell.is_ready()) //new conversion result from load cell available
791791
power_throttle = throttle_stat / 1023.0 * curr_power_max; //power currently set by throttle
792792

793793
#if CONTROL_MODE == CONTROL_MODE_TORQUE //human power control mode
794-
#if defined(SUPPORT_XCELL_RT) || defined(SUPPORT_SEMPU_V1)|| defined(SUPPORT_SEMPU)
794+
#if defined(SUPPORT_XCELL_RT) || defined(SUPPORT_SEMPU_V1) || defined(SUPPORT_SEMPU)
795795
power_poti = poti_stat/102300.0* curr_power_poti_max*power_human*(1+spd/20.0); //power_poti_max is in this control mode interpreted as percentage. Example: power_poti_max=200 means; motor power = 200% of human power
796796
#ifdef SUPPORT_TORQUE_THROTTLE //we want to trigger throttle just by pedal torque
797797
if (abs(torque_instant)>torque_throttle_min) //we are above the threshold to trigger throttle
@@ -1072,7 +1072,7 @@ ISR(INT7_vect)
10721072
speed_change();
10731073
}
10741074
#ifdef SUPPORT_PAS
1075-
#if defined(SUPPORT_XCELL_RT) || defined(SUPPORT_BBS)|| defined(SUPPORT_SEMPU)
1075+
#if defined(SUPPORT_XCELL_RT) || defined(SUPPORT_BBS) || defined(SUPPORT_SEMPU)
10761076
ISR(INT5_vect)
10771077
{
10781078
pas_change_dual(false);
@@ -1126,7 +1126,7 @@ void read_current_torque() //this reads the current torque value
11261126
torqueindex++;
11271127
if (torqueindex==torquevalues_count)
11281128
torqueindex=0;
1129-
readtorque=true;
1129+
readtorque=true;
11301130
}
11311131

11321132
void torque_rezero() //resets torque sensor

0 commit comments

Comments
 (0)