forked from CodeJockey/glar150
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Problem: Morse sequence isn't fully interruptible
Solution: compile into intermediate code that's executed step by step.
- Loading branch information
Showing
13 changed files
with
215 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#### glar_morse - Morse lamp controller | ||
|
||
Converts a character string to Morse code on the lamp. Spaces are turned | ||
into word spaces. If a new command arrives, it will always interrupt the | ||
existing command. Ending the string with "*" causes it to repeat until | ||
interrupted. | ||
|
||
Please add @discuss section in ../src/glar_morse.c. | ||
|
||
This is the class interface: | ||
|
||
// Create new glar_morse actor instance. | ||
// @TODO: Describe the purpose of this actor! | ||
// | ||
// zactor_t *glar_morse = zactor_new (glar_morse, NULL); | ||
// | ||
// Destroy glar_morse instance. | ||
// | ||
// zactor_destroy (&glar_morse); | ||
// | ||
// Enable verbose logging of commands and activity: | ||
// | ||
// zstr_send (glar_morse, "VERBOSE"); | ||
// zsock_wait (glar_morse); | ||
// | ||
// This is the glar_morse constructor as a zactor_fn; | ||
GLAR_EXPORT void | ||
glar_morse_actor (zsock_t *pipe, void *args); | ||
|
||
// Self test of this actor | ||
GLAR_EXPORT void | ||
glar_morse_test (bool verbose); | ||
|
||
This is the class self test code: | ||
|
||
zactor_t *glar_morse = zactor_new (glar_morse_actor, NULL); | ||
if (verbose) | ||
zstr_send (glar_morse, "VERBOSE"); | ||
zstr_send (glar_morse, "SOS*"); | ||
zclock_sleep (2000); | ||
zstr_send (glar_morse, "K"); | ||
zactor_destroy (&glar_morse); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
glar_morse(3) | ||
============= | ||
|
||
NAME | ||
---- | ||
glar_morse - Morse lamp controller | ||
|
||
SYNOPSIS | ||
-------- | ||
---- | ||
// Create new glar_morse actor instance. | ||
// @TODO: Describe the purpose of this actor! | ||
// | ||
// zactor_t *glar_morse = zactor_new (glar_morse, NULL); | ||
// | ||
// Destroy glar_morse instance. | ||
// | ||
// zactor_destroy (&glar_morse); | ||
// | ||
// Enable verbose logging of commands and activity: | ||
// | ||
// zstr_send (glar_morse, "VERBOSE"); | ||
// zsock_wait (glar_morse); | ||
// | ||
// This is the glar_morse constructor as a zactor_fn; | ||
GLAR_EXPORT void | ||
glar_morse_actor (zsock_t *pipe, void *args); | ||
|
||
// Self test of this actor | ||
GLAR_EXPORT void | ||
glar_morse_test (bool verbose); | ||
---- | ||
|
||
DESCRIPTION | ||
----------- | ||
|
||
Converts a character string to Morse code on the lamp. Spaces are turned | ||
into word spaces. If a new command arrives, it will always interrupt the | ||
existing command. Ending the string with "*" causes it to repeat until | ||
interrupted. | ||
|
||
Please add @discuss section in ../src/glar_morse.c. | ||
|
||
EXAMPLE | ||
------- | ||
.From glar_morse_test method | ||
---- | ||
zactor_t *glar_morse = zactor_new (glar_morse_actor, NULL); | ||
if (verbose) | ||
zstr_send (glar_morse, "VERBOSE"); | ||
zstr_send (glar_morse, "SOS*"); | ||
zclock_sleep (2000); | ||
zstr_send (glar_morse, "K"); | ||
zactor_destroy (&glar_morse); | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.