From 5fe96aff921978351a0a9f56caca36ef78f7907c Mon Sep 17 00:00:00 2001 From: taylorza Date: Sat, 16 Jul 2022 11:13:40 -0400 Subject: [PATCH 1/2] Updated to CSpect 2.16.5.0 Plugin interface --- Common/Plugin.dll | Bin 6144 -> 9216 bytes RTC/Plugin/RTCPlugin.cs | 13 +++++++++++-- RTCSys/RTCSys_Device.cs | 13 +++++++++++-- UARTLogger/UARTLogger_Device.cs | 13 +++++++++++-- UARTReplacement/UARTReplacement_Device.cs | 13 +++++++++++-- i2C_Sample/Class1.cs | 13 +++++++++++-- 6 files changed, 55 insertions(+), 10 deletions(-) diff --git a/Common/Plugin.dll b/Common/Plugin.dll index 728e0f629073e4c9e875d25d0e09368ff8cf5a3c..9eba74fbf8fb6ba4db3c2af534d8c9db3fc30939 100644 GIT binary patch literal 9216 zcmeHMe{dZ2b$`3Jdpa9imW*(0@Q(vI1YCSM$wHQeZ6w{vmat?Aoh)qE)79SHT3Y+= z_Po22btEco#xWrz(~to|Nzy_GT9PmgWT0`|6q>Zrq)pw)FA8mwlu6qBXgkF-owgI& zfqvfGy&sZkGnvUBOebGyKl?uKz3=eBTWm61!=PtMw2yzDwNu33!d%u>nm<5?^2&XwYJDV`q7#EVYeN~~SG zdV3gpe2{2FiO_$&a(}kk+N*R!{3<0$v>BRcp#7CzoZ~q9a1gbKtOj|rB6K4<2Le5p z2u;7AUHQL$4k@cp)*$W}3w=bhJP<3(G<=}@R!@-5O7s89<3zCrV+?$#fhT-x!3WP@ z3xG}f8s-fqB~CP*a6LB%Cb{)N;0v`CM?>jD_6gT2IB?`#X&MK|x&cQ+=_49wpd$A1 zxT0`wD(UnusPm(1h!oNO?C?8kWD!H9soEkUYpRPt<;6WL>WjDWsaadxi}Q|$;VJsi zb3;&Xh1a~gVR0W<+pxGlINctc`Z&gZ^*!j3wlx>WtxLv^tQsf+8rhni{`w+2u;YQ1 zj;v^OWX_JMm5!`vbY#ws2Uj|>qS2B0j_x30px<#E8A?1t#zqABNi;asD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W+@x$s7BogL#Rl zuZ$aAz&Uz2M@TMlypiKH<}5in+?rgUzc@aiy-Bf;*$)}tW;&SFI8V+tW+ihMvx-^5 ztYFqMTcTXFG0T{HnftiA8m53rovvZ-At#<<+D%-fI7%ZL(;CI)_=zPM)27rbNLg(fQ9t3EDvg-7Tf0cph^LrVtT~>x+|{~$mV11yq!H8FEIRVhV@P!de(EJ3r{ju7kV+o#V!GQ=1wYAa%i{mycx{4r zsC}ZPj0Ku#r4x>f1zgm%z;)Pc3BQGXNd*J6Yb#Gh@h{IsQsIu&l?lb2Vv9n%`W3gS zu_R-b-VJu5j%;EIwi0dF&U}XHW_p+hn4QdCVkUwdzr;L6)NOc|3iI)r<53S?Nh?}# zlIX<*u>)I(-FTYVg9_pRs)@%?OB{k5rAWo!#B?a4l=h>5ScGC?395*d%x9VP>_3lM z@_p>Q!0g9Cat5O~O+^^5%hwL2Bv>ZpIz5@>J4L>c6DbE>i4gEKHEl;rFdXUGF5?O` z`}bG*%l#c4{?1N+=T6kNh6cum0=wa_tB1E9{)R^Q-A(Yo-`s*!Pb23|MnWUzk#zUseEJQMd@$HQ2yY-TXnvfzDb;r> z90?4gab$ehOmXI$CC&wN*|}+>zjt6@ED#Q(t?ziCKLUTfZ&a4SmC`d3jKJ($|GRl0 z%awg9@vBZ@Ox**|x5;ZB!1ll4ke(XFa(m)WN1nxZEux}q71NYW&&n#B-W zl7v-ijWq!dLo{(i@z_~?<`#m1WM zhOy9SU+83aU2p&3_-MG>7aAYy4|F#Uj}P@mg0!f)xwjoBS3dS~sJCQnOcywnsWP+5 abzyOB-UBt+i2wUA|J Init(iCSpect _CSpect) return ports; } - public byte Read(eAccess _type, int _address, out bool _isvalid) + public byte Read(eAccess _type, int _address, int _id, out bool _isvalid) { if (_type == eAccess.NextReg_Read && _address == REG_00_MACHINE_ID) { @@ -115,7 +115,7 @@ public byte Read(eAccess _type, int _address, out bool _isvalid) return 0xff; } - public bool Write(eAccess _type, int _port, byte _value) + public bool Write(eAccess _type, int _port, int _id, byte _value) { if (_type == eAccess.NextReg_Write && _port == REG_00_MACHINE_ID) { @@ -160,5 +160,14 @@ public void Tick() public void Quit() { } + + public bool KeyPressed(int _id) + { + return false; + } + + public void Reset() + { + } } } diff --git a/UARTLogger/UARTLogger_Device.cs b/UARTLogger/UARTLogger_Device.cs index 27e1b93..c909dfd 100644 --- a/UARTLogger/UARTLogger_Device.cs +++ b/UARTLogger/UARTLogger_Device.cs @@ -46,7 +46,7 @@ public void Quit() } } - public bool Write(eAccess _type, int _port, byte _value) + public bool Write(eAccess _type, int _port, int _id, byte _value) { switch (_port) { @@ -66,7 +66,7 @@ public bool Write(eAccess _type, int _port, byte _value) return false; } - public byte Read(eAccess _type, int _port, out bool _isvalid) + public byte Read(eAccess _type, int _port, int _id, out bool _isvalid) { switch (_port) { @@ -97,5 +97,14 @@ public byte Read(eAccess _type, int _port, out bool _isvalid) public void Tick() { } + + public bool KeyPressed(int _id) + { + return false; + } + + public void Reset() + { + } } } diff --git a/UARTReplacement/UARTReplacement_Device.cs b/UARTReplacement/UARTReplacement_Device.cs index 37e3d6d..6c41aa9 100644 --- a/UARTReplacement/UARTReplacement_Device.cs +++ b/UARTReplacement/UARTReplacement_Device.cs @@ -68,7 +68,7 @@ public void Quit() } } - public bool Write(eAccess _type, int _port, byte _value) + public bool Write(eAccess _type, int _port, int _id, byte _value) { switch (_port) { @@ -118,7 +118,7 @@ public bool Write(eAccess _type, int _port, byte _value) return false; } - public byte Read(eAccess _type, int _port, out bool _isvalid) + public byte Read(eAccess _type, int _port, int _id, out bool _isvalid) { switch (_port) { @@ -215,6 +215,15 @@ public void ESPWork() public void Tick() { } + + public bool KeyPressed(int _id) + { + return false; + } + + public void Reset() + { + } } } diff --git a/i2C_Sample/Class1.cs b/i2C_Sample/Class1.cs index a16ffc4..9c751a4 100644 --- a/i2C_Sample/Class1.cs +++ b/i2C_Sample/Class1.cs @@ -60,7 +60,7 @@ public void Quit() /// the port being written to /// the value to write // ********************************************************************** - public bool Write(eAccess _type, int _port, byte _value) + public bool Write(eAccess _type, int _port, int _id, byte _value) { switch (_port) { @@ -79,7 +79,7 @@ public bool Write(eAccess _type, int _port, byte _value) /// /// // ********************************************************************** - public byte Read(eAccess _type, int _port, out bool _isvalid) + public byte Read(eAccess _type, int _port, int _id, out bool _isvalid) { switch (_port) { @@ -93,5 +93,14 @@ public byte Read(eAccess _type, int _port, out bool _isvalid) public void Tick() { } + + public bool KeyPressed(int _id) + { + return false; + } + + public void Reset() + { + } } } From cf1e28ccd590820c9dfc8e3db340e0a1df2fb8fd Mon Sep 17 00:00:00 2001 From: taylorza Date: Mon, 16 Jan 2023 20:35:33 -0500 Subject: [PATCH 2/2] Fixed null reference issues --- UARTReplacement/SerialPort.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/UARTReplacement/SerialPort.cs b/UARTReplacement/SerialPort.cs index 07126d8..69a4e3b 100644 --- a/UARTReplacement/SerialPort.cs +++ b/UARTReplacement/SerialPort.cs @@ -193,6 +193,7 @@ public int Baud public void Reset(byte ResetByte) { + if (port is null) return; // bit 7 = Indicates the reset signal to the expansion bus and esp is asserted bool resetESP = (ResetByte & 128) == 128; if (resetESP) @@ -216,7 +217,7 @@ public void EnableEspGpio(byte EnableByte) public void SetEspGpio(byte GpioByte) { - if (enableEspGpio) + if (enableEspGpio || port is null) return; // bit 0 = Read / Write ESP GPIO0 (hard reset = 1)