CodeProver: Non-terminating loop: condition var is read from HW in interrupt
2 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Run Settings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!