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
import math | |
def rp(a,b): | |
"y = R1||R2" | |
return a*b/float(a+b) | |
def rr(r,c): | |
'''R||y = C''' | |
return r*c/float(r-c) |
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
#!/usr/bin/env python | |
import sys | |
k = 0 | |
try: | |
buff = '' | |
while True: | |
buff += sys.stdin.read(1) | |
if buff.endswith('\n'): |
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
48 33.5 | |
56 31 | |
64 29 | |
66 28.5 | |
68 28 | |
70 27.5 | |
72 27.5 | |
73 27 | |
74 26.5 | |
75 26.5 |
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
variable seed | |
7 seed ! | |
: random ( -- x ) \ return a 32-bit random number x | |
seed @ | |
dup 13 lshift xor | |
dup 17 rshift xor | |
dup 5 lshift xor | |
dup seed ! | |
; |
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
$FF variable hex.empty \ needs to be variable, some flash is zero when empty | |
: hexd64k ( n -- ) | |
\ STM32F103x8: Complete image with Dictionary: $FFFF $0000 | |
dup | |
$FFFF + swap | |
do | |
\ Check if this line is entirely empty: | |
0 \ Not worthy to print |
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
\ stepper motor 5 wires connected to pb12..pb15 @ bluepill stm32f103 , | |
\ tested at mecrisp-stellaris 2.5.0 | |
\ port B base addr | |
$40010C00 constant GPIOB | |
GPIOB 4 + constant GPIOB_CRH | |
GPIOB $10 + constant GPIOB_BSRR | |
\ init pb12..pb15 omode-pp, all coils to gnd | |
: sminit ( -- ) | |
$F0000000 ( clr b12-b15 ) |
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
# Write only the files which are NOT symlinks | |
find `pwd` \( \( -iname "*.c" -o -iname "*.cpp" -o -iname "*.cc" -o -iname "*.h" \) -and \( -not -type l \) \) -print > cscope.files | |
# Add the target of the symlink for all files matching the right extension, and are symlinks | |
find `pwd` \( \( -iname "*.c" -o -iname "*.cpp" -o -iname "*.cc" -o -iname "*.h" \) -and -type l \) -exec readlink -f {} \; >> cscope.files |
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
# get submodules by cmake | |
make | |
# go to the code | |
cd src | |
# if needed - reduce the supported targets | |
# - search for PROBE | |
vim target/cortexm.c | |
# fix the voltage: | |
vim platforms/stlink/platform.c | |
# build |
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
0 variable xx | |
: test 5 0 do i xx @ execute . loop ; | |
: dec ['] 1- xx ! ; | |
: inc ['] 1+ xx ! ; | |
inc test | |
dec test |
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
for i in $(find -iname '*.h' -exec dirname "{}" \; | sort -u); do printf -- '-I %s\n' $i ;done |
NewerOlder