示例#1
0
        /// <inheritdoc/>
        public void Dispose()
        {
            if (_shouldDispose)
            {
                _i2cBus?.Dispose();
            }
            else
            {
                _ledMatrix?.Dispose();
                _ledMatrix = null !;

                _joystick?.Dispose();
                _joystick = null !;

                _gyro?.Dispose();
                _gyro = null !;

                _mag?.Dispose();
                _mag = null !;

                _temp?.Dispose();
                _temp = null !;

                _press?.Dispose();
                _press = null !;
            }

            _i2cBus = null !;
        }
示例#2
0
        /// <inheritdoc/>
        public void Dispose()
        {
            _ledMatrix?.Dispose();
            _ledMatrix = null;

            _joystick?.Dispose();
            _joystick = null;

            _gyro?.Dispose();
            _gyro = null;

            _mag?.Dispose();
            _mag = null;

            _temp?.Dispose();
            _temp = null;

            _press?.Dispose();
            _press = null;
        }