Ejemplo n.º 1
0
BaseType_t xPortStartScheduler( void )
{
	/* Start the timer that generates the tick ISR.  Interrupts are disabled
	here already. */
	prvSetupTimerInterrupt();

	/* Start the first task. */
	portRESTORE_CONTEXT();

	/* Should not get here! */
	return 0;
}
Ejemplo n.º 2
0
portBASE_TYPE xPortStartScheduler( void )
{
	/* Setup the hardware to generate the tick.  Interrupts are disabled when
	this function is called. */
	prvSetupTimerInterrupt();

	/* Restore the context of the first task that is going to run. */
	portRESTORE_CONTEXT();

	/* Should not get here as the tasks are now running! */
	return pdTRUE;
}
Ejemplo n.º 3
0
void vUART_ISR_Wrapper( void )
{
	/* Save the context of the interrupted task. */
	portSAVE_CONTEXT();

	/* Call the handler.  This must be a separate function to ensure the 
	stack frame is correctly set up. */
	__asm volatile( "bl vUART_ISR_Handler" );

	/* Restore the context of whichever task will run next. */
	portRESTORE_CONTEXT();
}
Ejemplo n.º 4
0
void vEMACISR_Wrapper( void )
{
	/* Save the context of the interrupted task. */
	portSAVE_CONTEXT();
	
	/* Call the handler task to do the actual work.  This must be a separate
	function to ensure the stack frame is correctly set up. */
	__asm volatile ("bl vEMACISR_Handler");
	
	/* Restore the context of whichever task is the next to run. */
	portRESTORE_CONTEXT();
}
Ejemplo n.º 5
0
void  vEMACISR_Wrapper( void )
{
	/* Save the context of the interrupted task. */
	portSAVE_CONTEXT();

	/* Call the handler to do the work.  This must be a separate
	function to ensure the stack frame is set up correctly. */
	vEMACISR_Handler();

	/* Restore the context of whichever task will execute next. */
	portRESTORE_CONTEXT();
}
Ejemplo n.º 6
0
/*
 * Manual context switch.  This is similar to the tick context switch,
 * but does not increment the tick count.  It must be identical to the
 * tick context switch in how it stores the stack of a task.
 */
void vPortYield( void )
{
	/* This can get called with interrupts either enabled or disabled.  We
	will save the INTCON register with the interrupt enable bits unmodified. */
	portSAVE_CONTEXT( portINTERRUPTS_UNCHANGED );

	/* Switch to the highest priority task that is ready to run. */
	vTaskSwitchContext();

	/* Start executing the task we have just switched to. */
	portRESTORE_CONTEXT();
}
Ejemplo n.º 7
0
void vI2C_ISR_Wrapper( void )
{
	/* Save the context of the interrupted task. */
	portSAVE_CONTEXT();

	/* Call the handler to perform the actual work.  This must be a
	separate function to ensure the correct stack frame is set up. */
	vI2C_ISR_Handler();

	/* Restore the context of whichever task is going to run next. */
	portRESTORE_CONTEXT();
}
Ejemplo n.º 8
0
static void vFtMac100_ISR_Wrapper( void )
{
	/* Save the context of the interrupted task. */
	/* Done at boot.s*/

	/* Call the handler.  This must be a separate function from the wrapper
	to ensure the correct stack frame is set up. */
	__asm volatile ("bl ftMac100_InterruptHandler");

	/* Restore the context of whichever task is going to run next. */
	portRESTORE_CONTEXT();
}
Ejemplo n.º 9
0
void vEINT0_ISR_Wrapper( void )
{
	/* Save the context of the interrupted task. */
	portSAVE_CONTEXT();

	/* The handler must be a separate function from the wrapper to
	ensure the correct stack frame is set up. */
	vEINT0_ISR_Handler();

	/* Restore the context of whichever task is going to run next. */
	portRESTORE_CONTEXT();
}
Ejemplo n.º 10
0
void vEMAC_ISR_Wrapper( void )
{
	/* Save the context of the interrupted task. */
    portSAVE_CONTEXT();
    
    /* Call the handler.  This must be a separate function unless you can
    guarantee that no stack will be used. */
    __asm volatile ( "bl vEMAC_ISR_Handler" );
    
    /* Restore the context of whichever task is going to run next. */
    portRESTORE_CONTEXT();
}
Ejemplo n.º 11
0
ISR (TCC0_OVF_vect, ISR_NAKED) {
    /*
     * Context switch function used by the tick.  This must be identical to
     * vPortYield() from the call to vTaskSwitchContext() onwards.  The only
     * difference from vPortYield() is the tick count is incremented as the
     * call comes from the tick ISR.
     */
    portSAVE_CONTEXT();
    vTaskIncrementTick();
    vTaskSwitchContext();
    portRESTORE_CONTEXT();
    asm volatile ( "reti" );
}
Ejemplo n.º 12
0
	interrupt (TIMERA0_VECTOR) prvTickISR( void )
	{
		/* Save the context of the interrupted task. */
		portSAVE_CONTEXT();

		/* Increment the tick count then switch to the highest priority task
		that is ready to run. */
		vTaskIncrementTick();
		vTaskSwitchContext();

		/* Restore the context of the new task. */
		portRESTORE_CONTEXT();
	}
Ejemplo n.º 13
0
void vButtonISRWrapper( void )
{
	/* Save the context of the interrupted task. */
	portSAVE_CONTEXT();

	/* Call the handler to do the work.  This must be a separate function to
	the wrapper to ensure the correct stack frame is set up. */
	__asm volatile( "bl vButtonHandler" );

	/* Restore the context of whichever task is going to run once the interrupt
	completes. */
	portRESTORE_CONTEXT();
}
Ejemplo n.º 14
0
void vPortYieldFromTick( void )
{
	portSAVE_CONTEXT();

	if( xTaskIncrementTick() != pdFALSE )
	{
		vTaskSwitchContext();
	}

	portRESTORE_CONTEXT();

	__asm__ __volatile__ ( "ret" );
}
Ejemplo n.º 15
0
static void
prvPortPreemptiveTick( void )
{
    asm volatile ( "move.w  #0x2700, %sr\n\t" );
#if _GCC_USES_FP == 1
    asm volatile ( "unlk %fp\n\t" );
#endif
    portSAVE_CONTEXT(  );
    MCF_PIT_PCSR0 |= MCF_PIT_PCSR_PIF;
    vTaskIncrementTick(  );
    vTaskSwitchContext(  );
    portRESTORE_CONTEXT(  );
}
Ejemplo n.º 16
0
void i2c_isr()
{
	portSAVE_CONTEXT();
	//i2c_stateMachine();
	if (i2c_stateMachine())     //run the state machine code.
	{   //finished sending/receiving data.
		signed portBASE_TYPE prio_task; xSemaphoreGiveFromISR(i2c_done, &prio_task);
	} else { //not done yet.
		portYIELD_FROM_ISR(); //let other tasks happen, we're not done with the state machine yet.
	}
	VICVectAddr = 0;	//Acknowledge interrupt
	portRESTORE_CONTEXT();
}
Ejemplo n.º 17
0
BaseType_t xPortStartScheduler( void )
{
	/* Set-up the timer interrupt. */
	prvSetupTimerInterrupt();

	/* Integrated Interrupt Controller: Enable all interrupts. */
	ic->ien = 1;

	/* Restore callee saved registers. */
	portRESTORE_CONTEXT();

	/* Should not get here. */
	return 0;
}
Ejemplo n.º 18
0
portBASE_TYPE xPortStartScheduler( void )
{
	/* Setup a timer for the tick ISR is using the preemptive scheduler. */
	prvSetupTimerInterrupt(); 

	/* Restore the context of the first task to run. */
	portRESTORE_CONTEXT();

	/* Should not get here.  Use the function name to stop compiler warnings. */
	( void ) prvLowInterrupt;
	( void ) prvTickISR;

	return pdTRUE;
}
Ejemplo n.º 19
0
BaseType_t xPortStartScheduler( void )
{
	/* Setup a timer for the tick ISR. */
	vApplicationSetupTickTimerInterrupt();

	/* Restore the context of the first task to run. */
	portRESTORE_CONTEXT();

	/* Simulate the end of the yield function. */
	asm volatile ( "return" );

	/* Should not reach here. */
	return pdTRUE;
}
Ejemplo n.º 20
0
void vUSB_ISR_Wrapper( void )
{
	/* Save the context of the interrupted task. */
	portSAVE_CONTEXT();

	/* Call the handler itself.  This must be a separate function as it uses
	the stack. */
	__asm volatile ("bl vUSB_ISR_Handler");

	/* Restore the context of the task that is going to 
	execute next. This might not be the same as the originally 
	interrupted task.*/
	portRESTORE_CONTEXT();
}
Ejemplo n.º 21
0
portBASE_TYPE xPortStartScheduler( void )
{
	/* Setup the hardware to generate the tick. */
	prvSetupTimerInterrupt();

	/* Restore the context of the first task that is going to run. */
	portRESTORE_CONTEXT();

	/* Simulate a function call end as generated by the compiler.  We will now
	jump to the start of the task the context of which we have just restored. */
	asm volatile ( "ret" );

	/* Should not get here. */
	return pdTRUE;
}
Ejemplo n.º 22
0
static portBASE_TYPE xBankedStartScheduler( void )
{
	/* Configure the timer that will generate the RTOS tick.  Interrupts are
	disabled when this function is called. */
	prvSetupTimerInterrupt();

	/* Restore the context of the first task. */
	portRESTORE_CONTEXT();

	/* Simulate the end of an interrupt to start the scheduler off. */
	__asm( "rti" );

	/* Should not get here! */
	return pdFALSE;
}
Ejemplo n.º 23
0
	void prvTickISR( void )
	{
		/* Save the context of the interrupted task. */
		portSAVE_CONTEXT();

		/* Increment the tick count then switch to the highest priority task
		that is ready to run. */
		if( xTaskIncrementTick() != pdFALSE )
		{
			vTaskSwitchContext();
		}

		/* Restore the context of the new task. */
		portRESTORE_CONTEXT();
	}
Ejemplo n.º 24
0
void spi_isr(void)
{
    portSAVE_CONTEXT();
    static signed portBASE_TYPE xHigherPriorityTaskWoken= pdFALSE;
    //FIO1PIN = FIO1PIN ^ (1<<19);   
    //Between Boilerplate..
    S0SPINT |= (1<<0);      //Clear SPI Interrupt Flag by writing a 1 to it.
    VICVectAddr = 0x0;      // Update VIC hardware
    xSemaphoreGiveFromISR( spi_IntSemaphore, &xHigherPriorityTaskWoken );
    if( xHigherPriorityTaskWoken ) {
	    portYIELD_FROM_ISR();
    }
    
    portRESTORE_CONTEXT();
}
Ejemplo n.º 25
0
/*
 * Called by portYIELD() or taskYIELD() to manually force a context switch.
 */
static void
prvPortYield( void )
{
    asm volatile ( "move.w  #0x2700, %sr\n\t" );
#if _GCC_USES_FP == 1
    asm volatile ( "unlk %fp\n\t" );
#endif
     /* Perform the context switch.  First save the context of the current task. */
    portSAVE_CONTEXT(  );

    /* Find the highest priority task that is ready to run. */
    vTaskSwitchContext(  );

    /* Restore the context of the new task. */
    portRESTORE_CONTEXT(  );
}
Ejemplo n.º 26
0
/*
 * Called by portYIELD() or taskYIELD() to manually force a context switch.
 *
 * When a context switch is performed from the task level the saved task 
 * context is made to look as if it occurred from within the tick ISR.  This
 * way the same restore context function can be used when restoring the context
 * saved from the ISR or that saved from a call to vPortYieldProcessor.
 */
void vPortYieldProcessor( void )
{
	/* Within an IRQ ISR the link register has an offset from the true return 
	address, but an SWI ISR does not.  Add the offset manually so the same 
	ISR return code can be used in both cases. */
	__asm volatile ( "ADD		LR, LR, #4" );

	/* Perform the context switch.  First save the context of the current task. */
	portSAVE_CONTEXT();

	/* Find the highest priority task that is ready to run. */
	__asm volatile( "bl			vTaskSwitchContext" );

	/* Restore the context of the new task. */
	portRESTORE_CONTEXT();	
}
Ejemplo n.º 27
0
void audioIsr_Wrapper( void )
{
    /* Save the context of the interrupted task. */
    portSAVE_CONTEXT();

#ifdef CFG_DEEP_SLEEP
    check_power_mode();
#endif

    /* Call the handler to do the work.  This must be a separate
       function to ensure the stack frame is set up correctly. */
    audio_isr();

    /* Restore the context of whichever task will execute next. */
    portRESTORE_CONTEXT();
}
Ejemplo n.º 28
0
void vFreeRTOS_IRQInterrupt ( void )
{
	/* Save the context of the interrupted task. */
	portSAVE_CONTEXT();

	ulCriticalNesting++;

	__asm volatile( "clrex" );

	/* Call the handler provided with the standalone BSP */
	__asm volatile( "bl IRQInterrupt" );

	ulCriticalNesting--;

	/* Restore the context of the new task. */
	portRESTORE_CONTEXT();
}
Ejemplo n.º 29
0
	void vPreemptiveTick( void )
	{
		/* Save the context of the interrupted task. */
		portSAVE_CONTEXT();	

		/* Increment the RTOS tick count, then look for the highest priority 
		task that is ready to run. */
		__asm volatile( "bl vTaskIncrementTick" );
		__asm volatile( "bl vTaskSwitchContext" );

		/* Ready for the next interrupt. */
		T0IR = 2;
		VICVectAddr = portCLEAR_VIC_INTERRUPT;
		
		/* Restore the context of the new task. */
		portRESTORE_CONTEXT();
	}
Ejemplo n.º 30
0
/*
 * See header file for description.
 */
BaseType_t xPortStartScheduler( void )
{
    /* Setup timer 2 to generate the RTOS tick. */
    prvSetupTimerInterrupt();

    /* Make sure we start with the expected SFR page.  This line should not
    really be required. */
    SFRPAGE = 0;

    /* Copy the stack for the first task to execute from XRAM into the stack,
    restore the task context from the new stack, then start running the task. */
    portCOPY_XRAM_TO_STACK();
    portRESTORE_CONTEXT();

    /* Should never get here! */
    return pdTRUE;
}