Created
January 8, 2019 12:11
-
-
Save nkp216/e1284a0bd23a22b585e57d9def7c2da3 to your computer and use it in GitHub Desktop.
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
/* sudo halcompile --install memprepare.comp */ | |
component memprepare ; | |
pin in signed in; | |
pin out signed out; | |
pin out signed old; | |
pin out bit part1;// включает 1-ю часть схемы | |
pin out bit part2;// включает 2-ю часть схемы | |
variable signed tmp; | |
function _; | |
license "GPL"; | |
;; | |
#include "rtapi_math.h" | |
FUNCTION(_) { | |
out = in; | |
if(tmp){ | |
if(in != tmp){ | |
old = tmp; | |
part1 = 1; | |
part2 = 0; | |
} | |
} else { | |
if(in != tmp){ | |
old = tmp; | |
part1 = 0; | |
part2 = 1; | |
} | |
} | |
tmp = in; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment