Generation

code to explanationFri, 06 Jan 2023

if(dw_hourmeter_value >= HOUR_METER_MAX) /*if hour meter cross the maximum value, so roll-over hour meter value and trip meter shold reset*/ { dw_hourmeter_value = CLEAR; gsw_hour_meter_count = CLEAR; //fnv_eeprom_write(dw_hourmeter_value); /*writing zero to eeprom*/ fnby_WritePort(AMIL_HOURMETER_VALUE, &dw_hourmeter_value,sizeof(dw_hourmeter_value)); /*writing zero to AMIL*/ fnv_TripA_reset(); /*Reset trip A*/ fnv_TripB_reset(); /*Reset trip B*/ }

the if statement checks the value of dw_hour_meter_value and if the value is greater or equal to the HOUR_METER_MAX then the value of dw_hour_meter_value is set to 0, the gsw_hour_meter_count is set to 0, the fnby_WritePort function is used to write 0 to the AMIL, the fnv_TripA_reset function and the fnv_TripB_reset function are called to reset the trip a and trip b variables.

Questions about programming?Chat with your personal AI assistant