Esempio n. 1
0
void uart2_error(void)
{
    // ************************
    // Interrupt Entry
    // ************************
#if __GNUC__
	OS_SAVE_ISR();
#endif

	OS_INT_ENTER();

	// Tratamento da interrupção
	(void) SCI2S1; /* Leitura do registrador SCIxS1 para analisar o estado da transmissão */
	(void) SCI2C3; /* Leitura do registrador SCIxC3 para limpar o bit de paridade */

	// A próxima ação depende do tipo de erro
	// Devemos analisar o erro ocorrido e tomar uma das atitudes abaixo
	(void) SCI2D; // Leitura do registrador SCIxD para limpar os indicativos de erro.
	SCI2D = 0; // Escrita no registrador SCIxD para limpar os indicativos de erro. 

#if (NESTING_INT == 1)
	OS_ENABLE_NESTING();
#endif  

	// ************************
	// Interrupt Exit
	// ************************
	OS_INT_EXIT();
	// ************************
#if __GNUC__
	OS_RESTORE_ISR();
#endif
}
Esempio n. 2
0
/************************************************************//**
* \fn interrupt void SwitchContext(void)
* \brief Software interrupt handler routine (Internal kernel function).
*  Used to switch the tasks context.
****************************************************************/
void SwitchContext(void)
{
  // ************************
  // Entrada de interrupção
  // ************************
  OS_SAVE_ISR();

  // Interrupt Handling
  Clear_PendSV();

  // ************************
  // Interrupt Exit
  // ************************
  OS_EXIT_INT();
  OS_RESTORE_ISR();
  // ************************
}
Esempio n. 3
0
File: HAL.c Progetto: dns/BRTOS
/************************************************************//**
* \fn interrupt void SwitchContext(void)
* \brief Software interrupt handler routine (Internal kernel function).
*  Used to switch the tasks context.
****************************************************************/
void SwitchContext(void)
{
  // ************************
  // Entrada de interrupção
  // ************************
  OS_SAVE_ISR();
  OS_INT_ENTER();

  // Interrupt Handling
  
  // ************************
  // Interrupt Exit
  // ************************
  OS_INT_EXIT();  
  OS_RESTORE_ISR();
  // ************************
}
Esempio n. 4
0
File: HAL.c Progetto: XNerv/brtos
void SwitchContext(void)
{

    // as MSP430 does not have sw interrupt, we save 7 regs to make it appear like one.
    // save 7 regs
    OS_SAVE_ISR();

    // ************************
    // Entrada de interrupção
    // ************************
    OS_INT_ENTER();

    // Interrupt Handling
    // ************************
    // Interrupt Exit
    // ************************
    OS_INT_EXIT();

    // ************************
    OS_RESTORE_ISR();
}
Esempio n. 5
0
File: HAL.c Progetto: dns/BRTOS
void TickTimer(void)
{
  // ************************
  // Entrada de interrupção
  // ************************
  OS_SAVE_ISR();
  OS_INT_ENTER();
  
  // Interrupt handling
  TICKTIMER_INT_HANDLER;

  OSIncCounter();
  
  // BRTOS TRACE SUPPORT
  #if (OSTRACE == 1) 
      #if(OS_TICK_SHOW == 1) 
          #if(OS_TRACE_BY_TASK == 1)
          Update_OSTrace(0, ISR_TICK);
          #else
          Update_OSTrace(configMAX_TASK_INSTALL - 1, ISR_TICK);
          #endif         
      #endif       
  #endif  

  #if (NESTING_INT == 1)
  OS_ENABLE_NESTING();
  #endif   
    
  // ************************
  // Handler code for the tick
  // ************************
  OS_TICK_HANDLER();
  
  // ************************
  // Interrupt Exit
  // ************************
  OS_INT_EXIT();
  OS_RESTORE_ISR();  
  // ************************  
}
Esempio n. 6
0
void uart2_tx(void)
{
    // ************************
    // Interrupt Entry
    // ************************
#if __GNUC__
	OS_SAVE_ISR();
#endif

	OS_INT_ENTER();

	// Tratamento da interrupção
#if (__GNUC__)
	BITCLEARMASK(SCI2C2,SCI2C2_TCIE_MASK);
#else
	SCI2C2_TCIE = 0;
#endif

	(void) SCI2S1; /* Leitura do registrador SCIxS1 para analisar o estado da transmissão */
	(void) SCI2C3; /* Leitura do registrador SCIxC3 para limpar o bit de paridade */

#if (NESTING_INT == 1)
	OS_ENABLE_NESTING();
#endif  


	(void) OSSemPost(SerialTX2);

	// ************************
	// Interrupt Exit
	// ************************
	OS_INT_EXIT();
	// ************************
#if __GNUC__
	OS_RESTORE_ISR();
#endif
}
Esempio n. 7
0
void uart2_rx(void)
{

	// ************************
    // Interrupt Entry
    // ************************
#if __GNUC__
	OS_SAVE_ISR();
#endif

	OS_INT_ENTER();

	// Tratamento da interrupção
	(void) SCI2S1; /* Leitura do registrador SCIxS1 para analisar o estado da transmissão */
	(void) SCI2C3; /* Leitura do registrador SCIxC3 para limpar o bit de paridade */
	receive_byte2 = SCI2D; /* Leitura dos dados recebidos */

#if (NESTING_INT == 1)
	OS_ENABLE_NESTING();
#endif  

	if (OSQueuePost(Serial2, receive_byte2) == BUFFER_UNDERRUN)
	{
		// Problema: Estouro de buffer
		OSQueueClean(Serial2);
	}

	// ************************
	// Interrupt Exit
	// ************************
	OS_INT_EXIT();
	// ************************
#if __GNUC__
	OS_RESTORE_ISR();
#endif
}