From: Lukáš Jiřiště Date: Sun, 15 Dec 2024 17:57:20 +0000 (+0100) Subject: Swap functionality of p- and n-channel FETs X-Git-Url: https://git.ljiriste.work/?a=commitdiff_plain;h=c280e441a80d2ff10ae1765ba6fff245bb5dee1a;p=FET_sim.git Swap functionality of p- and n-channel FETs 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. --- diff --git a/src/sim_main.c b/src/sim_main.c index 54e35f2..19c8253 100644 --- a/src/sim_main.c +++ b/src/sim_main.c @@ -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