Skip to content

Commit f1579f7

Browse files
committed
Fix for broken handling of control signals for RC variant processors. Ref. issue #51 and core discussion 499.
1 parent e41d16c commit f1579f7

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

Inc/mach3_bob_map.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ LED PC2
3333
2 gnd
3434
3 PB8 - feed hold
3535
4 PB9 - reset or e-stop
36-
5 PB6 - start safety door
37-
6 PB7 - cycle
36+
5 PB6 - safety door or aux in 0
37+
6 PB7 - cycle start
3838
7 PB4 - probe
39-
8 PB3 - MPG mode or Aux out 0
39+
8 PB3 - MPG mode or aux in 1
4040
9 PD2 - UART5 Rx - remove pull up/pull down resistors!
4141
10 PC12 - UART5 Tx - remove pull up/pull down resistors!
4242

Src/driver.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1749,9 +1749,9 @@ bool driver_init (void)
17491749
.Mode = GPIO_MODE_OUTPUT_PP
17501750
};
17511751

1752-
HAL_GPIO_Init(MPG_MODE_PORT, &GPIO_Init);
1752+
DIGITAL_OUT(MPG_MODE_PORT, MPG_MODE_PIN, 0);
17531753

1754-
DIGITAL_OUT(MPG_MODE_PORT, MPG_MODE_PIN, 1);
1754+
HAL_GPIO_Init(MPG_MODE_PORT, &GPIO_Init);
17551755

17561756
#endif
17571757

@@ -1770,7 +1770,7 @@ bool driver_init (void)
17701770
#else
17711771
hal.info = "STM32F103CB";
17721772
#endif
1773-
hal.driver_version = "240404";
1773+
hal.driver_version = "240425";
17741774
hal.driver_url = GRBL_URL "/STM32F1xx";
17751775
#ifdef BOARD_NAME
17761776
hal.board = BOARD_NAME;
@@ -1955,6 +1955,12 @@ bool driver_init (void)
19551955
input->mode.debounce = hal.driver_cap.software_debounce;
19561956
}
19571957
limit_inputs.n_pins++;
1958+
} else if(input->group == PinGroup_Control && (CONTROL_MASK & input->bit)) {
1959+
pin_irq[__builtin_ffs(input->bit) - 1] = input;
1960+
#if xSAFETY_DOOR_ENABLE
1961+
if(input->id == Input_SafetyDoor)
1962+
input->mode.debounce = hal.driver_cap.software_debounce;
1963+
#endif
19581964
}
19591965
}
19601966

@@ -2086,7 +2092,7 @@ void core_pin_debounce (void *pin)
20862092
#endif
20872093

20882094
if(input->mode.irq_mode == IRQ_Mode_Change ||
2089-
DIGITAL_IN(input->port, input->pin) == (input->mode.irq_mode == IRQ_Mode_Falling ? 0 : 1)) {
2095+
DIGITAL_IN(input->port, input->pin) == (input->mode.irq_mode == IRQ_Mode_Falling ? 0 : 1) || true) {
20902096

20912097
if(input->group & (PinGroup_Control)) {
20922098
hal.control.interrupt_callback(systemGetState());

0 commit comments

Comments
 (0)