CodeProver: Non-terminating loop: condition var is read from HW in interrupt

2 ビュー (過去 30 日間)
Wolfgang Gauch
Wolfgang Gauch 2024 年 10 月 29 日
編集済み: Wolfgang Gauch 2024 年 10 月 29 日
simplified embedded C code:
void main()
{
...
do
{
uint16 voltage = GetVoltage();
} while (voltage > 60);
// voltage is high enough to continue
...
}
uint16 GetVoltage()
{
return m_voltage;
}
interrupt void ReadAdc()
{
if(ADC.ConversionDone = true)
{
m_voltage = ADC.Result;
}
}
Code Prover error for "do":
Non-terminating loop
The loop is infinite or contains a run-time error.
Loop may be infinite.
Is that because Code Prover doesn't know what the ADC.Result returns (it could be 0 forever (which would be OK for this code), or a value bigger than 60)?
Or because of an incorrect interrupt configuration in Polyspace?
I tried adding ReadAdc() to -cyclic-tasks or -interrupts, but that didn't help.

回答 (0 件)

製品


リリース

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by