Skip to content

Commit 1e52459

Browse files
committed
SensorsComboDriver: Remove all except ALS and accel
Signed-off-by: Daniel Schaefer <dhs@frame.work>
1 parent 386fd24 commit 1e52459

10 files changed

Lines changed: 1 addition & 3179 deletions

SensorsComboDriver/Clients.h

Lines changed: 0 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -204,99 +204,6 @@ typedef class _AlsDevice : public _ComboDevice
204204

205205

206206

207-
//
208-
// Gyroscope ------------------------------------------------------------------
209-
//
210-
typedef class _GyrDevice : public _ComboDevice
211-
{
212-
private:
213-
214-
VEC3D m_CachedThresholds;
215-
VEC3D m_CachedData;
216-
VEC3D m_LastSample;
217-
218-
public:
219-
220-
NTSTATUS Initialize(_In_ WDFDEVICE Device, _In_ SENSOROBJECT SensorObj);
221-
NTSTATUS GetData();
222-
NTSTATUS UpdateCachedThreshold();
223-
224-
} GyrDevice, *PGyrDevice;
225-
226-
227-
228-
//
229-
// Magnetometer ---------------------------------------------------------------
230-
//
231-
typedef struct _MagData
232-
{
233-
VEC3D Axis;
234-
ULONG Accuracy;
235-
} MagData, *PMagData;
236-
237-
typedef class _MagDevice : public _ComboDevice
238-
{
239-
private:
240-
241-
VEC3D m_CachedThresholds;
242-
MagData m_CachedData;
243-
MagData m_LastSample;
244-
245-
public:
246-
247-
NTSTATUS Initialize(_In_ WDFDEVICE Device, _In_ SENSOROBJECT SensorObj);
248-
NTSTATUS GetData();
249-
NTSTATUS UpdateCachedThreshold();
250-
251-
} MagDevice, *PMagDevice;
252-
253-
254-
255-
//
256-
// Proximity ------------------------------------------------------------------
257-
//
258-
typedef struct
259-
{
260-
BOOL Detected;
261-
ULONG DistanceMillimeters;
262-
} PrxData, *PPrxData;
263-
264-
typedef class _PrxDevice : public _ComboDevice
265-
{
266-
private:
267-
268-
PrxData m_CachedData;
269-
PrxData m_LastSample;
270-
271-
public:
272-
273-
NTSTATUS Initialize(_In_ WDFDEVICE Device, _In_ SENSOROBJECT SensorObj);
274-
NTSTATUS GetData();
275-
NTSTATUS UpdateCachedThreshold();
276-
277-
} PrxDevice, *PPrxDevice;
278-
279-
280-
281-
//
282-
// Relative Fusion ------------------------------------------------------------------
283-
//
284-
typedef class _RelativeFusionDevice : public _ComboDevice
285-
{
286-
private:
287-
288-
QUATERNION m_CachedThresholds;
289-
QUATERNION m_CachedData;
290-
QUATERNION m_LastSample;
291-
292-
public:
293-
294-
NTSTATUS Initialize(_In_ WDFDEVICE Device, _In_ SENSOROBJECT SensorObj);
295-
NTSTATUS GetData();
296-
NTSTATUS UpdateCachedThreshold();
297-
298-
} RelativeFusionDevice, *PRelativeFusionDevice;
299-
300207
//
301208
// Linear Accelerometer --------------------------------------------------------------
302209
//
@@ -321,48 +228,3 @@ typedef class _LinearAccelerometerDevice : public _ComboDevice
321228
NTSTATUS UpdateCachedThreshold();
322229

323230
} LinearAccelerometerDevice, *PLinearAccelerometerDevice;
324-
325-
//
326-
// Gravity Vector --------------------------------------------------------------
327-
//
328-
typedef class _GravityVectorDevice : public _ComboDevice
329-
{
330-
private:
331-
332-
VEC3D m_CachedThresholds;
333-
VEC3D m_CachedData;
334-
VEC3D m_LastSample;
335-
336-
public:
337-
338-
NTSTATUS Initialize(_In_ WDFDEVICE Device, _In_ SENSOROBJECT SensorObj);
339-
NTSTATUS GetData();
340-
NTSTATUS UpdateCachedThreshold();
341-
342-
} GravityVectorDevice, *PGravityVectorDevice;
343-
344-
//
345-
// Geomagnetic Orientation ------------------------------------------------------------------
346-
//
347-
typedef class _GeomagneticOrientationDevice : public _ComboDevice
348-
{
349-
private:
350-
351-
typedef struct _GeomagneticOrientationSample
352-
{
353-
QUATERNION Quaternion;
354-
FLOAT RotationAngle_Degrees;
355-
FLOAT DeclinationAngle_Degrees;
356-
} GeomagneticOrientationSample, *PGeomagneticOrientationSample;
357-
358-
GeomagneticOrientationSample m_CachedThresholds;
359-
GeomagneticOrientationSample m_CachedData;
360-
GeomagneticOrientationSample m_LastSample;
361-
362-
public:
363-
364-
NTSTATUS Initialize(_In_ WDFDEVICE Device, _In_ SENSOROBJECT SensorObj);
365-
NTSTATUS GetData();
366-
NTSTATUS UpdateCachedThreshold();
367-
368-
} GeomagneticOrientationDevice, *PGeomagneticOrientationDevice;

SensorsComboDriver/Device.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,7 @@
2222
enum Device
2323
{
2424
Device_Als = 0,
25-
Device_GeomagneticOrientation,
26-
Device_GravityVector,
27-
Device_Gyr,
2825
Device_LinearAccelerometer,
29-
Device_Mag,
30-
Device_Prx,
31-
Device_RelativeFusion,
3226
// Keep this last
3327
Device_Count
3428
};
@@ -43,13 +37,7 @@ inline size_t GetDeviceSizeAtIndex(
4337
switch (static_cast<Device>(Index))
4438
{
4539
case Device_Als: result = sizeof(AlsDevice); break;
46-
case Device_GeomagneticOrientation: result = sizeof(GeomagneticOrientationDevice); break;
47-
case Device_GravityVector: result = sizeof(GravityVectorDevice); break;
48-
case Device_Gyr: result = sizeof(GyrDevice); break;
4940
case Device_LinearAccelerometer: result = sizeof(LinearAccelerometerDevice); break;
50-
case Device_Mag: result = sizeof(MagDevice); break;
51-
case Device_Prx: result = sizeof(PrxDevice); break;
52-
case Device_RelativeFusion: result = sizeof(RelativeFusionDevice); break;
5341
default: break; // invalid
5442
}
5543
return result;
@@ -63,13 +51,7 @@ void AllocateDeviceAtIndex(
6351
switch (static_cast<Device>(Index))
6452
{
6553
case Device_Als: *ppDevice = new(*ppDevice) AlsDevice; break;
66-
case Device_GeomagneticOrientation: *ppDevice = new(*ppDevice) GeomagneticOrientationDevice; break;
67-
case Device_GravityVector: *ppDevice = new(*ppDevice) GravityVectorDevice; break;
68-
case Device_Gyr: *ppDevice = new(*ppDevice) GyrDevice; break;
6954
case Device_LinearAccelerometer: *ppDevice = new(*ppDevice) LinearAccelerometerDevice; break;
70-
case Device_Mag: *ppDevice = new(*ppDevice) MagDevice; break;
71-
case Device_Prx: *ppDevice = new(*ppDevice) PrxDevice; break;
72-
case Device_RelativeFusion: *ppDevice = new(*ppDevice) RelativeFusionDevice; break;
7355

7456
default: break; // invalid (let driver fail)
7557
}

0 commit comments

Comments
 (0)