Skip to content

Commit

Permalink
Merge pull request #3 from AqeeAqee/master
Browse files Browse the repository at this point in the history
Add support for my Leonardo bootloader
  • Loading branch information
eried authored Mar 13, 2019
2 parents 4454953 + 0d73a77 commit 34355fb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/ArduLoader/ArduboyUploader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<None Include="Register associations.cmd">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
Expand Down
3 changes: 2 additions & 1 deletion src/ArduLoader/FormMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,8 @@ private static bool GetArduboyPort(out string port)
using (var s = new ManagementObjectSearcher(
"SELECT Name, DeviceID, PNPDeviceID FROM Win32_SerialPort WHERE" +
"(PNPDeviceID LIKE '%VID_2341%PID_8036%') OR " + "(PNPDeviceID LIKE '%VID_2341%PID_0036%') OR " +
"(PNPDeviceID LIKE '%VID_1B4F%PID_9205%') OR " + "(PNPDeviceID LIKE '%VID_1B4F%PID_9206%')")
"(PNPDeviceID LIKE '%VID_1B4F%PID_9205%') OR " + "(PNPDeviceID LIKE '%VID_1B4F%PID_9206%') OR " +
"(PNPDeviceID LIKE '%VID_2A03%PID_0036%')")
) // SparkFun Pro Micro
{
foreach (var p in s.Get().Cast<ManagementBaseObject>().ToList())
Expand Down
16 changes: 16 additions & 0 deletions src/ArduLoader/Register associations.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@echo off
goto check_Permissions

:check_Permissions
echo Checking user rights...

net session >nul 2>&1
if %errorLevel% == 0 (
echo Success. Complete the association answering the message boxes.
%~dp0\abupload.exe -register
echo All done.
) else (
echo Failure: Run the script again as administrator.
)

pause >nul

0 comments on commit 34355fb

Please sign in to comment.