Hi,
Actually I never touch nrf52 chip and it's BSP right now. But I'm Familiar with the problem you are faced now.
Actually you don't have to use any peripheral from NRF52 chip, maybe you just need accurate delay from it. You just need to change the read button style. I have faced this problem in some occasion, and the way I solve this is use non blocking way to scan state of button, rather than using blocking way to read button state.
This is my propposed method(we could applied it to NRF52 BSP after this, just chat me):
let's say that delay_ms() function is delay system 1ms.
#define ScanButtonTimeOut 200 //2 seconds mean 200 * 10ms
enum buttonstate{
release,pressed
}
typedef struct button_struct{
//some state struct
buttonstate b_state;
int pressedcount; //count how long it's already pressed
}button_struct;
void main()
{
button_struct b1,b2; //struct for button1 and button2 state
while(1)
{
if(button1 == Pressed){
b1.pressedcount++;
if([login to view URL]>200)
b1.b_state = pressed; //change the state of button1
}else{
[login to view URL] = 0; //reset prssed count
}
//Do the same for Button 2
//Set Led on if button 1 & button 2 state is pressed
delay_ms(10);
}
}
For the detail, lets discuss it over chat. I could do it over NRF52 BSP too, so, don't worry.
Best regards,
Rijal