Skip to content

Commit

Permalink
Fix for I2C keypad plugin not working. Ref. issue #106
Browse files Browse the repository at this point in the history
  • Loading branch information
terjeio committed Jan 2, 2025
1 parent 929d352 commit 13dcab8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions boards/pico_cnc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Part of grblHAL
Copyright (c) 2021-2024 Terje Io
Copyright (c) 2021-2025 Terje Io
grblHAL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -153,15 +153,15 @@ static float digital_in_state (xbar_t *input)
float value = -1.0f;

if(input->id < digital.in.n_ports)
value = (float)(DIGITAL_IN(1UL << aux_in[input->id].pin));
value = (float)(DIGITAL_IN(aux_in[input->id].pin));

return value;
}

inline static __attribute__((always_inline)) int32_t get_input (const input_signal_t *input, wait_mode_t wait_mode, float timeout)
{
if(wait_mode == WaitMode_Immediate)
return DIGITAL_IN(1UL << input->pin);
return DIGITAL_IN(input->pin);

int32_t value = -1;
uint_fast16_t delay = (uint_fast16_t)ceilf((1000.0f / 50.0f) * timeout) + 1;
Expand Down
8 changes: 4 additions & 4 deletions driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Part of grblHAL
Copyright (c) 2021 Volksolive
Copyright (c) 2021-2024 Terje Io
Copyright (c) 2021-2025 Terje Io
grblHAL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -1558,7 +1558,7 @@ static void aux_irq_handler (uint8_t port, bool state)
#ifdef I2C_STROBE_PIN
case Input_I2CStrobe:
if(i2c_strobe.callback)
i2c_strobe.callback(0, DIGITAL_IN(I2C_STROBE_PIN));
i2c_strobe.callback(0, DIGITAL_IN(I2C_STROBE_PIN) == 0);
break;
#endif
#ifdef MPG_MODE_PIN
Expand Down Expand Up @@ -2664,7 +2664,7 @@ bool driver_init (void)
#else
hal.info = "RP2350";
#endif
hal.driver_version = "241219";
hal.driver_version = "250102";
hal.driver_options = "SDK_" PICO_SDK_VERSION_STRING;
hal.driver_url = GRBL_URL "/RP2040";
#ifdef BOARD_NAME
Expand Down Expand Up @@ -2711,7 +2711,7 @@ bool driver_init (void)

hal.control.get_state = systemGetState;

#if I2C_STROBE_BIT || SPI_IRQ_BIT
#if I2C_STROBE_ENABLE || SPI_IRQ_BIT
hal.irq_claim = irq_claim;
#endif
hal.get_micros = getElapsedMicros;
Expand Down

0 comments on commit 13dcab8

Please sign in to comment.