Skip to content

Commit

Permalink
Fix register corruption due to colliding SPI transactions in FSK
Browse files Browse the repository at this point in the history
In FSK Tx, the Dio1 interrupt may already fire while the SPI transaction for
SetOpMode is still in progress. This leads to registers 0x02 and further being
overwritten with junk data.

This is solved by disabling interrupts for this specific SetOpMode call.
  • Loading branch information
mvds00 committed Jul 16, 2023
1 parent 2bf36bd commit 51f792a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/radio/sx1276/sx1276.c
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,9 @@ static void SX1276SetTx( uint32_t timeout )

SX1276.Settings.State = RF_TX_RUNNING;
TimerStart( &TxTimeoutTimer );
CRITICAL_SECTION_BEGIN();
SX1276SetOpMode( RF_OPMODE_TRANSMITTER );
CRITICAL_SECTION_END();
}

void SX1276StartCad( void )
Expand Down

0 comments on commit 51f792a

Please sign in to comment.