File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
hardware/arduino/sam/cores/arduino Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,16 @@ void UARTClass::end( void )
9090 pmc_disable_periph_clk ( _dwId ) ;
9191}
9292
93+ void UARTClass::setInterruptPriority (uint32_t priority)
94+ {
95+ NVIC_SetPriority (_dwIrq, priority & 0x0F );
96+ }
97+
98+ uint32_t UARTClass::getInterruptPriority ()
99+ {
100+ return NVIC_GetPriority (_dwIrq);
101+ }
102+
93103int UARTClass::available ( void )
94104{
95105 return (uint32_t )(SERIAL_BUFFER_SIZE + _rx_buffer->_iHead - _rx_buffer->_iTail ) % SERIAL_BUFFER_SIZE ;
Original file line number Diff line number Diff line change @@ -48,6 +48,8 @@ class UARTClass : public HardwareSerial
4848 int read ( void ) ;
4949 void flush ( void ) ;
5050 size_t write ( const uint8_t c ) ;
51+ void setInterruptPriority (uint32_t priority);
52+ uint32_t getInterruptPriority ();
5153
5254 void IrqHandler ( void ) ;
5355
You can’t perform that action at this time.
0 commit comments