Skip to content

Commit 29f8963

Browse files
Merge pull request #18 from FrameworkComputer/license
Add LICENSE file, SPDX header, copyright header
2 parents bc56a83 + 9114706 commit 29f8963

13 files changed

Lines changed: 9032 additions & 43 deletions

FrameworkSensors/AccelerometerClient.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MS-PL
2+
//
13
// Copyright (C) Microsoft Corporation, All Rights Reserved.
24
// Copyright (C) Framework Computer Inc, All Rights Reserved.
35
//
@@ -52,7 +54,7 @@ UINT8 CrosEcGetMotionSensorCount(HANDLE Handle)
5254
req.MaxSensorCount = 0;
5355
if (0 == CrosEcSendCommand(
5456
Handle,
55-
EC_CMD_MOTION_SENSE,
57+
EC_CMD_MOTION_SENSE_CMD,
5658
1,
5759
&req,
5860
sizeof(req),
@@ -95,7 +97,7 @@ CrosEcGetAccelIndeces(HANDLE Handle, UINT8 *BaseSensor, UINT8 *LidSensor)
9597
req.SensorNum = i;
9698
if (0 == CrosEcSendCommand(
9799
Handle,
98-
EC_CMD_MOTION_SENSE,
100+
EC_CMD_MOTION_SENSE_CMD,
99101
1,
100102
&req,
101103
sizeof(req),
@@ -105,18 +107,18 @@ CrosEcGetAccelIndeces(HANDLE Handle, UINT8 *BaseSensor, UINT8 *LidSensor)
105107
TraceError("%!FUNC! EC_CMD_MOTION_SENSE_INFO failed for sensor %d", i);
106108
continue;
107109
}
108-
if (res.SensorType != MOTION_SENSE_TYPE_ACCEL) {
110+
if (res.SensorType != MOTIONSENSE_TYPE_ACCEL) {
109111
TraceError("%!FUNC! Found sensor of type %d. Not Accelerometer - ignoring.", res.SensorType);
110112
continue;
111113
}
112114

113115
switch (res.Location) {
114-
case MOTION_SENSE_LOCATION_BASE:
116+
case MOTIONSENSE_LOC_BASE:
115117
TraceInformation("%!FUNC! Found base accel sensor at index: %d", i);
116118
FoundBase = TRUE;
117119
*BaseSensor = i;
118120
break;
119-
case MOTION_SENSE_LOCATION_LID:
121+
case MOTIONSENSE_LOC_LID:
120122
TraceInformation("%!FUNC! Found lid accel sensor at index: %d", i);
121123
FoundLid = TRUE;
122124
*LidSensor = i;
@@ -663,4 +665,4 @@ AccelerometerDevice::UpdateCachedThreshold(
663665
Exit:
664666
SENSOR_FunctionExit(Status);
665667
return Status;
666-
}
668+
}

FrameworkSensors/AlsClient.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
// SPDX-License-Identifier: MS-PL
2+
//
13
// Copyright (C) Microsoft Corporation, All Rights Reserved.
4+
// Copyright (C) Framework Computer Inc, All Rights Reserved.
25
//
36
// Abstract:
47
//
@@ -646,4 +649,4 @@ AlsDevice::UpdateCachedThreshold(
646649

647650
SENSOR_FunctionExit(Status);
648651
return Status;
649-
}
652+
}

FrameworkSensors/Clients.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
// SPDX-License-Identifier: MS-PL
2+
//
13
// Copyright (C) Microsoft Corporation, All Rights Reserved.
4+
// Copyright (C) Framework Computer Inc, All Rights Reserved.
25
//
36
// Abstract:
47
//
@@ -877,4 +880,4 @@ NTSTATUS OnCancelHistoryRetrieval(_In_ SENSOROBJECT SensorInstance, _Out_ PULONG
877880

878881
SENSOR_FunctionExit(Status);
879882
return Status;
880-
}
883+
}

FrameworkSensors/Clients.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
// SPDX-License-Identifier: MS-PL
2+
//
13
// Copyright (C) Microsoft Corporation, All Rights Reserved
4+
// Copyright (C) Framework Computer Inc, All Rights Reserved.
25
//
36
// Abstract:
47
//

FrameworkSensors/Device.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
// SPDX-License-Identifier: MS-PL
2+
//
13
// Copyright (C) Microsoft Corporation, All Rights Reserved.
4+
// Copyright (C) Framework Computer Inc, All Rights Reserved.
25
//
36
// Abstract:
47
//

FrameworkSensors/Driver.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
// SPDX-License-Identifier: MS-PL
2+
//
13
// Copyright (C) Microsoft Corporation, All Rights Reserved.
4+
// Copyright (C) Framework Computer Inc, All Rights Reserved.
25
//
36
// Abstract:
47
//
@@ -97,4 +100,4 @@ OnDriverUnload(
97100
WPP_CLEANUP(Driver);
98101

99102
return;
100-
}
103+
}

FrameworkSensors/Driver.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
// SPDX-License-Identifier: MS-PL
2+
//
13
// Copyright (C) Microsoft Corporation, All Rights Reserved
4+
// Copyright (C) Framework Computer Inc, All Rights Reserved.
25
//
36
// Abstract:
47
//
@@ -28,4 +31,4 @@ EVT_WDF_DEVICE_RELEASE_HARDWARE OnReleaseHardware;
2831
EVT_WDF_DEVICE_D0_ENTRY OnD0Entry;
2932
EVT_WDF_DEVICE_D0_EXIT OnD0Exit;
3033

31-
WDF_EXTERN_C_END
34+
WDF_EXTERN_C_END

FrameworkSensors/EcCommunication.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MS-PL
2+
//
13
// Copyright (C) Framework Computer Inc, All Rights Reserved.
24
//
35
// Abstract:

FrameworkSensors/EcCommunication.h

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
//SPDX-License-Identifier: MS-PL
2+
//
13
//Copyright (C) Framework Computer Inc
2-
//Copyright (C) 2014 The ChromiumOS Authors
34
//
45
//Abstract:
56
//
@@ -16,24 +17,11 @@ extern "C" {
1617
#include <wdf.h>
1718
#include "Trace.h"
1819

19-
/* Command version mask */
20-
#define EC_VER_MASK(version) (1UL << (version))
21-
22-
#define EC_MEMMAP_ALS 0x80 /* ALS readings in lux (2 X 16 bits) */
23-
/* Unused 0x84 - 0x8f */
24-
#define EC_MEMMAP_ACC_STATUS 0x90 /* Accelerometer status (8 bits )*/
25-
/* Unused 0x91 */
26-
#define EC_MEMMAP_ACC_DATA 0x92 /* Accelerometers data 0x92 - 0x9f */
27-
/* 0x92: Lid Angle if available, LID_ANGLE_UNRELIABLE otherwise */
28-
/* 0x94 - 0x99: 1st Accelerometer */
29-
/* 0x9a - 0x9f: 2nd Accelerometer */
30-
31-
/* Define the format of the accelerometer mapped memory status byte. */
32-
#define EC_MEMMAP_ACC_STATUS_SAMPLE_ID_MASK 0x0f
33-
// BIT(4)
34-
#define EC_MEMMAP_ACC_STATUS_BUSY_BIT (1 << 4)
35-
// BIT(7)
36-
#define EC_MEMMAP_ACC_STATUS_PRESENCE_BIT (1 << 7)
20+
#include "ec_compat_win.h"
21+
#pragma pack(push, 1)
22+
#include "ec_commands.h"
23+
#pragma pack(pop)
24+
#pragma warning(pop) /* matches push in ec_compat_win.h */
3725

3826
#define FILE_DEVICE_CROS_EMBEDDED_CONTROLLER 0x80EC
3927

@@ -49,10 +37,6 @@ NTSTATUS ConnectToEc(
4937
_Inout_ HANDLE* Handle
5038
);
5139

52-
#define EC_CMD_MOTION_SENSE 0x002B
53-
#define EC_CMD_RGBKBD_SET_COLOR 0x013A
54-
#define EC_CMD_RGBKBD 0x013B
55-
5640
#define EC_RES_SUCCESS 0
5741
#define EC_INVALID_COMMAND 1
5842
#define EC_ERROR 2
@@ -115,16 +99,6 @@ typedef struct {
11599
UINT8 SensorNum;
116100
} EC_REQUEST_MOTION_SENSE_INFO;
117101

118-
#define MOTION_SENSE_TYPE_ACCEL 0x00
119-
#define MOTION_SENSE_TYPE_GYRO 0x01
120-
#define MOTION_SENSE_TYPE_MAG 0x02
121-
#define MOTION_SENSE_TYPE_PROX 0x03
122-
#define MOTION_SENSE_TYPE_LIGHT 0x04
123-
124-
#define MOTION_SENSE_LOCATION_BASE 0x00
125-
#define MOTION_SENSE_LOCATION_LID 0x01
126-
#define MOTION_SENSE_LOCATION_CAMERA 0x02
127-
128102
typedef struct {
129103
UINT8 SensorType;
130104
UINT8 Location;

FrameworkSensors/SimpleDeviceOrientationClient.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
// SPDX-License-Identifier: MS-PL
2+
//
13
// Copyright (C) Microsoft Corporation, All Rights Reserved.
4+
// Copyright (C) Framework Computer Inc, All Rights Reserved.
25
//
36
// Abstract:
47
//

0 commit comments

Comments
 (0)