1.优化蓝牙驱动加载
This commit is contained in:
parent
25c0d5f992
commit
e22ee707d8
|
@ -31,6 +31,7 @@
|
|||
#include <net/if.h>
|
||||
#include "sf_blue_app.h"
|
||||
#include "sf_device.h"
|
||||
#include "sf_hal_gpio.h"
|
||||
|
||||
extern int hciconfig_start_advertising(const char *ssid);
|
||||
extern int hciconfig_close_device(void);
|
||||
|
@ -106,6 +107,7 @@ static void sf_bluetooth_power_enable(void)
|
|||
// system("echo 44 > /sys/class/gpio/export");
|
||||
// system("echo out > /sys/class/gpio/gpio44/direction");
|
||||
// system("echo 1 > /sys/class/gpio/gpio44/value");
|
||||
sf_set_bt_en(1);
|
||||
}
|
||||
|
||||
/*************************************************
|
||||
|
@ -128,7 +130,6 @@ static void *sf_bluetooth_piscan_task(void *arg)
|
|||
{
|
||||
UINT8 i = 0;
|
||||
sf_bluetooth_power_enable();
|
||||
|
||||
//system("export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/misc:/customer/rocus/lib");
|
||||
//system("adduser messagebus");
|
||||
|
||||
|
@ -150,16 +151,24 @@ static void *sf_bluetooth_piscan_task(void *arg)
|
|||
// }
|
||||
// }
|
||||
// }
|
||||
for (i = 0; i < 40; i++) {
|
||||
if (sf_system_check_bt_ko() == TRUE) {
|
||||
for (i = 0; i < 40; i++)
|
||||
{
|
||||
if (sf_system_check_bt_ko() == TRUE)
|
||||
{
|
||||
break;
|
||||
} else {
|
||||
usleep(500 * 1000);
|
||||
if(39 == i)
|
||||
}
|
||||
else
|
||||
{
|
||||
if(39 == 1)
|
||||
{
|
||||
sf_load_bt_ko();
|
||||
}
|
||||
else if(39 == i)
|
||||
{
|
||||
MLOGE("blue setup fall!!\n");
|
||||
return NULL;
|
||||
}
|
||||
usleep(500 * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user