Skip to content

Commit

Permalink
Merge pull request #35 from roleroz/master
Browse files Browse the repository at this point in the history
With this you can use cheap programmers like https://www.amazon.com/gp/product/B09DG384MK to program your micro-controllers in-circuit

Also, update Travis config for it to work with current versions. All software versions listed in the config were fairly old, and didn't work anymore
  • Loading branch information
mum4k authored Jan 30, 2023
2 parents e2b6c86 + 74aa270 commit 8b475bf
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 6 deletions.
11 changes: 6 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dist: trusty
dist: focal

notifications:
email:
Expand All @@ -11,15 +11,16 @@ addons:
packages:
- pkg-config
- python
- python-pip
- python3-pip
- unzip
- wget
- zip

before_install:
- wget https://github.com/bazelbuild/bazel/releases/download/0.27.2/bazel_0.27.2-linux-x86_64.deb
- sha256sum -c bazel/bazel_0.27.2-linux-x86_64.deb.sha256
- sudo dpkg --force-all -i bazel_0.27.2-linux-x86_64.deb
- wget https://github.com/bazelbuild/bazel/releases/download/6.0.0/bazel_6.0.0-linux-x86_64.deb
- wget https://github.com/bazelbuild/bazel/releases/download/6.0.0/bazel_6.0.0-linux-x86_64.deb.sha256
- sha256sum -c bazel_6.0.0-linux-x86_64.deb.sha256
- sudo dpkg --force-all -i bazel_6.0.0-linux-x86_64.deb
- sudo /usr/bin/pip install platformio

script:
Expand Down
3 changes: 3 additions & 0 deletions platformio/platformio.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ options.
values = [
"arduino_as_isp",
"direct",
"usbtinyisp",
],
doc = """
Type of programmer to use:
Expand All @@ -490,6 +491,8 @@ program it
- arduino_as_isp: Use an arduino programmed with the Arduino as ISP code to
in-circuit program another microcontroller (see
https://docs.arduino.cc/built-in-examples/arduino-isp/ArduinoISP for details).
- usbtinyisp: Use an USBTinyISP programmer, like
https://www.amazon.com/gp/product/B09DG384MK
""",
),
"deps": attr.label_list(
Expand Down
21 changes: 20 additions & 1 deletion platformio/platformio.ini.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ If you are working on the template, knock yourself out ;) #}
[platformio]
default_envs = {{ board }}

{%- if programmer == "usbtinyisp" %}
[env:myenv]
platform = atmelavr
framework = arduino
upload_protocol = usbtiny

{%- endif %}
[env:{{ board }}]
build_flags =
-Wall
Expand Down Expand Up @@ -38,4 +45,16 @@ upload_flags =
-c
stk500v1
upload_command = avrdude $UPLOAD_FLAGS -U flash:w:$SOURCE:i
{% endif %}
{%- endif %}
{%- if programmer == "usbtinyisp" %}
upload_protocol = custom
upload_flags =
-C
; use "tool-avrdude-megaavr" for the atmelmegaavr platform
${platformio.packages_dir}/tool-avrdude/avrdude.conf
-p
$BOARD_MCU
-c
usbtiny
upload_command = avrdude $UPLOAD_FLAGS -U flash:w:$SOURCE:i
{%- endif %}

0 comments on commit 8b475bf

Please sign in to comment.