Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified PWM tool.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions PwmLib/PwmManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public bool FreqWatch
{
return _freqWatch;
}
private set
set
{
_freqWatch = value;
}
Expand Down Expand Up @@ -81,7 +81,7 @@ public uint SetFrequency(int frequency)
// Actually, I am in no way responsible for any damage of your device cause by this app, sorry :)
if (frequency < 100 || frequency > 100000)
{
OnError(frequency, $"Frequency {frequency} is not allowed. Frequency should be >= 200 and <= 2000.");
OnError(frequency, $"Frequency {frequency} is not allowed. Frequency should be >= 200 and <= 100000.");
return 100500;
}

Expand Down
12 changes: 12 additions & 0 deletions Wpf/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.ComponentModel;
using NotifyIcon = System.Windows.Forms.NotifyIcon;
using PwmLib;
using System.Windows.Threading;

namespace Wpf
{
Expand Down Expand Up @@ -55,6 +56,16 @@ protected override void OnStartup(StartupEventArgs e)
// by some reason _pwm.SetFrequency doesn't work if called from a background thread
// _pwm.LookAfterFreq();
CheckLastFrequency();

var timer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(5) };
timer.Tick += OnTimedEvent;
timer.Start();
_pwm.FreqWatch= true;
}

private void OnTimedEvent(object sender, EventArgs e)
{
CheckLastFrequency();
}

private void CheckLastFrequency()
Expand Down Expand Up @@ -130,6 +141,7 @@ private void setFreq_Click(object sender, EventArgs e)
}

_mainWindow.Show();
_mainWindow.Focus();
}
}
}