void __exit cleanup_module(void) {

	// On nettoie toutes les tâches
	invaders_task_cleanup_task();
	fb_task_cleanup_task();
	io_task_cleanup_task();
	hit_task_cleanup_task();
	ship_task_cleanup_task();

	// On nettoie tous les objets
	invaders_task_cleanup_objects();
	fb_task_cleanup_objects();
	io_task_cleanup_objects();
	hit_task_cleanup_objects();
	ship_task_cleanup_objects();

	// On désalloue le tas
	if(heap_allocated){
		heap_allocated = 0;
		rt_heap_free(&heap, &fb_mem_rt);
	}

	// On supprime le tas
	if(heap_created){
		heap_created = 0;
		rt_heap_delete(&heap);
	}

	rt_intr_delete(&isrDesc);

	xeno_ts_exit();
}
Beispiel #2
0
void __exit cleanup_module(void) {


	/* To Be Completed */


	rt_intr_delete(&isrDesc);
	rt_task_delete(&menu_task);

//	pca9554_close(NULL, NULL);

	xeno_ts_exit();
}
Beispiel #3
0
int __init init_module(void) {
	int err;

	/* Initialisation du timer */
	if (TIMER_PERIODIC)
		err = rt_timer_set_mode(MS);
	else
		err = rt_timer_set_mode(TM_ONESHOT);

	if (err != 0) {
		printk("rt-app: %s: Error timer: %d\n", __func__, err);
		return -1;
	}

	/* Initialize FB */
	fb_init();
	printk("rt-app: Framebuffer initialized\n");

	xeno_ts_init();
	printk("rt-app: Touchscreen initialized\n");

	/* Open Philips controller
	err = pca9554_open(NULL, NULL);
	if (err != 0) {
		printk("rt-app: %s: I2C slave open error: %d\n", __func__, err);
		goto fail_open;
	}*/

	/* Initializing IRQ */
	err = rt_intr_create(&isrDesc, "IMX_I2C", INT_I2C, imx_i2c_handler, NULL, 0);
	if (err != 0) {
		printk("rt-app: %s: Error interrupt registration: %d\n", __func__, err);
		goto fail_intr;
	}
	printk("rt-app: ISR initialized\n");


	/* To Be Completed */


	return space_invader();

//fail_open:
//	pca9554_close(NULL, NULL);

fail_intr:
	xeno_ts_exit();

	return -1;
}
int __init init_module(void) {
	int err;

	/* Initialisation du timer */
	if (TIMER_PERIODIC)
		err = rt_timer_set_mode(MS);
	else
		err = rt_timer_set_mode(TM_ONESHOT);

	if (err != 0) {
		printk("rt-app: %s: Error timer: %d\n", __func__, err);
		return -1;
	}

	/* Initialize FB */
	fb_init();
	printk("rt-app: Framebuffer initialized\n");

	xeno_ts_init();
	printk("rt-app: Touchscreen initialized\n");

	/* Initializing IRQ */
	err = rt_intr_create(&isrDesc, "IMX_I2C", INT_I2C, imx_i2c_handler, NULL, 0);
	if (err != 0) {
		printk("rt-app: %s: Error interrupt registration: %d\n", __func__, err);
		goto fail_intr;
	}
	printk("rt-app: ISR initialized\n");

	printk("rt-app: i2c driver call\n");

	printk("rt_app: i2c driver ok\n");

	return space_invader();

fail_intr:
	xeno_ts_exit();

	return -1;
}