MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_pic_irq_set_priority

Function rt_pic_irq_set_priority

components/drivers/pic/pic.c:778–805  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

776}
777
778rt_err_t rt_pic_irq_set_priority(int irq, rt_uint32_t priority)
779{
780 rt_err_t err = -RT_EINVAL;
781 struct rt_pic_irq *pirq = irq2pirq(irq);
782
783 if (pirq)
784 {
785 rt_hw_spin_lock(&pirq->rw_lock.lock);
786
787 if (pirq->pic->ops->irq_set_priority)
788 {
789 err = pirq->pic->ops->irq_set_priority(pirq, priority);
790
791 if (!err)
792 {
793 pirq->priority = priority;
794 }
795 }
796 else
797 {
798 err = -RT_ENOSYS;
799 }
800
801 rt_hw_spin_unlock(&pirq->rw_lock.lock);
802 }
803
804 return err;
805}
806
807rt_uint32_t rt_pic_irq_get_priority(int irq)
808{

Callers

nothing calls this directly

Calls 3

irq2pirqFunction · 0.85
rt_hw_spin_lockFunction · 0.50
rt_hw_spin_unlockFunction · 0.50

Tested by

no test coverage detected