/** * Initiate linefollowing to the next station */ void drive_to_next(void) { set_sensor_to_linefollowing(); scan_count = 0; _delay_ms(50); enable_timer_interrupts(); }
/* si_kernel_init: initialise real-time kernel */ void si_kernel_init(void) { /* task_id for idle task */ int task_id_idle; /* kernel is not running yet */ Kernel_Running = 0; /* initialise task module */ task_init(); /* initialise ready list */ ready_list_init(); /* disable interrupts. The interrupts will be enabled when the first task starts */ DISABLE_INTERRUPTS; /* initialise tick handler */ tick_handler_init(); /* initialise time list */ time_list_init(); /* initialise time storage */ time_storage_init(); /* create idle task */ task_id_idle = task_create(idle_task, &Idle_Stack[IDLE_STACK_SIZE-1], IDLE_PRIORITY); /* identify the idle task */ task_set_idle_task(idle_task); /* and insert it into the ready list */ ready_list_insert(task_id_idle); int_status_init(); setup_int_handler(); enable_timer_interrupts(); }
/** * To be able to follow the line * * @param curr_error The error from the line */ void drive(int8_t curr_error) { // Update steering with new PD value update_steering(pd_update(curr_error), STEERING_MAX_SPEED); enable_timer_interrupts(); }