Skip to content

Commit 4f90364

Browse files
committed
add depth to multi circular
Signed-off-by: Daniel Schaefer <dhs@frame.work>
1 parent 8cbc993 commit 4f90364

4 files changed

Lines changed: 17 additions & 6 deletions

File tree

FrameworkArgb/Device.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,29 +220,38 @@ CalculateLampPositions(
220220
case 0:
221221
DeviceContext->Width = 80000;
222222
DeviceContext->Height = 80000;
223+
DeviceContext->Depth = 2000 * (LampCount / 8);
223224
for (UINT8 i = 0; i <= LampCount / 8; i++) {
224225
// 8 LEDs in a circle
225226
// z is 0 for all LEDs, they're all in the same plane
226227
// Bottom LED
227228
DeviceContext->LampPositions[i+0].x = 40000;
228229
DeviceContext->LampPositions[i+0].y = 0;
230+
DeviceContext->LampPositions[i+0].z = 2000 * i;
229231
DeviceContext->LampPositions[i+1].x = 60000;
230232
DeviceContext->LampPositions[i+1].y = 20000;
233+
DeviceContext->LampPositions[i+1].z = 2000 * i;
231234
// Right LED
232235
DeviceContext->LampPositions[i+2].x = 80000;
233236
DeviceContext->LampPositions[i+2].y = 40000;
237+
DeviceContext->LampPositions[i+2].z = 2000 * i;
234238
DeviceContext->LampPositions[i+3].x = 60000;
235239
DeviceContext->LampPositions[i+3].y = 60000;
240+
DeviceContext->LampPositions[i+3].z = 2000 * i;
236241
// Top LED
237242
DeviceContext->LampPositions[i+4].x = 40000;
238243
DeviceContext->LampPositions[i+4].y = 80000;
239-
DeviceContext->LampPositions[i+5].x = 20000;
244+
DeviceContext->LampPositions[i+1].z = 2000 * i;
245+
DeviceContext->LampPositions[i+4].x = 20000;
240246
DeviceContext->LampPositions[i+5].y = 60000;
247+
DeviceContext->LampPositions[i+5].z = 2000 * i;
241248
// Left LED
242249
DeviceContext->LampPositions[i+6].x = 0;
243250
DeviceContext->LampPositions[i+6].y = 40000;
251+
DeviceContext->LampPositions[i+6].z = 2000 * i;
244252
DeviceContext->LampPositions[i+7].x = 20000;
245253
DeviceContext->LampPositions[i+7].y = 20000;
254+
DeviceContext->LampPositions[i+7].z = 2000 * i;
246255
}
247256
break;
248257
// LEDs arranged in a circle single layer, even distance from each other
@@ -356,6 +365,7 @@ Return Value:
356365
deviceContext->LampCount = 0;
357366
deviceContext->Width = 0;
358367
deviceContext->Height = 0;
368+
deviceContext->Depth = 2000;
359369
LedArrangement = 0;
360370
status = CheckRegistryForLedConfig(device);
361371
if (NT_SUCCESS(status)) {

FrameworkArgb/Device.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ EVT_WDF_DRIVER_DEVICE_ADD EvtDeviceAdd;
2929
EVT_WDF_TIMER EvtTimerFunc;
3030

3131
#define MAX_LAMPARRAY_LAMP_COUNT 256
32-
#define LAMPARRAY_WIDTH 80000 // 80mm
33-
#define LAMPARRAY_HEIGHT 80000 // 80mm
34-
#define LAMPARRAY_DEPTH 20000 // 20mm
32+
//#define LAMPARRAY_WIDTH 80000 // 80mm
33+
//#define LAMPARRAY_HEIGHT 80000 // 80mm
34+
//#define LAMPARRAY_DEPTH 20000 // 20mm
3535
#define LAMPARRAY_KIND 0x07 // LampArrayKindChassis
3636
#define LAMPARRAY_UPDATE_INTERVAL 100000 // 10ms
3737

@@ -51,6 +51,7 @@ typedef struct _DEVICE_CONTEXT
5151
UINT16 LampCount;
5252
UINT32 Width;
5353
UINT32 Height;
54+
UINT32 Depth;
5455
Position LampPositions[MAX_LAMPARRAY_LAMP_COUNT];
5556
HID_DESCRIPTOR HidDescriptor;
5657
PHID_REPORT_DESCRIPTOR ReportDescriptor;

FrameworkArgb/LampArray.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ GetLampArrayAttributesReport(
7373
DeviceContext->LampCount,
7474
DeviceContext->Width,
7575
DeviceContext->Height,
76-
LAMPARRAY_DEPTH,
76+
DeviceContext->Depth,
7777
LAMPARRAY_KIND,
7878
LAMPARRAY_UPDATE_INTERVAL
7979
};

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ For example to control just 4 LEDs on the fan:
6262

6363
```
6464
sudo reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\ROOT\HIDCLASS\0000\Device Parameters" /v ReadFromRegistry /t REG_DWORD /d 1
65-
sudo reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\ROOT\HIDCLASS\0000\Device Parameters" /v LedCount /t REG_DWORD /d 4
65+
sudo reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\ROOT\HIDCLASS\0000\Device Parameters" /v LedCount /t REG_DWORD /d 8
6666
sudo reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\ROOT\HIDCLASS\0000\Device Parameters" /v LedArrangement /t REG_DWORD /d 0
6767
```
6868

0 commit comments

Comments
 (0)