Hi to all,
i am developing an product based on the nrf5240 soc and i want to implement an hid device. after receiving some commands from HID i need to gather user presence, like below:
while(counter < MAX_TRY) { //check user presense .. if(canceled == 1) return 0; }
as you can see i stuck the program in a loop to gather user presence. the protocol that i am implementing let host app to cancel the request by sending a cancel command through usb. problem is here that when i am in the above while loop packets from usb did not received and as result i can not receive cancel command.
i expected that usb events like timer events work while i am in a loop like above but it seems that it did not implemented in that way. so can any one give me a advice to solve the problem?? there is any trick to done that (some function that can be called in while loop and let the soft device done her critical jobs like receiving usb packets or etc).
thanks