e03342ff6b
- added new boards: hpm5300evk, hpm5301evklite and hpm6800evk - upgaded hpm_sdk - driver updates and bugfixes - add hpmicro BSPs to CI Signed-off-by: Fan YANG <fan.yang@hpmicro.com>
23 lines
321 B
C
23 lines
321 B
C
/*
|
|
* Copyright (c) 2021 HPMicro
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*
|
|
*/
|
|
|
|
#include "hpm_common.h"
|
|
|
|
int __ffssi2(int x)
|
|
{
|
|
uint32_t i = 0;
|
|
if (!x) {
|
|
return 0;
|
|
}
|
|
for (i = 0; (i < sizeof(x) * 8 - 1); i++) {
|
|
if ((x >> i) & 1) {
|
|
break;
|
|
}
|
|
}
|
|
return i + 1;
|
|
}
|