Skip to content

Commit

Permalink
Switched to MHV AVR Tools, added console output
Browse files Browse the repository at this point in the history
  • Loading branch information
petrockblog committed Feb 25, 2018
1 parent b54dcb8 commit 6fdabc2
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 60 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Release History

## Version 1.0.1

- Switched from WinAVR to MHV AVR Tools to add support for ATmega32U2 controllers in AVRDude
- Added more console output to enhance usability

## Version 1.0.0

- Initial release
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ A typical series of steps would be to first
1. scan for serial ports, `petrockutil scan serial`, then
2. read the firmware version, `petrockutil gamepadblock readversion <port>`, and then
3. if you do not have AVRDude installed, install it, `petrockutil gamepadblock prepare`,
3. update the firmware, `petrockutil gamepadblock update <port>`,
3. update the firmware, `petrockutil gamepadblock update <port>`.


# Download
Expand Down
13 changes: 9 additions & 4 deletions commands/gamepadblock.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ func GamepadBlock() cli.Command {
fmt.Println(" # Reads the version number of the current firmware on the GamepadBlock at given port")
fmt.Println()
fmt.Println(" petrockutil gamepadblock prepare")
fmt.Println(" # Installs avrdude to allow uploading of firmware .hex files to GamepadBlock")
fmt.Println(" # Installs avrdude to allow uploading of firmware .hex files to GamepadBlock.")
fmt.Println(" # Console needs to be run as administrator.")
fmt.Println()
fmt.Println(" petrockutil gamepadblock update <port>")
fmt.Println(" # Updates firmware of GamepadBlock at provided port to most recent version")
Expand Down Expand Up @@ -111,6 +112,7 @@ func GamepadBlock() cli.Command {
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
fmt.Println("Something went wrong. Is brew (https://brew.sh) installed?")
log.Fatal(err)
}

Expand All @@ -121,23 +123,24 @@ func GamepadBlock() cli.Command {
os.Exit(1)
}

fmt.Println("Installing winavr...")
fmt.Println("Installing AVR Tools ...")
fmt.Printf("Initial value for $PATH: %s\n", os.Getenv("PATH"))
dirName, _ := createPetrockblockDirectory()
exeFile := "https://downloads.petrockblock.com/petrockutil/WinAVR-20100110-install.exe"
exeFile := "https://downloads.petrockblock.com/petrockutil/MHV_AVR_Tools_20131101.exe"
fileName := downloadFromUrl(dirName, exeFile)
cmd := exec.Command(petrockblockDirName() + "\\" + fileName)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
log.Fatal(err)
}
fmt.Println("Installation successful. Please restart the console.")

default:
fmt.Println("OS not yet supported.")
}
case "update":
if len(c.Args()) < 1 {
if len(c.Args()) < 2 {
fmt.Println("Invalid number of arguments.")
usage()
return
Expand All @@ -150,6 +153,7 @@ func GamepadBlock() cli.Command {

fmt.Println("Downloading the latest firmware")
filename := downloadLatestFirmware()
defer os.Remove(filename)
fmt.Println("Downloaded firmware file", filename)

fmt.Println("Press the RESET button on the GameapadBlock to activate its update mode.")
Expand All @@ -165,6 +169,7 @@ func GamepadBlock() cli.Command {
log.Fatal(err)
fmt.Println("An error occurred during the firmware update process")
}

fmt.Println("Finished firmware update on port", port)

default:
Expand Down
80 changes: 26 additions & 54 deletions petrockutil.sublime-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,6 @@
},
"buffers":
[
{
"file": "petrockutil.go",
"settings":
{
"buffer_size": 324,
"line_ending": "Unix"
}
}
],
"build_system": "",
"build_system_choices":
Expand Down Expand Up @@ -235,10 +227,14 @@
"build_varint": "",
"command_palette":
{
"height": 89.0,
"last_filter": "9o",
"height": 389.0,
"last_filter": "link",
"selected_items":
[
[
"link",
"MarkdownEditing: New Inline Link"
],
[
"9o",
"GoSublime: Activate 9o"
Expand Down Expand Up @@ -504,7 +500,7 @@
"Package Control: Remove Package"
]
],
"width": 428.0
"width": 508.0
},
"console":
{
Expand All @@ -525,8 +521,17 @@
"side_bar_visible": false,
"status_bar_visible": false
},
"expanded_folders":
[
"/Users/florian/Programming/go/src/github.com/petrockblog/petrockutil"
],
"file_history":
[
"/Users/florian/Programming/go/src/github.com/petrockblog/petrockutil/CHANGELOG.md",
"/Users/florian/Programming/go/src/github.com/petrockblog/petrockutil/README.md",
"/Users/florian/Programming/go/src/github.com/petrockblog/petrockutil/Makefile",
"/Users/florian/Programming/go/src/github.com/petrockblog/petrockutil/petrockutil.go",
"/Users/florian/Programming/go/src/github.com/petrockblog/petrockutil/deployArchives.sh",
"/Users/florian/Programming/go/petrockutil/src/commands/util.go",
"/Users/florian/.zshrc",
"/Users/florian/Programming/go/petrockutil/src/petrockutil.sublime-project",
Expand Down Expand Up @@ -649,16 +654,11 @@
"/Users/florian/Downloads/N64_Arduino/N64_Arduino.pde",
"/Users/florian/Programming/Github/GamepadBlock/downloadFirmware",
"/Users/florian/Programming/Github/GamepadBlock/downloadFirmwareViaBTL.sh",
"/Users/florian/Programming/Github/GamepadBlock/VirtualSerial/VirtualSerial.h",
"/Users/florian/Programming/Github/GamepadBlock/VirtualSerial/makefile",
"/Users/florian/Programming/Github/GamepadBlock/VirtualSerial/VirtualSerial.c",
"/Users/florian/Programming/Github/GamepadBlock/src/makefile",
"/Users/florian/Programming/Github/GamepadBlock/makefile",
"/Users/florian/Programming/Github/GamepadBlock/VirtualSerial/Config/LUFAConfig.h"
"/Users/florian/Programming/Github/GamepadBlock/VirtualSerial/VirtualSerial.h"
],
"find":
{
"height": 39.0
"height": 23.0
},
"find_in_files":
{
Expand All @@ -672,6 +672,13 @@
"case_sensitive": false,
"find_history":
[
"VERSION",
"version",
"VERSION",
"GOARCH_2",
"darwin",
"linux",
"GOARCH"
],
"highlight": true,
"in_selection": false,
Expand All @@ -689,43 +696,8 @@
"groups":
[
{
"selected": 0,
"sheets":
[
{
"buffer": 0,
"file": "petrockutil.go",
"semi_transient": false,
"settings":
{
"buffer_size": 324,
"regions":
{
},
"selection":
[
[
0,
0
]
],
"settings":
{
"encoding_helper_encoding": "UTF-8",
"encoding_thread_running": true,
"incomplete_sync": null,
"remote_loading": false,
"synced": false,
"syntax": "Packages/GoSublime/syntax/GoSublime-Go.sublime-syntax",
"translate_tabs_to_spaces": false
},
"translation.x": 0.0,
"translation.y": 0.0,
"zoom_level": 1.0
},
"stack_index": 0,
"type": "text"
}
]
}
],
Expand Down Expand Up @@ -897,7 +869,7 @@
"show_minimap": true,
"show_open_files": true,
"show_tabs": true,
"side_bar_visible": true,
"side_bar_visible": false,
"side_bar_width": 256.0,
"status_bar_visible": true,
"template_settings":
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main

// VERSION of the software
const VERSION = "1.0.0"
const VERSION = "1.0.1"

0 comments on commit 6fdabc2

Please sign in to comment.