You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//erst mal alles aufmultiplizieren, damit beim Teilen was über 1 übrig bleibt. Bitte mal überschlagen, ob die int32 da nicht überlaufen kann...
238
+
uint32_temp=ui16_sum_torque;
239
+
uint32_temp *= ui8_assist_percent_actual;
240
+
uint32_temp *= ui16_battery_current_max_value;
241
+
uint32_temp *= uint32_torquesensorCalibration;
243
242
244
-
}
243
+
uint32_temp /= ui16_time_ticks_between_pas_interrupt_smoothed; // hier lässt sich die geteilt-Operation nicht vermeiden :-(
245
244
246
-
//increase power linear with speed for convenient commuting :-)
247
-
if ((ui16_aca_flags&SPEED_INFLUENCES_TORQUESENSOR) ==SPEED_INFLUENCES_TORQUESENSOR) {
248
-
float_temp *= (1.0+ ((float) ui16_virtual_erps_speed) / ((float) (ui16_speed_kph_to_erps_ratio* ((float) ui8_speedlimit_kph)) / 100.0)); // influence of current speed based on base speed limit
uint32_current_target=uint32_temp >>8+ui16_current_cal_b; //right shift 15 fasst die Operationen /100 (annähernd >>7) aus der assist_percent und /255 ( >>8) aus dem battery_current max zusammen, ist nicht ganz korrekt, ggf. nur >>14 nehmen -->/(256*128) vs. /(256*64)
0 commit comments