Merge pull request #96 from weety/at91sam9260
use __rt_ffs instead of ffs
This commit is contained in:
commit
521e331dbf
@ -210,37 +210,6 @@ rt_inline rt_uint32_t fls(rt_uint32_t val)
|
|||||||
return bit;
|
return bit;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(__GNUC__) || defined(__CC_ARM)
|
|
||||||
rt_inline rt_uint32_t ffs(rt_uint32_t x)
|
|
||||||
{
|
|
||||||
int r = 1;
|
|
||||||
|
|
||||||
if (!x)
|
|
||||||
return 0;
|
|
||||||
if (!(x & 0xffff)) {
|
|
||||||
x >>= 16;
|
|
||||||
r += 16;
|
|
||||||
}
|
|
||||||
if (!(x & 0xff)) {
|
|
||||||
x >>= 8;
|
|
||||||
r += 8;
|
|
||||||
}
|
|
||||||
if (!(x & 0xf)) {
|
|
||||||
x >>= 4;
|
|
||||||
r += 4;
|
|
||||||
}
|
|
||||||
if (!(x & 3)) {
|
|
||||||
x >>= 2;
|
|
||||||
r += 2;
|
|
||||||
}
|
|
||||||
if (!(x & 1)) {
|
|
||||||
x >>= 1;
|
|
||||||
r += 1;
|
|
||||||
}
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void mmcsd_host_lock(struct rt_mmcsd_host *host);
|
void mmcsd_host_lock(struct rt_mmcsd_host *host);
|
||||||
void mmcsd_host_unlock(struct rt_mmcsd_host *host);
|
void mmcsd_host_unlock(struct rt_mmcsd_host *host);
|
||||||
void mmcsd_req_complete(struct rt_mmcsd_host *host);
|
void mmcsd_req_complete(struct rt_mmcsd_host *host);
|
||||||
|
@ -493,7 +493,7 @@ rt_uint32_t mmcsd_select_voltage(struct rt_mmcsd_host *host, rt_uint32_t ocr)
|
|||||||
|
|
||||||
ocr &= host->valid_ocr;
|
ocr &= host->valid_ocr;
|
||||||
|
|
||||||
bit = ffs(ocr);
|
bit = __rt_ffs(ocr);
|
||||||
if (bit)
|
if (bit)
|
||||||
{
|
{
|
||||||
bit -= 1;
|
bit -= 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user