Fixed USART1

This commit is contained in:
BlackMark 2016-05-20 22:33:47 +02:00
parent ef24096b04
commit 8e249b46b5
2 changed files with 31 additions and 0 deletions

View File

@ -379,8 +379,20 @@ ISR( USART0_UDRE_vect_D )
USART0::inst().transmitInterruptHandler();
}
/************************************************************************/
/************************************************************************/
#ifdef SECOND_USART
//////////////////////////////////////////////////////////////////////////
USART1 USART1::sm_cInstance;
//////////////////////////////////////////////////////////////////////////
USART1& USART1::inst()
{
return sm_cInstance;
}
//////////////////////////////////////////////////////////////////////////
USART1::USART1()
{
@ -392,4 +404,16 @@ USART1::USART1()
m_vui8pUDR = &UDR1;
}
//////////////////////////////////////////////////////////////////////////
ISR( USART1_RX_vect_D )
{
USART1::inst().receiveInterruptHandler();
}
//////////////////////////////////////////////////////////////////////////
ISR( USART1_UDRE_vect_D )
{
USART1::inst().transmitInterruptHandler();
}
#endif

View File

@ -151,6 +151,13 @@ public:
class USART1 : public USART0
{
public:
static USART1& inst();
USART1( const USART1& ) = delete;
void operator=( const USART1& ) = delete;
private:
static USART1 sm_cInstance;
USART1();
};