wip
This commit is contained in:
parent
95365cf6c1
commit
1a648e1cff
@ -97,10 +97,15 @@ int prepare_text2morse (int wpm)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int char2morse(char c)
|
||||
int char2morse(void)
|
||||
{
|
||||
char c='c', d;
|
||||
// why? because!!!
|
||||
// http://stackoverflow.com/questions/1352587/convert-a-string-into-morse-code/1355594^
|
||||
for(;c= c?c:(c=toupper(getchar())-32)?c<0?1:"\x95#\x8CKa`^ZRBCEIQiw#S#nx(37+$6-2&@/4)'18=,*%.:0;?5" [c-12]-34:-3;c/=2)putchar(c/2?46-c%2:32);
|
||||
for(;c= c?c:(c=toupper(getchar())-32)?c<0?1:"\x95#\x8CKa`^ZRBCEIQiw#S#nx(37+$6-2&@/4)'18=,*%.:0;?5" [c-12]-34:-3;c/=2)
|
||||
{
|
||||
d=(c/2?46-c%2:32);
|
||||
putchar (d);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -68,5 +68,6 @@ struct morse_timig_format {
|
||||
};
|
||||
|
||||
int prepare_text2morse (int wpm);
|
||||
int char2morse(void);
|
||||
|
||||
|
||||
|
@ -369,10 +369,11 @@ int main(int argc, char *argv[])
|
||||
usleep(50);
|
||||
}
|
||||
|
||||
#ifdef TX_SERIAL
|
||||
if(kbhit() && tx_timer == 0){
|
||||
char2morse("s");
|
||||
getchar(); /* flush the buffer */
|
||||
char2morse();
|
||||
}
|
||||
#endif
|
||||
} /* End of mainloop */
|
||||
|
||||
send(fd_socket, &disconnect_packet, SIZE_COMMAND_PACKET, 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user