Exemplo n.º 1
0
/*
 * _limit_switch_handler() - shut down system if limit switch fired
 */
static uint8_t _limit_switch_handler(void)
{
	if (cm_get_machine_state() == MACHINE_SHUTDOWN) { return (TG_NOOP);}
	if (gpio_get_limit_thrown() == false) return (TG_NOOP);
	cm_shutdown();
	return (TG_OK);
}
Exemplo n.º 2
0
/*
 * _limit_switch_handler() - shut down system if limit switch fired
 */
static stat_t _limit_switch_handler(void)
{
	if (cm_get_machine_state() == MACHINE_ALARM) { return (STAT_NOOP);}
	if (gpio_get_limit_thrown() == false) return (STAT_NOOP);
//	cm_alarm(gpio_get_sw_thrown); // unexplained complier warning: passing argument 1 of 'cm_shutdown' makes integer from pointer without a cast
	cm_alarm(sw.sw_num_thrown);
	return (STAT_OK);
}