diff options
| author | hipeanut <[email protected]> | 2022-08-02 11:18:17 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-08-01 23:18:17 -0400 |
| commit | 7882e42c614c24a1750cba4a3e2936b6bf68f42f (patch) | |
| tree | 5eabeda05b0e79e6042f80eca21ec4549c4b91b3 /bsp | |
| parent | 2a7da005bad425a9fc847f9590f4573f714d0846 (diff) | |
[bsp/raspi3-32] fix some bug of funtion '__rt_ffs' (#6187)
* [bsp/raspi3-32] fix some bug of funtion '__rt_ffs'
* Update trap.c
Co-authored-by: Man, Jianting (Meco) <[email protected]>
Diffstat (limited to 'bsp')
| -rwxr-xr-x[-rw-r--r--] | bsp/raspberry-pi/raspi3-32/cpu/trap.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/bsp/raspberry-pi/raspi3-32/cpu/trap.c b/bsp/raspberry-pi/raspi3-32/cpu/trap.c index c4d0d08e1a..26893e2a49 100644..100755 --- a/bsp/raspberry-pi/raspi3-32/cpu/trap.c +++ b/bsp/raspberry-pi/raspi3-32/cpu/trap.c @@ -133,7 +133,12 @@ void rt_hw_trap_resv(struct rt_hw_exp_stack *regs) #ifdef RT_USING_CPU_FFS int __rt_ffs(int value) { - int num = 0; + if (!value) + { + return 0; + } + + int num = 1; if ((value & 0xffff) == 0) { |
