delete radio before thi=0 - fixes spurious interrupts during RadioContex deleting.

pull/1339/head
Wojciech Gorniak 2015-09-07 12:20:36 +02:00
parent f22236b460
commit b6169668b7
2 changed files with 21 additions and 1 deletions

View File

@ -58,6 +58,12 @@ SX1272MB1xAS::SX1272MB1xAS( void ( *txDone )( ), void ( *txTimeout ) ( ), void (
this->settings.State = IDLE ; this->settings.State = IDLE ;
} }
SX1272MB1xAS::~SX1272MB1xAS ( )
{
IoIrqDeInit( );
};
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
// Board relative functions // Board relative functions
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
@ -107,6 +113,15 @@ void SX1272MB1xAS::IoIrqInit( DioIrqHandler *irqHandlers )
dio4.rise( this, static_cast< TriggerMB1xASSX1272 > ( irqHandlers[4] ) ); dio4.rise( this, static_cast< TriggerMB1xASSX1272 > ( irqHandlers[4] ) );
} }
void SX1272MB1xAS::IoIrqDeInit( )
{
dio0.disable_irq();
dio1.disable_irq();
dio2.disable_irq();
dio3.disable_irq();
dio4.disable_irq();
}
void SX1272MB1xAS::IoDeInit( void ) void SX1272MB1xAS::IoDeInit( void )
{ {
//nothing //nothing

View File

@ -37,7 +37,7 @@ public:
PinName dio0, PinName dio1, PinName dio2, PinName dio3, PinName dio4, PinName dio5, PinName dio0, PinName dio1, PinName dio2, PinName dio3, PinName dio4, PinName dio5,
PinName antSwitch ); PinName antSwitch );
virtual ~SX1272MB1xAS( ) { }; virtual ~SX1272MB1xAS( );
protected: protected:
/*! /*!
@ -62,6 +62,11 @@ public:
*/ */
virtual void IoIrqInit( DioIrqHandler *irqHandlers ); virtual void IoIrqInit( DioIrqHandler *irqHandlers );
/*!
* @brief Deinitializes DIO IRQ handlers (switches off interrupts)
*/
virtual void IoIrqDeInit( void );
/*! /*!
* @brief De-initializes the radio I/Os pins interface. * @brief De-initializes the radio I/Os pins interface.
* *