easy_wakeup function is not scheduled

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
2 posts / 0 new
Last post
GAK
Offline
Last seen:1 year 8 months ago
加入:2018-10-01 11:18
easy_wakeup function is not scheduled

Hi Team,

I am merging the Sleep mode example on ble_app_peripheral example.

I am facing the following proble on it,

1)app_easy_wakeup ( ) is not working on peripheral project.

code snipet :

void app_button_enable(void)
{

app_easy_wakeup_set(app_wakeup_cb);
wkupct_register_callback(app_button_press_cb);
wkupct_enable_irq(WKUPCT_PIN_SELECT(EN_SLEEP_GPIO_PORT, EN_SLEEP_GPIO_PIN), // select pin (GPIO_BUTTON_PORT, GPIO_BUTTON_PIN)
WKUPCT_PIN_POLARITY(EN_SLEEP_GPIO_PORT, EN_SLEEP_GPIO_PIN, WKUPCT_PIN_POLARITY_HIGH), // polarity low
1, / / 1事件
40); // debouncing time = 0
}
static void app_wakeup_cb(void)
{
// If state is not idle, ignore the message
if (ke_state_get(TASK_APP) == APP_CONNECTABLE)
{
//
user_app_adv_start();
}
}
/**
****************************************************************************************
* @brief Button press callback function. Registered in WKUPCT driver.
* @return void
****************************************************************************************
*/
void app_button_press_cb(void)
{

if (GetBits16(SYS_STAT_REG, PER_IS_DOWN))
{
periph_init();
}
if (arch_ble_ext_wakeup_get())
{

arch_set_sleep_mode(ARCH_SLEEP_OFF);
arch_ble_force_wakeup();
adv_stop = 0;
wkup_flag= true;
GPIO_SetInactive( GPIO_PORT_0, GPIO_PIN_7 );
uint8_t pkt[10] = {22, 00, 00, 10, 00, 10, 00, 00,00,00};//wakeup responces
uart2_write((uint8_t*)pkt, 10, uartcback);
arch_ble_ext_wakeup_off();
app_easy_wakeup();
// user_app_adv_start();
}
}

Could you please explien how to use the app_easy_wakeup function on peripheral project ?

Kindly give your support on it ASAP.

Thanks,

Device:
PM_Dialog
Offline
Last seen:46 min 23 sec ago
工作人员
加入:2018-02-08 11:03
Hi GAK,

Hi GAK,

What do you mean that the app_easy_wakeup_set() is not working? You mentioned that you are using the ble_app_peripheral example, so can you please make sure that the device goes into sleep as demonstrated in ble_app_sleepmode example? If yes, are you able to wake up? Can you please add a break point in the wake-up callback functions and run your code in debug mode?

Thanks, PM_Dialog