Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct OUT00 limit switch wrong toggling #11

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 6 additions & 13 deletions Firmware/Pump/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void hwbp_app_initialize(void)
uint8_t hwH = 1;
uint8_t hwL = 1;
uint8_t fwH = 1;
uint8_t fwL = 0;
uint8_t fwL = 1;
uint8_t ass = 0;

/* Start core */
Expand Down Expand Up @@ -234,6 +234,9 @@ void core_callback_initialize_hardware(void)
{
clr_EN_DRIVER;
}

clear_sw_f();
clear_sw_r();
}

void core_callback_reset_registers(void)
Expand Down Expand Up @@ -438,12 +441,7 @@ void core_callback_t_1ms(void)
core_func_send_event(ADD_REG_SW_FORWARD_STATE, true);

if((app_regs.REG_DO0_CONFIG & MSK_OUT0_CONF) == GM_OUT0_SWLIMIT)
{
if(read_SW_F)
set_OUT00;
else
clr_OUT00;
}
set_OUT00;
}
}
}
Expand All @@ -461,12 +459,7 @@ void core_callback_t_1ms(void)
core_func_send_event(ADD_REG_SW_REVERSE_STATE, true);

if((app_regs.REG_DO0_CONFIG & MSK_OUT0_CONF) == GM_OUT0_SWLIMIT)
{
if(read_SW_R)
set_OUT00;
else
clr_OUT00;
}
set_OUT00;
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions Firmware/Pump/interrupts.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ ISR(PORTC_INT0_vect, ISR_NAKED)
app_regs.REG_SW_FORWARD_STATE = 0;
if(app_regs.REG_EVT_ENABLE & B_EVT_SW_FORWARD_STATE)
core_func_send_event(ADD_REG_SW_FORWARD_STATE, true);
if((app_regs.REG_DO0_CONFIG & MSK_OUT0_CONF) == GM_OUT0_SWLIMIT)
clr_OUT00;
}
clear_sw_f();
}
Expand All @@ -102,6 +104,8 @@ ISR(PORTC_INT0_vect, ISR_NAKED)
app_regs.REG_SW_REVERSE_STATE = 0;
if(app_regs.REG_EVT_ENABLE & B_EVT_SW_REVERSE_STATE)
core_func_send_event(ADD_REG_SW_REVERSE_STATE, true);
if((app_regs.REG_DO0_CONFIG & MSK_OUT0_CONF) == GM_OUT0_SWLIMIT)
clr_OUT00;
}
clear_sw_r();
}
Expand Down