Skip to content

Commit

Permalink
Merge pull request #97 from leon927/0.19.0-Release_Candidate
Browse files Browse the repository at this point in the history
Small changes
  • Loading branch information
casainho authored May 29, 2019
2 parents 559cd2d + e961770 commit 25af00d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
3 changes: 1 addition & 2 deletions src/controller/ebike_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ uint16_t ui16_pedal_power_x10;
uint8_t ui8_pedal_human_power = 0;
uint16_t ui16_adc_motor_temperatured_accumulated = 0;
uint8_t ui8_m_adc_battery_target_current;
uint8_t ui8_tstr_state_machine = STATE_NO_PEDALLING;
static uint8_t ui8_m_motor_enabled = 1;
static uint8_t ui8_m_brake_is_set = 0;
volatile uint8_t ui8_throttle = 0;
Expand Down Expand Up @@ -1042,8 +1043,6 @@ static void read_pas_cadence(void)

static void torque_sensor_read(void)
{
static uint8_t ui8_tstr_state_machine = STATE_NO_PEDALLING;

// map value from 0 up to 255
// map value from 0 up to 255
ui8_torque_sensor_raw = (uint8_t) (map ( UI8_ADC_TORQUE_SENSOR,
Expand Down
18 changes: 11 additions & 7 deletions src/display/KT-LCD3/lcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1553,6 +1553,9 @@ void lcd_execute_menu_config_power (void)
var_number_t lcd_var_number;
uint16_t ui16_temp;

// because this click event can happen and will block the detection of button_onoff_long_click_event
buttons_clear_onoff_click_event ();

// enable change of variables
ui8_lcd_menu_config_submenu_change_variable_enabled = 1;

Expand Down Expand Up @@ -1587,7 +1590,7 @@ void lcd_execute_menu_config_power (void)
// disable change of variables
ui8_lcd_menu_config_submenu_change_variable_enabled = 0;

// save the updated variables on EEPROM
// save the updated variables to EEPROM
eeprom_write_variables ();

// change to main screen
Expand Down Expand Up @@ -1738,12 +1741,13 @@ void time_measurement (void)

void energy_data (void)
{
static uint8_t ui8_execute_on_startup = 1;
static uint8_t ui8_executed_on_startup;

// reset watt-hour value if battery voltage is over threshold set from user, only executed once during startup
if (ui8_execute_on_startup)
if (!ui8_executed_on_startup)
{
ui8_execute_on_startup = 0;
ui8_executed_on_startup = 1;

if (((uint32_t) motor_controller_data.ui16_adc_battery_voltage * ADC_BATTERY_VOLTAGE_PER_ADC_STEP_X10000) > ((uint32_t) configuration_variables.ui16_battery_voltage_reset_wh_counter_x10 * 1000))
{
configuration_variables.ui32_wh_x10_offset = 0;
Expand Down Expand Up @@ -2046,14 +2050,14 @@ void offroad_mode (void)
{
static uint8_t offroad_mode_assist_symbol_state;
static uint8_t offroad_mode_assist_symbol_state_blink_counter;
static uint8_t ui8_execute_on_startup = 1;
static uint8_t ui8_executed_on_startup;

if (configuration_variables.ui8_offroad_feature_enabled)
{
// enable offroad mode if user has enabled offroad mode on startup
if (ui8_execute_on_startup)
if (!ui8_executed_on_startup)
{
ui8_execute_on_startup = 0;
ui8_executed_on_startup = 1;

if (configuration_variables.ui8_offroad_enabled_on_startup)
{
Expand Down

0 comments on commit 25af00d

Please sign in to comment.