Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-cli
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Operations
Operations
Metrics
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-cli
Commits
61323e01
Commit
61323e01
authored
Dec 24, 2018
by
Cristian Maglie
Committed by
Cristian Maglie
Jan 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added check for missing 'recipe.output.tmp_file' during upload
parent
ca0e468b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
1 deletion
+49
-1
commands/commands_test.go
commands/commands_test.go
+4
-0
commands/testdata/sketchbook_with_custom_hardware/hardware/test2/avr/boards.txt
...chbook_with_custom_hardware/hardware/test2/avr/boards.txt
+25
-0
commands/testdata/sketchbook_with_custom_hardware/hardware/test2/avr/platform.txt
...book_with_custom_hardware/hardware/test2/avr/platform.txt
+14
-0
commands/upload/upload.go
commands/upload/upload.go
+6
-1
No files found.
commands/commands_test.go
View file @
61323e01
...
...
@@ -248,6 +248,10 @@ func TestUploadCommands(t *testing.T) {
// sketch without build
exitCode
,
d
=
executeWithArgs
(
t
,
"upload"
,
currSketchbookDir
.
Join
(
"TestSketch2"
)
.
String
(),
"-b"
,
"test:avr:testboard"
,
"-p"
,
"/dev/ttyACM0"
)
require
.
NotZero
(
t
,
exitCode
,
"exit code"
)
// platform without 'recipe.output.tmp_file' property
exitCode
,
d
=
executeWithArgs
(
t
,
"upload"
,
"-i"
,
currSketchbookDir
.
Join
(
"test.hex"
)
.
String
(),
"-b"
,
"test2:avr:testboard"
,
"-p"
,
"/dev/ttyACM0"
)
require
.
NotZero
(
t
,
exitCode
,
"exit code"
)
}
func
TestLibSearch
(
t
*
testing
.
T
)
{
...
...
commands/testdata/sketchbook_with_custom_hardware/hardware/test2/avr/boards.txt
0 → 100644
View file @
61323e01
testboard.name=Test Board
testboard.vid.0=0x2341
testboard.pid.0=0x8888
testboard.upload.tool=avrdude-none
testboard.upload.protocol=arduino
testboard.upload.maximum_size=32256
testboard.upload.maximum_data_size=2048
testboard.upload.speed=115200
testboard.bootloader.tool=avrdude
testboard.bootloader.low_fuses=0xFF
testboard.bootloader.high_fuses=0xDE
testboard.bootloader.extended_fuses=0xFD
testboard.bootloader.unlock_bits=0x3F
testboard.bootloader.lock_bits=0x0F
testboard.bootloader.file=optiboot/optiboot_atmega328.hex
testboard.build.mcu=atmega328p
testboard.build.f_cpu=16000000L
testboard.build.board=AVR_UNO
testboard.build.core=arduino:arduino
testboard.build.variant=standard
commands/testdata/sketchbook_with_custom_hardware/hardware/test2/avr/platform.txt
0 → 100644
View file @
61323e01
name=Test AVR Boards
version=1.0.0
# Removed for testing purposes
#recipe.output.tmp_file={build.project_name}.hex
# Fake AVR programmer tool for testing
# ------------------------------------
tools.avrdude-none.upload.params.verbose=VERBOSE
tools.avrdude-none.upload.params.quiet=QUIET
tools.avrdude-none.upload.params.verify=VERIFY
tools.avrdude-none.upload.params.noverify=NOVERIFY
tools.avrdude-none.upload.pattern=echo {upload.verbose} {upload.verify} "{build.path}/{build.project_name}.hex"
commands/upload/upload.go
View file @
61323e01
...
...
@@ -178,7 +178,12 @@ func run(command *cobra.Command, args []string) {
// Make the filename without the FQBN configs part
fqbn
.
Configs
=
properties
.
NewMap
()
fqbnSuffix
:=
strings
.
Replace
(
fqbn
.
String
(),
":"
,
"."
,
-
1
)
ext
:=
filepath
.
Ext
(
uploadProperties
.
ExpandPropsInString
(
"{recipe.output.tmp_file}"
))
outputTmpFile
,
ok
:=
uploadProperties
.
GetOk
(
"recipe.output.tmp_file"
)
if
!
ok
{
formatter
.
PrintErrorMessage
(
"The platform does not define the required property 'recipe.output.tmp_file'."
)
os
.
Exit
(
commands
.
ErrGeneric
)
}
ext
:=
filepath
.
Ext
(
outputTmpFile
)
var
importPath
*
paths
.
Path
var
importFile
string
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment