Skip to content

Commit 546e20c

Browse files
committed
Updated the example code snippet in the README, as it would trigger the Task Watchdog
1 parent c077901 commit 546e20c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,15 @@ In your project folder, run `make menuconfig` and configure your project with th
5656
In order to use this library, you just need to set an event callback, call the initialisation function, and, optionally, wait for the PS3 controller to be connected:
5757
```c
5858
#include "ps3.h"
59+
#include "freertos/task.h"
5960
6061
ps3SetEventCallback(controller_event_cb);
6162
ps3Init();
62-
while (!ps3IsConnected());
63+
64+
while (!ps3IsConnected()){
65+
// Prevent the Task Watchdog from triggering
66+
vTaskDelay(10 / portTICK_PERIOD_MS);
67+
}
6368
```
6469

6570
Your event callback will have to look like this:

0 commit comments

Comments
 (0)