Commit 7453be4d authored by Nikolay Markovich's avatar Nikolay Markovich Committed by Sudan Landge
Browse files

Bug fix in GIC_GetConfiguration() (#217)

Bit shift in accordance with IRQn % 16 was incorrect, and masking was
needed to extract only the IRQn bits. Both fixed.
parent 90bb4428
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1645,7 +1645,7 @@ __STATIC_INLINE void GIC_SetConfiguration(IRQn_Type IRQn, uint32_t int_config)
*/
__STATIC_INLINE uint32_t GIC_GetConfiguration(IRQn_Type IRQn)
{
  return (GICDistributor->ICFGR[IRQn / 16U] >> ((IRQn % 16U) >> 1U));
  return (GICDistributor->ICFGR[IRQn / 16U] >> ((IRQn % 16U) << 1U)) & 3UL;
}

/** \brief Set the priority for the given interrupt in the GIC's IPRIORITYR register.