⚠️
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
diogenes
Offline
Last seen:2 years 5 months ago
Joined:2018-10-04 05:09
about GLOBAL_INT_STOP

Hi, Dialog,

I have a question about how to allow peripheral interrupt in the while loop in main_func() in ble_app_all_in_one project in DA1458x_SDK sample.
As sample code, under the normal condition if (BLE_APP_PRESENT), always GLOBAL_INT_STOP() is called.
I guess if IRQ is always disabled in the infinite loop, any normal peripheral interrupt are never detected, is it right?
年代o if you use some peripheral interrupt, I think you should delete the GLOBAL_INT_STOP().
And I feel strange that WFI() is called in the if (BLE_APP_PRESENT) clause, so why IRQ must be disabled.
Is it right or are there any other ways to allow peripheral interrupt in main loop?

I'm looking forward someone's good answers.

Best,

Device:
PM_Dialog
Offline
Last seen:1 day 17 hours ago
年代taff
Joined:2018-02-08 11:03
Hi diogenes,

Hi diogenes,

The GLOBAL_INT_STOP() macro is used when the system wants to disable all the interrupt it could handle. This macro is called just before the device enters the sleep, and not when it is in sleep mode. This means that after this macro, the system will be continuing to receive interrupts, but only the handlers of the interrupts will no be triggered. The WFI() is called while the interrupts are disabled to have performed the checks necessary to decide to move to sleep mode. If there are any pending interrupts before sleep, the GLOBAL_INT_START() will be triggered and the interrupts can start being handled again by the system. So, your conclusion that if IRQ is always disabled in the infinite loop, any normal peripheral interrupt are never detected, is incorrect and it is strongly recommended to not remove the GLOBAL_INT_STOP(). Also, be aware that if the device is in sleep mode, it can be woken up only from the wake-up controller, and by any other interrupt because all the peripheral block are shut down.

Thanks, PM_Dialog