CodeProver: Non-terminating loop: condition var is read from HW in interrupt
1 view (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on Run Settings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!