mirror of
https://github.com/rene-dev/stmbl.git
synced 2026-02-06 10:23:58 +08:00
20 lines
248 B
Plaintext
20 lines
248 B
Plaintext
COMP(div);
|
|
|
|
HAL_PIN(in0) = 0.0;
|
|
HAL_PIN(in1) = 0.0;
|
|
HAL_PIN(out) = 0.0;
|
|
HAL_PIN(div_error) = 0.0;
|
|
|
|
|
|
RC(out,
|
|
if(PIN(in1) == 0.0){
|
|
PIN(div_error) = 1.0;
|
|
}
|
|
else{
|
|
PIN(div_error) = 0.0;
|
|
PIN(out) = PIN(in0) / PIN(in1);
|
|
}
|
|
);
|
|
|
|
ENDCOMP;
|