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

door, reset, feed hold and start inputs doesn't work #16

Closed
robomechs opened this issue Jun 5, 2017 · 4 comments
Closed

door, reset, feed hold and start inputs doesn't work #16

robomechs opened this issue Jun 5, 2017 · 4 comments

Comments

@robomechs
Copy link

system.c
WORK (modified code):

void EXTI9_5_IRQHandler(void)
{
	EXTI_ClearITPendingBit(EXTI_Line5 | EXTI_Line6 | EXTI_Line7 | EXTI_Line8);
	uint8_t pin = system_control_get_state();
	if (pin)
	{
		if (bit_istrue(pin,CONTROL_PIN_INDEX_RESET))
		{
			mc_reset();
		}
		else if (bit_istrue(pin, CONTROL_PIN_INDEX_CYCLE_START))
		{
			bit_true(sys_rt_exec_state, EXEC_CYCLE_START);
		}
		else if (bit_istrue(pin, CONTROL_PIN_INDEX_FEED_HOLD))
		{
			bit_true(sys_rt_exec_state, EXEC_FEED_HOLD);
		}
#ifdef ENABLE_SAFETY_DOOR_INPUT_PIN
		else if (bit_istrue(pin, CONTROL_PIN_INDEX_SAFETY_DOOR))
		{
			bit_true(sys_rt_exec_state, EXEC_SAFETY_DOOR);
		}
#endif
		NVIC_ClearPendingIRQ(EXTI9_5_IRQn);
	}
}

doesn't work (The original version):

void EXTI9_5_IRQHandler(void)
{
	uint8_t pin = system_control_get_state();
	if (pin) 
	{ 
		if (bit_istrue(pin,CONTROL_PIN_INDEX_RESET)) 
		{
			mc_reset();
		}
		else if (bit_istrue(pin, CONTROL_PIN_INDEX_CYCLE_START))
		{
			bit_true(sys_rt_exec_state, EXEC_CYCLE_START);
		}
#ifndef ENABLE_SAFETY_DOOR_INPUT_PIN
		else if (bit_istrue(pin, CONTROL_PIN_INDEX_FEED_HOLD))
		{
			bit_true(sys_rt_exec_state, EXEC_FEED_HOLD);
		}
#else
		else if (bit_istrue(pin, CONTROL_PIN_INDEX_SAFETY_DOOR))
		{
			bit_true(sys_rt_exec_state, EXEC_SAFETY_DOOR);
		}
#endif
		NVIC_ClearPendingIRQ(EXTI9_5_IRQn);
}
}
@robomechs
Copy link
Author

solved?

@usbcnc
Copy link
Owner

usbcnc commented Jun 6, 2017

I am out of town and will take a closer look after I come back.

@robomechs
Copy link
Author

ok

@usbcnc
Copy link
Owner

usbcnc commented Jun 27, 2017

I checked in change.
EXTI_ClearITPendingBit((1 << CONTROL_RESET_BIT) | (1 << CONTROL_FEED_HOLD_BIT) | (1 << CONTROL_CYCLE_START_BIT) | (1 << CONTROL_SAFETY_DOOR_BIT));

@usbcnc usbcnc closed this as completed Jun 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants