Skip to content

Commit 5895db3

Browse files
author
Jens Kießling
committed
T9 bottom bracket: Added missing defines and corrected pulse count to 32
1 parent db3f342 commit 5895db3

File tree

4 files changed

+6
-11
lines changed

4 files changed

+6
-11
lines changed

Arduino_Pedelec_Controller/Arduino_Pedelec_Controller.ino

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,8 @@ int last_throttle_write=0; //last throttle write value
255255
#endif
256256
volatile byte wheel_counter=0; //counter for events that should happen once per wheel revolution. only needed if wheel_magnets>1
257257
volatile unsigned long last_pas_event = millis(); //last change-time of PAS sensor status
258-
#ifdef SUPPORT_SEMPU_V1
258+
#if defined(SUPPORT_SEMPU_V1) || defined(SUPPORT_T9)
259259
#define pas_time 1875 //conversion factor for pas_time to rpm (cadence), 32 Pulses
260-
#elif defined(SUPPORT_T9)
261-
#define pas_time 3333 //conversion factor for pas_time to rpm (cadence), 18 Pulses
262260
#else
263261
#define pas_time 60000/pas_magnets //conversion factor for pas_time to rpm (cadence)
264262
#endif
@@ -281,15 +279,12 @@ static volatile boolean torque_want_calculation = false; //read torque values in
281279
#if HARDWARE_REV<20 && defined(SUPPORT_XCELL_RT)
282280
const int torquevalues_count=8;
283281
volatile int torquevalues[torquevalues_count]= {0,0,0,0,0,0,0,0}; //stores the 8 torque values per pedal roundtrip
284-
#elif defined(SUPPORT_SEMPU_V1) || defined(SUPPORT_XCELL_RT)
282+
#elif defined(SUPPORT_SEMPU_V1) || defined(SUPPORT_XCELL_RT) || defined(SUPPORT_T9)
285283
const int torquevalues_count=16;
286284
volatile int torquevalues[torquevalues_count]= {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; //stores the 16 torque values per pedal roundtrip (Thun) or half roundtrip (Sempu)
287285
#elif defined(SUPPORT_SEMPU)
288286
const int torquevalues_count=24;
289287
volatile int torquevalues[torquevalues_count]= {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; //stores the 24 torque values per pedal roundtrip (Sempu new version)
290-
#elif defined(SUPPORT_T9)
291-
const int torquevalues_count=18;
292-
volatile int torquevalues[torquevalues_count]= {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; //stores the 18 torque values per half roundtrip (T9)
293288
#endif
294289
volatile byte torqueindex=0; //index to write next torque value
295290
volatile boolean readtorque=false; //true if torque array has been updated -> recalculate in main loop

Arduino_Pedelec_Controller/config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ const char msg_tempomat_reset[] PROGMEM = "Tempomat reset";
270270
const char msg_unknown_action[] PROGMEM = "Unknown action!";
271271
const char msg_activated[] PROGMEM = "Activated";
272272
const char msg_deactivated[] PROGMEM = "Deactivated";
273-
#if defined(SUPPORT_XCELL_RT) || defined(SUPPORT_SEMPU)|| defined(SUPPORT_SEMPU_V1)
273+
#if defined(SUPPORT_XCELL_RT) || defined(SUPPORT_SEMPU)|| defined(SUPPORT_SEMPU_V1) || defined(SUPPORT_T9)
274274
const char msg_torquezero[] PROGMEM = "Re-zero torque sensor";
275275
#endif
276276

Arduino_Pedelec_Controller/display.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,7 @@ static void display_nokia_view_human()
11351135
lcd.print(MY_F(" CAD "));
11361136
lcd.print(cad);
11371137
lcd.print(MY_F(" "));
1138-
#if defined(SUPPORT_XCELL_RT) || defined(SUPPORT_SEMPU_V1) || defined(SUPPORT_SEMPU) //show left bar with human and battery wh
1138+
#if defined(SUPPORT_XCELL_RT) || defined(SUPPORT_SEMPU_V1) || defined(SUPPORT_SEMPU) || defined(SUPPORT_T9) //show left bar with human and battery wh
11391139
lcd.setCursor(3,3); //print human power centered
11401140
lcd.print(MY_F(" W ")); lcd.print(power_human,0);
11411141
lcd.print(MY_F(" "));

Arduino_Pedelec_Controller/switches.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ void action_set_soft_poti(int new_throttle_stat)
101101

102102
{
103103
#if CONTROL_MODE == CONTROL_MODE_TORQUE //human power control mode
104-
#if defined(SUPPORT_XCELL_RT) || defined(SUPPORT_SEMPU_V1) || defined(SUPPORT_SEMPU)
104+
#if defined(SUPPORT_XCELL_RT) || defined(SUPPORT_SEMPU_V1) || defined(SUPPORT_SEMPU) || defined(SUPPORT_T9)
105105
buffer[9]='%';
106106
power_poti = poti_stat/1023.0* curr_power_poti_max; //power_poti_max is in this control mode interpreted as percentage. Example: power_poti_max=200 means; motor power = 200% of human power
107107
#endif
@@ -337,7 +337,7 @@ static void execute_action(const sw_action action)
337337
action_toggle_gear(true);
338338
break;
339339
#endif
340-
#if defined(SUPPORT_XCELL_RT) || defined(SUPPORT_SEMPU_V1) || defined(SUPPORT_SEMPU)
340+
#if defined(SUPPORT_XCELL_RT) || defined(SUPPORT_SEMPU_V1) || defined(SUPPORT_SEMPU) || defined(SUPPORT_T9)
341341
case ACTION_TORQUE_ZERO:
342342
torque_rezero();
343343
display_show_important_info(FROM_FLASH(msg_torquezero), 2);

0 commit comments

Comments
 (0)