Skip to content

Commit 45ce861

Browse files
authored
Merge pull request #14 from dannystaple/fix-workflows
Fix workflows with new versions
2 parents 653d248 + dcfc5bc commit 45ce861

6 files changed

Lines changed: 33 additions & 37 deletions

File tree

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919

2020
steps:
2121
- name: Checkout Code
22-
uses: actions/checkout@v3
22+
uses: actions/checkout@v4
2323

2424
- name: Set up Python ${{ matrix.python }}
25-
uses: actions/setup-python@v3
25+
uses: actions/setup-python@v5
2626
with:
2727
python-version: ${{ matrix.python }}
2828

@@ -35,7 +35,7 @@ jobs:
3535
make dist
3636
3737
- name: Upload Packages
38-
uses: actions/upload-artifact@v3
38+
uses: actions/upload-artifact@v4
3939
with:
4040
name: ${{ env.RELEASE_FILE }}
4141
path: dist/

.github/workflows/qa.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616

1717
steps:
1818
- name: Checkout Code
19-
uses: actions/checkout@v2
19+
uses: actions/checkout@v4
2020

2121
- name: Set up Python '3,11'
22-
uses: actions/setup-python@v3
22+
uses: actions/setup-python@v5
2323
with:
2424
python-version: '3.11'
2525

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616

1717
steps:
1818
- name: Checkout Code
19-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
2020

2121
- name: Set up Python ${{ matrix.python }}
22-
uses: actions/setup-python@v3
22+
uses: actions/setup-python@v5
2323
with:
2424
python-version: ${{ matrix.python }}
2525

check.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ done
4040
inform "Checking $LIBRARY_NAME $LIBRARY_VERSION\n"
4141

4242
inform "Checking for trailing whitespace..."
43-
if grep -IUrn --color "[[:blank:]]$" --exclude-dir=dist --exclude-dir=.tox --exclude-dir=.git --exclude=PKG-INFO; then
43+
if grep -IUrn --color "[[:blank:]]$" --exclude-dir=dist --exclude-dir=.tox --exclude-dir=.venv --exclude-dir=.git --exclude=PKG-INFO; then
4444
warning "Trailing whitespace found!"
4545
exit 1
4646
else
@@ -49,7 +49,7 @@ fi
4949
printf "\n"
5050

5151
inform "Checking for DOS line-endings..."
52-
if grep -lIUrn --color $'\r' --exclude-dir=dist --exclude-dir=.tox --exclude-dir=.git --exclude=Makefile; then
52+
if grep -lIUrn --color $'\r' --exclude-dir=dist --exclude-dir=.venv --exclude-dir=.tox --exclude-dir=.git --exclude=Makefile; then
5353
warning "DOS line-endings found!"
5454
exit 1
5555
else

firmware/firmware_update.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,11 @@
55
# Usage: python firmware_update.py filename.hex
66

77
import binascii
8-
98
import sys
109
import time
1110

12-
1311
from smbus2 import SMBus, i2c_msg
1412

15-
1613
# Small nuvoton:
1714
bootloader_id = 0xB001
1815
bootloader_version = 172
@@ -108,7 +105,7 @@ def write_page_to_aprom():
108105
try:
109106
i2c_read8(bootloader_i2c_addr, 0x00)
110107
break
111-
except:
108+
except Exception:
112109
print("waiting for page write to finish...")
113110

114111
def read_page_from_aprom():
@@ -126,7 +123,7 @@ def firmware_update(bin_data, i2c_address, chip_id):
126123

127124
try:
128125
i2c_read8(bootloader_i2c_addr, 0x00)
129-
except:
126+
except Exception:
130127
# We're not in bootloader yet, let's enter first
131128
confirm_id(i2c_address, chip_id)
132129
enter_bootloader(i2c_address)
@@ -187,7 +184,7 @@ def firmware_update(bin_data, i2c_address, chip_id):
187184

188185

189186
if __name__ == "__main__":
190-
filename = sys.argv[1];
187+
filename = sys.argv[1]
191188
# if bin_filename.endswith(".bin"):
192189
# bin_data = open(bin_filename, "rb").read()
193190
# bin_data = [ord(x) for x in bin_data]

firmware/set_i2c_address.py

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@
99
# flash write ongoing
1010
# flash write ongoing
1111
# flash write finished
12-
# pi@raspberrypi:~ $
13-
# pi@raspberrypi:~ $
12+
# pi@raspberrypi:~ $
13+
# pi@raspberrypi:~ $
1414
# pi@raspberrypi:~ $ i2cdetect -y 1
1515
# 0 1 2 3 4 5 6 7 8 9 a b c d e f
16-
# 00: -- -- -- -- -- -- -- -- -- -- -- -- --
17-
# 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
18-
# 20: -- -- 22 -- -- -- -- -- -- -- -- -- -- -- -- --
19-
# 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20-
# 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
21-
# 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
22-
# 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
23-
# 70: -- -- -- -- -- -- -- --
16+
# 00: -- -- -- -- -- -- -- -- -- -- -- -- --
17+
# 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
18+
# 20: -- -- 22 -- -- -- -- -- -- -- -- -- -- -- -- --
19+
# 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20+
# 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
21+
# 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
22+
# 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
23+
# 70: -- -- -- -- -- -- -- --
2424
# pi@raspberrypi:~ $ python set_i2c_address.py 0x22 0x23
2525
# Waiting for flash writing to start..
2626
# flash write ongoing
@@ -33,26 +33,25 @@
3333
# flash write finished
3434
# pi@raspberrypi:~ $ i2cdetect -y 1
3535
# 0 1 2 3 4 5 6 7 8 9 a b c d e f
36-
# 00: -- -- -- -- -- -- -- -- -- -- -- -- --
37-
# 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
38-
# 20: -- -- -- 23 -- -- -- -- -- -- -- -- -- -- -- --
39-
# 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40-
# 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
41-
# 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
42-
# 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
43-
# 70: -- -- -- -- -- -- -- --
36+
# 00: -- -- -- -- -- -- -- -- -- -- -- -- --
37+
# 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
38+
# 20: -- -- -- 23 -- -- -- -- -- -- -- -- -- -- -- --
39+
# 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40+
# 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
41+
# 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
42+
# 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
43+
# 70: -- -- -- -- -- -- -- --
4444

45-
import time
46-
import os
4745
import sys
46+
import time
4847

48+
import RPi.GPIO as GPIO
4949
from smbus2 import SMBus, i2c_msg
5050

51-
import RPi.GPIO as GPIO
5251
GPIO.setmode(GPIO.BCM)
5352

5453
CHIP_ID = 0xBA11
55-
VERSION = 1
54+
VERSION = 1
5655

5756

5857
# Registers specific to the trackball

0 commit comments

Comments
 (0)