1.优化蓝牙驱动加载

This commit is contained in:
payton 2024-01-08 13:55:41 +08:00
parent 25c0d5f992
commit e22ee707d8

View File

@ -31,6 +31,7 @@
#include <net/if.h> #include <net/if.h>
#include "sf_blue_app.h" #include "sf_blue_app.h"
#include "sf_device.h" #include "sf_device.h"
#include "sf_hal_gpio.h"
extern int hciconfig_start_advertising(const char *ssid); extern int hciconfig_start_advertising(const char *ssid);
extern int hciconfig_close_device(void); 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 44 > /sys/class/gpio/export");
// system("echo out > /sys/class/gpio/gpio44/direction"); // system("echo out > /sys/class/gpio/gpio44/direction");
// system("echo 1 > /sys/class/gpio/gpio44/value"); // 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; UINT8 i = 0;
sf_bluetooth_power_enable(); sf_bluetooth_power_enable();
//system("export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/misc:/customer/rocus/lib"); //system("export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/misc:/customer/rocus/lib");
//system("adduser messagebus"); //system("adduser messagebus");
@ -150,16 +151,24 @@ static void *sf_bluetooth_piscan_task(void *arg)
// } // }
// } // }
// } // }
for (i = 0; i < 40; i++) { for (i = 0; i < 40; i++)
if (sf_system_check_bt_ko() == TRUE) { {
if (sf_system_check_bt_ko() == TRUE)
{
break; break;
} else { }
usleep(500 * 1000); else
if(39 == i) {
if(39 == 1)
{
sf_load_bt_ko();
}
else if(39 == i)
{ {
MLOGE("blue setup fall!!\n"); MLOGE("blue setup fall!!\n");
return NULL; return NULL;
} }
usleep(500 * 1000);
} }
} }