Skip to content

Commit

Permalink
[fw] change pin type for arduino mode
Browse files Browse the repository at this point in the history
  • Loading branch information
MicBoucinha committed Jul 29, 2021
1 parent 6f43c83 commit b1138b8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
16 changes: 9 additions & 7 deletions Firmware/Pump/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,17 +192,19 @@ void core_callback_1st_config_hw_after_boot(void)
if(!(read_EN_DRIVER_UC))
{
set_BUF_EN;
set_EN_DRIVER;

// change STEP, DIR and MSx as tristate
io_pin2out(&PORTA, 0, PULL_IO_TRISTATE, SENSE_IO_NO_INT_USED); // STEP
io_pin2out(&PORTA, 1, PULL_IO_TRISTATE, SENSE_IO_NO_INT_USED); // DIR
io_pin2out(&PORTA, 2, PULL_IO_TRISTATE, SENSE_IO_NO_INT_USED); // MS1
io_pin2out(&PORTA, 3, PULL_IO_TRISTATE, SENSE_IO_NO_INT_USED); // MS2
io_pin2out(&PORTA, 4, PULL_IO_TRISTATE, SENSE_IO_NO_INT_USED); // MS3
io_pin2in(&PORTA, 0, PULL_IO_TRISTATE, SENSE_IO_NO_INT_USED); // STEP
io_pin2in(&PORTA, 1, PULL_IO_TRISTATE, SENSE_IO_NO_INT_USED); // DIR
io_pin2in(&PORTA, 2, PULL_IO_TRISTATE, SENSE_IO_NO_INT_USED); // MS1
io_pin2in(&PORTA, 3, PULL_IO_TRISTATE, SENSE_IO_NO_INT_USED); // MS2
io_pin2in(&PORTA, 4, PULL_IO_TRISTATE, SENSE_IO_NO_INT_USED); // MS3
}

if(read_EN_DRIVER_UC)
else
{
clr_EN_DRIVER;
}
}

void core_callback_reset_registers(void)
Expand Down
12 changes: 7 additions & 5 deletions Firmware/Pump/interrupts.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,17 +163,19 @@ ISR(PORTD_INT0_vect, ISR_NAKED)
if(!(read_EN_DRIVER_UC))
{
set_BUF_EN;
set_EN_DRIVER;

// change STEP, DIR and MSx as tristate
io_pin2out(&PORTA, 0, PULL_IO_TRISTATE, SENSE_IO_NO_INT_USED); // STEP
io_pin2out(&PORTA, 1, PULL_IO_TRISTATE, SENSE_IO_NO_INT_USED); // DIR
io_pin2out(&PORTA, 2, PULL_IO_TRISTATE, SENSE_IO_NO_INT_USED); // MS1
io_pin2out(&PORTA, 3, PULL_IO_TRISTATE, SENSE_IO_NO_INT_USED); // MS2
io_pin2out(&PORTA, 4, PULL_IO_TRISTATE, SENSE_IO_NO_INT_USED); // MS3
io_pin2in(&PORTA, 0, PULL_IO_TRISTATE, SENSE_IO_NO_INT_USED); // STEP
io_pin2in(&PORTA, 1, PULL_IO_TRISTATE, SENSE_IO_NO_INT_USED); // DIR
io_pin2in(&PORTA, 2, PULL_IO_TRISTATE, SENSE_IO_NO_INT_USED); // MS1
io_pin2in(&PORTA, 3, PULL_IO_TRISTATE, SENSE_IO_NO_INT_USED); // MS2
io_pin2in(&PORTA, 4, PULL_IO_TRISTATE, SENSE_IO_NO_INT_USED); // MS3
}
else
{
clr_BUF_EN;
//clr_EN_DRIVER;

// change STEP, DIR and MSx to default mode
io_pin2out(&PORTA, 0, OUT_IO_DIGITAL, IN_EN_IO_EN); // STEP
Expand Down

0 comments on commit b1138b8

Please sign in to comment.