File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,13 @@ internal ContextTask(string driver, int index)
9494 contextIndex = index ;
9595 ctx = new oni . Context ( contextDriver , contextIndex ) ;
9696 Initialize ( ) ;
97+ var ( major , _) = GenericHelper . GetFirmwareVersionComponents ( GetHub ( 0 ) . FirmwareVersion ) ;
98+ if ( major != 2 )
99+ {
100+ throw new NotSupportedException ( "This library requires version 2.x of the ONIX firmware. "
101+ + "Please perform a firmware update to use this library. Instructions can be found at "
102+ + "https://open-ephys.github.io/onix-docs/Hardware%20Guide/PCIe%20Host/updating-firmware.html" ) ;
103+ }
97104 }
98105
99106 private void Initialize ( )
Original file line number Diff line number Diff line change @@ -6,5 +6,15 @@ public static uint GetHubAddressFromDeviceAddress(uint deviceAddress)
66 {
77 return ( deviceAddress & 0xFF00u ) ;
88 }
9+
10+ /// <summary>
11+ /// Gets 8-bit version components from a 16-bit version register value
12+ /// </summary>
13+ /// <param name="version">Register value containing a 16-bit firmware version number.</param>
14+ /// <returns> A tuple containing the 8-bit major and minor version components.</returns>
15+ internal static ( byte major , byte minor ) GetFirmwareVersionComponents ( uint version )
16+ {
17+ return ( ( byte ) ( ( version >> 8 ) & 0xFF ) , ( byte ) ( version & 0xFF ) ) ;
18+ }
919 }
1020}
You can’t perform that action at this time.
0 commit comments