some fixes for ipc
This commit is contained in:
@@ -46,22 +46,24 @@ extern "C" void main() {
|
||||
//sys_test(1,2,3,4,5);
|
||||
|
||||
unsigned id = sys_getpid();
|
||||
char text[] = "appX";
|
||||
char text[] = "appX ";
|
||||
text[3] = 0x30+id;
|
||||
|
||||
write(1, text, sizeof(text), 0, (int)id);
|
||||
|
||||
uint8_t cnt = 0;
|
||||
for (unsigned i = 1;; ++i) {
|
||||
if(id == 2){
|
||||
send(4, text, strlen(text), text, 5);
|
||||
write(1, text, strlen(text), 25, (int)id);
|
||||
}
|
||||
if(id == 4){
|
||||
char blubb[10];
|
||||
receive(blubb, 10);
|
||||
write(1, blubb, strlen(blubb), 25, (int)id);
|
||||
reply("toast", 5);
|
||||
if(i%10 == 0){
|
||||
if(id == 2){
|
||||
send(4, text, strlen(text), text, 5);
|
||||
write(1, text, strlen(text), 25, (int)id);
|
||||
}
|
||||
if(id == 4){
|
||||
char blubb[10];
|
||||
receive(blubb, 10);
|
||||
write(1, blubb, strlen(blubb), 25, (int)id);
|
||||
reply("toast", 5);
|
||||
}
|
||||
}
|
||||
|
||||
//counter to see app running
|
||||
|
||||
Reference in New Issue
Block a user