Skip to content

Commit

Permalink
[osx] auto-flash working
Browse files Browse the repository at this point in the history
  • Loading branch information
jackhumbert committed Sep 8, 2017
1 parent 98bbe49 commit d534218
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions osx/qmk_toolbox/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ - (BOOL)canFlash:(Chipset)chipset {

- (void)deviceConnected:(Chipset)chipset {
devicesAvailable[chipset]+=1;
if ([_autoFlashButton state] == NSOnState) {
[self flashButtonClick:NULL];
}
}

- (void)deviceDisconnected:(Chipset)chipset {
Expand Down
6 changes: 3 additions & 3 deletions osx/qmk_toolbox/Flashing.m
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ - (void)flashDFU:(NSString *)mcu withFile:(NSString *)file {
result = [self runProcess:@"dfu-programmer" withArgs:@[mcu, @"erase", @"--force"]];
result = [self runProcess:@"dfu-programmer" withArgs:@[mcu, @"flash", file]];
if ([result containsString:@"Bootloader and code overlap."]) {
result = [self runProcess:@"dfu-programmer" withArgs:@[mcu, @"reset"]];
} else {
[_printer print:@"File is too large for device" withType:MessageType_Error];
} else {
result = [self runProcess:@"dfu-programmer" withArgs:@[mcu, @"reset"]];
}
}

Expand All @@ -100,7 +100,7 @@ - (void)eepromResetDFU:(NSString *)mcu {
}

- (void)flashCaterina:(NSString *)mcu withFile:(NSString *)file {
[self runProcess:@"avrdude" withArgs:@[@"-p", mcu, @"-c", @"avr109", @"-U", [NSString stringWithFormat:@"flash:w:\"%@\":i", file], @"-P", caterinaPort, @"-C", @"avrdude.conf"]];
[self runProcess:@"avrdude" withArgs:@[@"-p", mcu, @"-c", @"avr109", @"-U", [NSString stringWithFormat:@"flash:w:%@:i", file], @"-P", caterinaPort, @"-C", @"avrdude.conf"]];
}

- (void)eepromResetCaterina:(NSString *)mcu {
Expand Down

0 comments on commit d534218

Please sign in to comment.