Beispiel #1
0
t_lex			*get_plan(t_scene *scene, t_lex *lex)
{
	int			i;

	i = 0;
	scene->type = PLAN;
	while (lex)
	{
		i++;
		if (!ft_strcmp(lex->str, "<POS>") && (lex = get_pos(&scene->pos, lex)))
			continue ;
		else if (!ft_strcmp(lex->str, "<ROT>") && (lex = get_pos(&scene->dir, lex)))
			continue ;
		else if (!ft_strcmp(lex->str, "<COL>") && (lex = get_pos(&scene->color, lex)))
			continue ;
		else if (!ft_strcmp(lex->str, "<BRILL>") && (lex = lex->next))
			scene->reflect = get_nbr(lex->str);
		else if (!ft_strcmp(lex->str, "<SPEC>") && (lex = lex->next))
			scene->spec = get_nbr(lex->str);
		else if (!ft_strcmp(lex->str, "<NOISE>") && (lex = lex->next))
			scene->noise = get_nbr(lex->str);
		else if (!ft_strcmp(lex->str, "<SIZE>") && (lex = lex->next))
			scene->size = get_nbr(lex->str);
		else if (!ft_strcmp(lex->str, "<DIFF>") && (lex = lex->next))
			scene->diff = get_nbr(lex->str);
		else
			break ;
		lex = lex->next;
	}
	if (i < 7)
		plan_exit();
	return (lex);
}
Beispiel #2
0
/*
 * Exit from unicorn, delete sub sys and threads
 */
void unicorn_exit(int blocking)
{
    printf("unicorn_exit...\n");

    /* Flush stepper and planner fifo */ 
    if (hFifo_plan2st) {
        Fifo_flush(hFifo_plan2st);
    }
    if (hFifo_st2plan) {
        Fifo_flush(hFifo_st2plan);
    }

    if (hPause_printing) {
        Pause_off(hPause_printing);
    }

    heater_exit();
    gcode_exit();
    stepper_exit(blocking);
    plan_exit();

#ifdef SERVO
    if (bbp_board_type == BOARD_BBP1S) {
    	servo_exit();
	}
#endif

    lmsw_exit();
    pwm_exit();
    temp_exit();
    analog_exit();
    parameter_exit();

    /* Delete fifo */
    if (hFifo_plan2st) { 
        Fifo_delete(hFifo_plan2st);
    }
    
    if (hFifo_st2plan) {
        Fifo_delete(hFifo_st2plan);
    }
    
    if (hPause_printing) {
        Pause_delete(hPause_printing);
    }

    fan_exit(); //???? glibc detected *** /usr/bin/unicorn: corrupted double-linked list: 0x0007e330 
    printf("unicorn_exit..., done\n");
}