Skip to content
This repository was archived by the owner on Jul 6, 2023. It is now read-only.

Commit fd003d5

Browse files
author
anatoliis
committed
Running without an argument will show current frequency
1 parent 0b83b1b commit fd003d5

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

Program.cs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@ class Program
1010
public static void Main(string[] args)
1111
{
1212
DataHandler dh = new igfxDHLib.DataHandler();
13-
int targetPwmFrequency = 2000;
14-
15-
int frequencyFromArgument = ParseArguments(args);
16-
if (frequencyFromArgument != 0)
17-
targetPwmFrequency = frequencyFromArgument;
13+
int targetPwmFrequency = ParseArguments(args);
1814

1915
byte[] baseData = GetDataFromDriver(dh);
2016
int currentPwmFrequency = BitConverter.ToInt32(baseData, 4);
17+
if (targetPwmFrequency == 0)
18+
{
19+
ShowCurrentFrequency(currentPwmFrequency);
20+
return;
21+
}
2122

2223
if (currentPwmFrequency == targetPwmFrequency)
2324
return;
@@ -73,5 +74,10 @@ private static void UpdateBaseDataWithNewFrequency(byte[] baseData, int targetPw
7374
byte[] b = BitConverter.GetBytes(targetPwmFrequency);
7475
Array.Copy(b, 0, baseData, 4, 4);
7576
}
77+
78+
private static void ShowCurrentFrequency(int currentFrequency)
79+
{
80+
MessageBox.Show(string.Format("Current frequency: {0}", currentFrequency));
81+
}
7682
}
7783
}

0 commit comments

Comments
 (0)