Polyspace errors cause from "@interrupt"
조회 수: 5 (최근 30일)
이전 댓글 표시
Hello Matlab Community
I use Polyspace R2022b for verify code for s12z Cosmic compiler.
In Cosmic compiler, for use interrupt, @interrupt code is needed.
ex) @interrupt void ISR_TIMER(void);
But Polyspace is not allowed this I think.
I also tried add "@interrupt=" at macro option but couldn't solve it.
How to do sovle this problem?
댓글 수: 0
답변 (2개)
Anirban
2025년 4월 21일
Setting the compiler option in Polyspace to Cosmic will get you past the error. For more information, see Cosmic Compiler.
For instance, this code will compile with the option -compiler cosmic, but fail compilation otherwise.
// Interrupt Service Routine for Timer 2 Overflow
@interrupt void ISR_TIMER2_OVF(void)
{
}
void main(void)
{
while (1)
{
// Main loop does nothing; LED toggling is handled in ISR
}
}
댓글 수: 0
Christian Bard
2025년 4월 22일
If you are not setting -compiler cosmic, you may use a Perl -post-preprocessing-command script like below (see doc):
#!/usr/bin/perl
#
binmode STDOUT;
while ($line = <STDIN>)
{
# comment @interrupt
$line =~ s/(\@interrupt)/\/\* $1 \*\/ /g;
print $line;
}
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Troubleshoot Compilation Errors에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!