File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ For overclockers and PC hardware enthusiasts
1212using System ;
1313using System . Diagnostics ;
1414using System . IO ;
15- using System . Security . Principal ;
1615using SpdReaderWriterCore ;
1716using SpdReaderWriterCore . Properties ;
1817
@@ -211,7 +210,9 @@ static void ParseCommand() {
211210 Console . ResetColor ( ) ;
212211 }
213212 finally {
214- Arduino . Disconnect ( ) ;
213+ if ( Arduino . IsConnected ) {
214+ Arduino . Disconnect ( ) ;
215+ }
215216 }
216217 }
217218
@@ -368,7 +369,13 @@ private static void ReadEeprom() {
368369 Smbus = new Smbus ( ) ;
369370
370371 Smbus . BusNumber = ( byte ) int . Parse ( Args [ 1 ] ) ;
371- Smbus . I2CAddress = i2CAddress ;
372+ if ( Smbus . ProbeAddress ( i2CAddress ) ) {
373+ Smbus . I2CAddress = i2CAddress ;
374+ }
375+ else {
376+ throw new AccessViolationException ( $ "Address { i2CAddress } not found") ;
377+ }
378+
372379 name = $ "{ Smbus } ({ Smbus . BusNumber } )";
373380
374381 for ( ushort i = 0 ; i < Smbus . MaxSpdSize ; i += 32 ) {
You can’t perform that action at this time.
0 commit comments