Skip to content

Commit

Permalink
Added RPMSG examples, tested the same on PRU, and it works
Browse files Browse the repository at this point in the history
  • Loading branch information
VedantParanjape committed Jul 17, 2020
1 parent 0300e42 commit ccbc838
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
9 changes: 9 additions & 0 deletions examples/rpmsg_example.sim
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
init_message_channel();

int count := receive_message();

while : true {
send_message(count);
count := count + 1;
delay(1000);
}
29 changes: 29 additions & 0 deletions examples/rpmsg_pru_calculator.sim
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
init_message_channel();

while : true {
int option := receive_message();
int a := receive_message();
int b := receive_message();

if : option == 1 {
send_message(a+b);
}
elif : option == 2 {
send_message(a-b);
}
elif : option == 3 {
send_message(a*b);
}
elif : option == 4 {
if : b != 0 {
send_message(a/b);
}
else {
send_message(a);
}
}
else
{
send_message(a+b);
}
}

0 comments on commit ccbc838

Please sign in to comment.