优化设置中断模式api (#7359)

This commit is contained in:
wangqinglin 2023-04-24 14:16:21 +08:00 committed by GitHub
parent fec989a69f
commit ac07f40670
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 2 deletions

View File

@ -237,7 +237,7 @@ unsigned int rt_hw_interrupt_get_target_cpus(int vector)
*/
void rt_hw_interrupt_set_triger_mode(int vector, unsigned int mode)
{
arm_gic_set_configuration(0, vector, mode);
arm_gic_set_configuration(0, vector, mode & IRQ_MODE_MASK);
}
/**

View File

@ -19,6 +19,7 @@
#define IRQ_MODE_TRIG_LEVEL (0x00) /* Trigger: level triggered interrupt */
#define IRQ_MODE_TRIG_EDGE (0x01) /* Trigger: edge triggered interrupt */
#define IRQ_MODE_MASK (0x01)
void rt_hw_vector_init(void);

View File

@ -179,7 +179,7 @@ unsigned int rt_hw_interrupt_get_target_cpus(int vector)
*/
void rt_hw_interrupt_set_triger_mode(int vector, unsigned int mode)
{
arm_gic_set_configuration(0, vector, mode);
arm_gic_set_configuration(0, vector, mode & IRQ_MODE_MASK);
}
/**

View File

@ -19,6 +19,7 @@
#define IRQ_MODE_TRIG_LEVEL (0x00) /* Trigger: level triggered interrupt */
#define IRQ_MODE_TRIG_EDGE (0x01) /* Trigger: edge triggered interrupt */
#define IRQ_MODE_MASK (0x01)
void rt_hw_vector_init(void);