Swap functionality of p- and n-channel FETs
authorLukáš Jiřiště <gymnazium.jiriste@gmail.com>
Sun, 15 Dec 2024 17:57:20 +0000 (18:57 +0100)
committerLukáš Jiřiště <gymnazium.jiriste@gmail.com>
Sun, 15 Dec 2024 17:57:20 +0000 (18:57 +0100)
I probably got confused when assigning the functionality.
We can be generous and say I'm switching the MOSFETS from depletion mode
to enhancement mode.

src/sim_main.c

index 54e35f2a31e7942afcf481f1da66de165154e2d8..19c825388a9c40fd39e5d145c25a23bc5def4b2b 100644 (file)
@@ -3,7 +3,7 @@
 
 int    should_open(t_type type, t_state state)
 {
-       return ((type == p && state == on) || (type == n && state == off));
+       return ((type == p && state == off) || (type == n && state == on));
 }
 
 // Maybe an error should be return when gate is NULL