irq_procfs: fix divide 0 error
Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
parent
df365008b2
commit
3bc2131918
|
@ -206,6 +206,7 @@ static int irq_callback(int irq, FAR struct irq_info_s *info,
|
|||
* rate = <interrupt-count> * TICKS_PER_SEC / elapsed
|
||||
*/
|
||||
|
||||
elapsed = elapsed ? elapsed : 1;
|
||||
intpart = (unsigned int)((copy.count * TICK_PER_SEC) / elapsed);
|
||||
if (intpart >= 10000)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue