zhangyu-duck opened a new pull request, #17975:
URL: https://github.com/apache/nuttx/pull/17975
Summary
arch/tricore: enhanced irq handling:
Support for minimal vectortalbe in Tricore, as Tricore can only support a
maximum src irq number of 255.
Support for GPRS software interrupts.
Impact
enhanced irq handling
Testing
test code follows, use gprs00 to trigger irq, also this irq number is 612,
larger than 255, a good opportunity to test minimal vectortalbes function.
```c
#include <nuttx/config.h>
#include <stdio.h>
#include <arch/irq.h>
#include "tricore_internal.h"
#include "IfxInt_reg.h"
#include "IfxSrc.h"
#include "IfxCpu.h"
#define gpsr_irq TRICORE_GPSR_IRQNUM(up_this_cpu(), up_this_cpu())
volatile int gprs_irq_flag = 0;
static int gpsr_interrupt(int irq, void *context, void *arg)
{
gprs_irq_flag++;
return 0;
}
int gpsr_interrupt_test(void)
{
irq_attach(gpsr_irq, gpsr_interrupt, NULL);
up_enable_irq(gpsr_irq);
cpu_set_t cpuset;
CPU_ZERO(&cpuset);
CPU_SET(up_this_cpu(), &cpuset);
up_trigger_irq(gpsr_irq, cpuset);
return 0;
}
```
and we can see result:
nsh> hello
after trigger: 0
nsh>
nsh> hello
after trigger: 1
nsh> hello
after trigger: 2
nsh> hello
after trigger: 3
nsh> hello
after trigger: 4
nsh> hello
after trigger: 5
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]