forked from qmk/qmk_toolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
LUFAHIDDevice.m
28 lines (23 loc) · 874 Bytes
/
LUFAHIDDevice.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#import "LUFAHIDDevice.h"
@implementation LUFAHIDDevice
- (id)initWithUSBDevice:(USBDevice *)usbDevice {
if (self = [super initWithUSBDevice:usbDevice]) {
if ([self revisionBCD] == 0x0936) {
self.name = @"QMK HID";
self.type = BootloaderTypeQMKHID;
} else {
self.name = @"LUFA HID";
self.type = BootloaderTypeLUFAHID;
}
}
return self;
}
-(void)flashWithMCU:(NSString *)mcu file:(NSString *)file {
[self runProcess:@"hid_bootloader_cli" withArgs:@[[NSString stringWithFormat:@"-mmcu=%@", mcu], file, @"-v"]];
}
// hid_bootloader_cli 210130 lacks -b flag
// Next LUFA release should have it thanks to abcminiuser/lufa#173
//-(void)resetWithMCU:(NSString *)mcu {
// [self runProcess:@"hid_bootloader_cli" withArgs:@[[NSString stringWithFormat:@"-mmcu=%@", mcu], @"-bv"]];
//}
@end