Skip to content

Commit

Permalink
Merge pull request FreeRTOS#11 from Mixaill/dev-stm32-fixprio
Browse files Browse the repository at this point in the history
Fix priority set
  • Loading branch information
HTRamsey authored Jan 22, 2024
2 parents 3b85eae + 86fcd67 commit 4a8f60a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions source/portable/NetworkInterface/STM32/NetworkInterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -1038,12 +1038,11 @@ static BaseType_t prvEthConfigInit( ETH_HandleTypeDef * pxEthHandle, const Netwo
}
#endif

uint32_t ulPreemptPriority, ulSubPriority;
HAL_NVIC_GetPriority( ETH_IRQn, HAL_NVIC_GetPriorityGrouping(), &ulPreemptPriority, &ulSubPriority );
if( ulPreemptPriority < configMAX_FREERTOS_INTERRUPT_PRIORITY )
uint32_t ulPriority = NVIC_GetPriority( ETH_IRQn ) << ( 8 - configPRIO_BITS );
if( ulPriority < configMAX_SYSCALL_INTERRUPT_PRIORITY )
{
FreeRTOS_debug_printf( ( "prvEthConfigInit: Incorrectly set ETH_IRQn priority\n" ) );
HAL_NVIC_SetPriority( ETH_IRQn, ( uint32_t ) configMAX_FREERTOS_INTERRUPT_PRIORITY, 0 );
NVIC_SetPriority( ETH_IRQn, configMAX_SYSCALL_INTERRUPT_PRIORITY >> ( 8 - configPRIO_BITS ) );
}
if( NVIC_GetEnableIRQ( ETH_IRQn ) == 0 )
{
Expand Down

0 comments on commit 4a8f60a

Please sign in to comment.