예제 #1
0
OS_INTERRUPT void Uart0Rx_ISR()
{
	OS_ISR_ENTER();
	_CLI();
	uint8_t ret_val;

	ret_val=Receive_buffer_uart0(cur_address0);
	switch(ret_val)
	{
		case 2:
		{
			UCSR0B=0;
			#if !UART0_MASTER
			efUART0.Signal();
			#endif
			break;
		}
		case 3:
		{
			uart_status0|=UART_RX_OK;
			uart_init0();
			#if !UART0_MASTER
			set_uart0_to_transmitt();
			UCSR0B&=~(1<<RXEN0)|(1<<RXCIE0);
			UCSR0B=(1<<TXEN0)|(1<<TXCIE0);   //разрешение передатчика
			//set_uart0_to_transmitt();
			UDR0='!';
			#endif
			break;


		}
	}
	OS_ISR_EXIT();
}
예제 #2
0
파일: main.cpp 프로젝트: John-Titor/scmrtos
//---------------------------------------------------------------------------
template<> void TProc3::exec()
{
    for(;;)
    {
        sleep(1);
        ef.Signal();

        for(uint_fast8_t i = 0; i < OS::PROCESS_COUNT; ++i)
        {
            StackSlacks[i] = OS::get_proc(i)->stack_slack();
        }
    }
}
예제 #3
0
//void set_uart1_receive();
OS_INTERRUPT void Uart1Tx_ISR()
{
	OS_ISR_ENTER();
	_CLI();
	Transmitt_buffer_uart1();

	#if !UART1_MASTER
	if(uart_status1&UART_TX_OK)
	{
		efUART1.Signal();
	}
	#endif
	OS_ISR_EXIT();
}
예제 #4
0
//-----------------------------------------------------------------------------
//UART0 зовнішній
//UART1 внутрішній
OS_INTERRUPT void Uart1Rx_ISR()
{
	OS_ISR_ENTER();
	_CLI();
	uint8_t ret_val;

	ret_val=Receive_buffer_uart1(cur_address1);
	switch(ret_val)
	{
		case 2:
		{
			UCSR1B=0;
			//#if !UART1_MASTER
				efUART1.Signal();
			//#endif
			break;
		}
		case 3:
		{

			uart_status1|=UART_RX_OK;
			uart_init1();
			#if UART1_MASTER
			//	efUART1.Signal();
			#endif

			#if !UART1_MASTER
				UCSR1B=(1<<TXEN1)|(1<<TXCIE1);   //разрешение передатчика
				set_uart1_to_transmitt();
				UDR1='!';
			#endif


			break;
		}
	}
	OS_ISR_EXIT();
}