Skip to content

Commit

Permalink
chore: catchup to 6194410
Browse files Browse the repository at this point in the history
6194410 docs: add basic docs on running samples
86fff86 fix: ensure sample slave remains running

Based-On-Commit: 61944108ebe9043eac0388b271be1acc91aed269
Change-Id: Iee6675fda2d0dd75ce7e7ad251330de474841085
  • Loading branch information
rt-labs bot committed Feb 25, 2025
1 parent 546d85f commit 7a2271e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions samples/slave/slave.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,24 @@ int slave_init (const char * canif, int bitrate)
return -1;
}

printf ("Inited\n");

/* Wait a while, then generate error and emergency */
os_usleep (5 * 1000);
printf ("Generating emergency\n");
co_error_set (client, CO_ERR_MANUFACTURER);
co_emcy_issue (client, 0x1000, 0x1234, NULL);

/* Clear the error */
os_usleep (5 * 1000);
printf ("Clearing emergency\n");
co_error_clear (client, CO_ERR_MANUFACTURER);

/* Loop forever */
printf ("Waiting for clients\n");
for (;;)
{
os_usleep (1000 * 1000);
}
return 0;
}

0 comments on commit 7a2271e

Please sign in to comment.