Skip to content

Commit d02b2f8

Browse files
committed
Issue #1060 - Fixed LR1110 driver IrqFired variable management
1 parent 3a87be3 commit d02b2f8

File tree

5 files changed

+30
-0
lines changed

5 files changed

+30
-0
lines changed

src/boards/NucleoL073/lr1110mb1xxs-board.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ uint32_t lr1110_board_get_tcxo_wakeup_time( const void* context )
9797
return BOARD_TCXO_WAKEUP_TIME;
9898
}
9999

100+
uint32_t lr1110_get_dio_1_pin_state( const void* context )
101+
{
102+
return GpioRead( &( ( lr1110_t* ) context )->dio_1 );
103+
}
104+
100105
void lr1110_board_init( const void* context, lr1110_dio_irq_handler dio_irq )
101106
{
102107
lr1110_system_reset( context );

src/boards/NucleoL152/lr1110mb1xxs-board.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ uint32_t lr1110_board_get_tcxo_wakeup_time( const void* context )
9797
return BOARD_TCXO_WAKEUP_TIME;
9898
}
9999

100+
uint32_t lr1110_get_dio_1_pin_state( const void* context )
101+
{
102+
return GpioRead( &( ( lr1110_t* ) context )->dio_1 );
103+
}
104+
100105
void lr1110_board_init( const void* context, lr1110_dio_irq_handler dio_irq )
101106
{
102107
lr1110_system_reset( context );

src/boards/NucleoL476/lr1110mb1xxs-board.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ uint32_t lr1110_board_get_tcxo_wakeup_time( const void* context )
9797
return BOARD_TCXO_WAKEUP_TIME;
9898
}
9999

100+
uint32_t lr1110_get_dio_1_pin_state( const void* context )
101+
{
102+
return GpioRead( &( ( lr1110_t* ) context )->dio_1 );
103+
}
104+
100105
void lr1110_board_init( const void* context, lr1110_dio_irq_handler dio_irq )
101106
{
102107
lr1110_system_reset( context );

src/boards/lr1110-board.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ void lr1110_board_set_rf_tx_power( const void* context, int8_t power );
6262
*/
6363
uint32_t lr1110_board_get_tcxo_wakeup_time( const void* context );
6464

65+
/*!
66+
* \brief Gets current state of DIO1 pin state.
67+
*
68+
* \retval state DIO1 pin current state.
69+
*/
70+
uint32_t lr1110_get_dio_1_pin_state( const void* context );
71+
6572
/*!
6673
* \brief Initializes the radio driver
6774
*/

src/radio/lr1110/radio.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,6 +1215,14 @@ static void lr1110_system_irq_process( const void* radio, uint32_t* irq )
12151215
lr1110_system_get_status( radio, &stat1, &stat2, irq );
12161216
lr1110_system_clear_irq( radio, *irq );
12171217

1218+
// Check if DIO1 pin is High. If it is the case revert IrqFired to true
1219+
CRITICAL_SECTION_BEGIN( );
1220+
if( lr1110_get_dio_1_pin_state( radio ) == 1 )
1221+
{
1222+
IrqFired = true;
1223+
}
1224+
CRITICAL_SECTION_END( );
1225+
12181226
if( ( ( *irq & LR1110_SYSTEM_IRQ_TXDONE_MASK ) != 0 ) || ( ( *irq & LR1110_SYSTEM_IRQ_CADDONE_MASK ) != 0 ) ||
12191227
( ( *irq & LR1110_SYSTEM_IRQ_TIMEOUT_MASK ) != 0 ) )
12201228
{

0 commit comments

Comments
 (0)