In use W801 platform Demo Board debugging BLE when, encountered FreeRToS System related problems, Refer to NimBLE Open source library, operational SDK The version is W80X_SDK_v1. 00. 10.
The project development requirement is to add Bluetooth physical switch buttons, I added it myself BLE The key control logic code is as follows:
(Initialize here BLE On by default, Actually use instruction testing or delay testing API The call is fine, But interrupting the test with a key is problematic, Debug logs are as follows, Please also help find the cause! )
static void ble_gpio_isr_callback (void *context)
{
u8 ret = 0;
ret = tls_get_gpio_irq_status (BLE_BUTTON_GPIO) ;
if (ret)
{
printf ("ble button interrupt happen! \n") ;
tls_clr_gpio_irq_status (BLE_BUTTON_GPIO) ;
ble_button_check () ;
}
return;
}
void ble_button_init (void)
{
tls_gpio_cfg (BLE_BUTTON_GPIO, WM_GPIO_DIR_INPUT, WM_GPIO_ATTR_PULLHIGH) ;
tls_gpio_isr_register (BLE_BUTTON_GPIO, ble_gpio_isr_callback, NULL) ;
tls_gpio_irq_enable (BLE_BUTTON_GPIO, WM_GPIO_IRQ_TRIG_LOW_LEVEL) ;
ble_init () ;
return;
}
void ble_init (void)
{
u8 ret = 0;
ret = tls_gpio_read (BLE_BUTTON_GPIO) ;
printf ("ble button check status value =%d\n", ret) ;
if (ret)
{
demo_bt_enable () ;
tls_os_time_delay (1000) ;
demo_ble_server_on () ;
}
return;
}
void ble_button_check (void)
{
u8 ret = 0;
ret = tls_gpio_read (BLE_BUTTON_GPIO) ;
printf ("button check status value =%d\n", ret) ;
if (ret)
{
demo_bt_enable () ;
tls_os_time_delay (1000) ;
demo_ble_server_on () ;
}
else
{
demo_bt_destroy () ;
}
return;
}
Well, I tried to create a task to test it