mirror of https://github.com/zrafa/xinu-avr.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
700 B
27 lines
700 B
/* ex3.c - main, sndch */ |
|
|
|
#include <xinu.h> |
|
|
|
void sndch(char); |
|
|
|
/*------------------------------------------------------------------------ |
|
* main -- example of 2 processes executing the same code concurrently |
|
*------------------------------------------------------------------------ |
|
*/ |
|
void main(void) |
|
{ |
|
resume( create(sndch, 1024, 20, "send A", 1, 'A') ); |
|
resume( create(sndch, 1024, 20, "send B", 1, 'B') ); |
|
} |
|
|
|
/*------------------------------------------------------------------------ |
|
* sndch -- output a character on a serial device indefinitely |
|
*------------------------------------------------------------------------ |
|
*/ |
|
void sndch(char ch) |
|
|
|
{ |
|
|
|
while ( 1 ) |
|
putc(CONSOLE, ch); |
|
}
|
|
|