robomechs/6-AXIS-USBCNC-GRBL

It is not possible to deactivate the internal pull ups for limits

mstrens opened this issue · 1 comments

The official version of GRBL has an option that allows to deactivate the internal pull up for limits.
It is a parameter in config.h.

This option has not been migrate in the STM32 version.
The correction is easy (one #ifdef and 1 line of code:

Here the new code
`#ifdef STM32F103C8
GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd(RCC_LIMIT_PORT | RCC_APB2Periph_AFIO, ENABLE);
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
#ifdef DISABLE_LIMIT_PIN_PULL_UP
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
#else
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;
#endif
GPIO_InitStructure.GPIO_Pin = LIMIT_MASK;
GPIO_Init(LIMIT_PORT, &GPIO_InitStructure);

if (bit_istrue(settings.flags, BITFLAG_HARD_LIMIT_ENABLE))

`

Thanks!
Done!