@@ -218,7 +218,7 @@ int main(void)
218218{
219219
220220 //nvic_vector_table_set(NVIC_VECTTAB_FLASH, 0xA800); //for bootloader v3.8
221- // nvic_vector_table_set(NVIC_VECTTAB_FLASH, 0x4000); //for bootloader v3
221+ nvic_vector_table_set (NVIC_VECTTAB_FLASH , 0x4000 ); //for bootloader v3
222222 __enable_irq ();
223223
224224 //SCB->VTOR = 0x08004000;
@@ -1293,12 +1293,12 @@ void PAS_processing(void)
12931293 MS .torque_on_crank = (adc_value [2 ]* 3300 )>>12 ; //map ADC value to mV
12941294 PAS_counter = 0 ;
12951295 PAS_flag = 0 ;
1296- torque_cumulated -= torque_cumulated >>MP .assist_settings [MS .assist_level ][2 ];
1296+ torque_cumulated -= torque_cumulated >>5 ; // MP.assist_settings[MS.assist_level][2];
12971297 if (MS .torque_on_crank > 750 ){
12981298 torque_cumulated += (MS .torque_on_crank - 750 );
12991299 }
13001300 //Power=2*Pi*speed*torque, calibration factors: rpm to 1/s for cadence: /60, mV to Nm: 750 to 3200 --> 0 to 80 Nm. (from Bafang data sheet)
1301- MS .p_human = (uint16_t )((float )(MS .cadence * (torque_cumulated >>MP . assist_settings [ MS . assist_level ][ 2 ] ))* 0.00342 ); //in Watt
1301+ MS .p_human = (uint16_t )((float )(MS .cadence * (torque_cumulated >>5 ))* 0.00342 ); //in Watt
13021302}
13031303
13041304void Speed_processing (void )
@@ -1865,7 +1865,7 @@ void write_virtual_eeprom(void)
18651865// fmc_multi_word_program(FMC_OFFSET_PARA0, &Para0[0]);
18661866// fmc_multi_word_program(FMC_OFFSET_PARA1, &Para1[0]);
18671867// fmc_multi_word_program(FMC_OFFSET_PARA2, &Para2[0]);
1868- fmc_multi_word_program (FMC_OFFSET_MP , (uint8_t * )& MP , 22 ); //86byte in MP
1868+ fmc_multi_word_program (FMC_OFFSET_MP , (uint8_t * )& MP , 22 ); //88byte in MP
18691869 }
18701870
18711871void read_virtual_eeprom (void )
0 commit comments