mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +08:00
irq_procfs: fix divide 0 error
Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
@@ -206,6 +206,7 @@ static int irq_callback(int irq, FAR struct irq_info_s *info,
|
|||||||
* rate = <interrupt-count> * TICKS_PER_SEC / elapsed
|
* rate = <interrupt-count> * TICKS_PER_SEC / elapsed
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
elapsed = elapsed ? elapsed : 1;
|
||||||
intpart = (unsigned int)((copy.count * TICK_PER_SEC) / elapsed);
|
intpart = (unsigned int)((copy.count * TICK_PER_SEC) / elapsed);
|
||||||
if (intpart >= 10000)
|
if (intpart >= 10000)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user